commit bf82e71e8548b6681805c64d29b233d480e076a5 Author: 凌尛 <1254210241@qq.com> Date: Mon Jun 15 14:30:37 2026 +0800 初版提交 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5b1a804 --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..2c087fc --- /dev/null +++ b/.env.development @@ -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 diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..9735602 --- /dev/null +++ b/.env.production @@ -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 diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json new file mode 100644 index 0000000..a6661b6 --- /dev/null +++ b/.eslintrc-auto-import.json @@ -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 + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1fd56f0 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..d251d2e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,9 @@ +/dist/* +.local +.output.js +/node_modules/** + +**/*.svg +**/*.sh + +/public/* \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..6ca3ce5 --- /dev/null +++ b/.prettierrc @@ -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" +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..32b3071 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..799da72 --- /dev/null +++ b/README.en.md @@ -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/) diff --git a/README.md b/README.md new file mode 100644 index 0000000..ebc088b --- /dev/null +++ b/README.md @@ -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 '屏幕截图') | diff --git a/bin/build.bat b/bin/build.bat new file mode 100644 index 0000000..ecbb454 --- /dev/null +++ b/bin/build.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] Weḅdistļ +echo. + +%~d0 +cd %~dp0 + +cd .. +yarn build:prod + +pause \ No newline at end of file diff --git a/bin/package.bat b/bin/package.bat new file mode 100644 index 0000000..f5b24e0 --- /dev/null +++ b/bin/package.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] װWeḅnode_modulesļ +echo. + +%~d0 +cd %~dp0 + +cd .. +yarn --registry=https://registry.npmmirror.com + +pause \ No newline at end of file diff --git a/bin/run-web.bat b/bin/run-web.bat new file mode 100644 index 0000000..d2fe397 --- /dev/null +++ b/bin/run-web.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] ʹ Vite Web ̡ +echo. + +%~d0 +cd %~dp0 + +cd .. +yarn dev + +pause \ No newline at end of file diff --git a/dist.rar b/dist.rar new file mode 100644 index 0000000..868213c Binary files /dev/null and b/dist.rar differ diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000..ec506ef Binary files /dev/null and b/dist.zip differ diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..8b67e9e --- /dev/null +++ b/eslint.config.js @@ -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' + } + } +]; diff --git a/html/ie.html b/html/ie.html new file mode 100644 index 0000000..4d2773d --- /dev/null +++ b/html/ie.html @@ -0,0 +1,242 @@ + + + + + 请升级您的浏览器 + + + + + + +

请升级您的浏览器,以便我们更好的为您提供服务!

+

您正在使用 Internet Explorer 的早期版本(IE11以下版本或使用该内核的浏览器)。这意味着在升级浏览器前,您将无法访问此网站。

+
+

请注意:微软公司对Windows XP 及 Internet Explorer 早期版本的支持已经结束

+

+ 自 2016 年 1 月 12 日起,Microsoft 不再为 IE 11 + 以下版本提供相应支持和更新。没有关键的浏览器安全更新,您的电脑可能易受有害病毒、间谍软件和其他恶意软件的攻击,它们可以窃取或损害您的业务数据和信息。请参阅 + 微软对 Internet Explorer 早期版本的支持将于 2016 年 1 月 12 日结束的说明 + 。 +

+
+

您可以选择更先进的浏览器

+

推荐使用以下浏览器的最新版本。如果您的电脑已有以下浏览器的最新版本则直接使用该浏览器访问即可。

+ +
+ + diff --git a/index.html b/index.html new file mode 100644 index 0000000..900216d --- /dev/null +++ b/index.html @@ -0,0 +1,304 @@ + + + + + + + + + + 与书同行 + + + + + + + + + + +
+
+
+
+
+
正在加载系统资源,请耐心等待
+
+
+ + + + + diff --git a/kefuweixin.jpg b/kefuweixin.jpg new file mode 100644 index 0000000..83bc0d7 Binary files /dev/null and b/kefuweixin.jpg differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..82142ba --- /dev/null +++ b/package.json @@ -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" + } +} diff --git a/public/1.html b/public/1.html new file mode 100644 index 0000000..99264c9 --- /dev/null +++ b/public/1.html @@ -0,0 +1,682 @@ + + + + + + 电商数据看板 · 今日真实 + + + + + +
+ +
+
+
📅 今日订单
+
0
+ +
+
+
💰 今日总额
+
0
+ +
+
+
📅 本月订单
+
0
+ +
+
+
💰 本月总额
+
0
+ +
+
+ + +
+ + +
+
订单展示
+
    +
    + + +
    +
    小时订单分布
    +
    +
    + + +
    +
    客单价区间
    +
    +
    + + + + +
    + +
    + + + + diff --git a/public/favicon-log.ico b/public/favicon-log.ico new file mode 100644 index 0000000..3f919d8 Binary files /dev/null and b/public/favicon-log.ico differ diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..16a36b5 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/kefuweixin.jpg b/public/kefuweixin.jpg new file mode 100644 index 0000000..d8eddea Binary files /dev/null and b/public/kefuweixin.jpg differ diff --git a/public/templates/GoodsInfoTemplate.xlsx b/public/templates/GoodsInfoTemplate.xlsx new file mode 100644 index 0000000..d9a0e06 Binary files /dev/null and b/public/templates/GoodsInfoTemplate.xlsx differ diff --git a/public/templates/depotRule.doc b/public/templates/depotRule.doc new file mode 100644 index 0000000..ee5031d Binary files /dev/null and b/public/templates/depotRule.doc differ diff --git a/public/utilFile/CLodop.zip b/public/utilFile/CLodop.zip new file mode 100644 index 0000000..96d47b2 Binary files /dev/null and b/public/utilFile/CLodop.zip differ diff --git a/public/utilFile/PDDPrintClient.rar b/public/utilFile/PDDPrintClient.rar new file mode 100644 index 0000000..5411135 Binary files /dev/null and b/public/utilFile/PDDPrintClient.rar differ diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..1dd27e1 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,165 @@ + + + diff --git a/src/animate.ts b/src/animate.ts new file mode 100644 index 0000000..7a23df8 --- /dev/null +++ b/src/animate.ts @@ -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 +}; diff --git a/src/api/demo/demo/index.ts b/src/api/demo/demo/index.ts new file mode 100644 index 0000000..7441720 --- /dev/null +++ b/src/api/demo/demo/index.ts @@ -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 => { + return request({ + url: '/demo/demo/list', + method: 'get', + params: query + }); +}; + +/** + * 查询测试单详细 + * @param id + */ +export const getDemo = (id: string | number): AxiosPromise => { + 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) => { + return request({ + url: '/demo/demo/' + id, + method: 'delete' + }); +}; diff --git a/src/api/demo/demo/types.ts b/src/api/demo/demo/types.ts new file mode 100644 index 0000000..ea51d32 --- /dev/null +++ b/src/api/demo/demo/types.ts @@ -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; +} diff --git a/src/api/demo/tree/index.ts b/src/api/demo/tree/index.ts new file mode 100644 index 0000000..562deb6 --- /dev/null +++ b/src/api/demo/tree/index.ts @@ -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 => { + return request({ + url: '/demo/tree/list', + method: 'get', + params: query + }); +}; + +/** + * 查询测试树详细 + * @param id + */ +export const getTree = (id: string | number): AxiosPromise => { + 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) => { + return request({ + url: '/demo/tree/' + id, + method: 'delete' + }); +}; diff --git a/src/api/demo/tree/types.ts b/src/api/demo/tree/types.ts new file mode 100644 index 0000000..e164d8b --- /dev/null +++ b/src/api/demo/tree/types.ts @@ -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; +} diff --git a/src/api/login.ts b/src/api/login.ts new file mode 100644 index 0000000..35e6a4e --- /dev/null +++ b/src/api/login.ts @@ -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 { + 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 { + return request({ + url: '/auth/code', + headers: { + isToken: false + }, + method: 'get', + timeout: 20000 + }); +} + +/** + * 第三方登录 + */ +export function callback(data: LoginData): AxiosPromise { + const LoginData = { + ...data, + clientId: clientId, + grantType: 'social' + }; + return request({ + url: '/auth/social/callback', + method: 'post', + data: LoginData + }); +} + +// 获取用户详细信息 +export function getInfo(): AxiosPromise { + return request({ + url: '/system/user/getInfo', + method: 'get' + }); +} + +// 获取租户列表 +export function getTenantList(isToken: boolean): AxiosPromise { + return request({ + url: '/auth/tenant/list', + headers: { + isToken: isToken + }, + method: 'get' + }); +} diff --git a/src/api/menu.ts b/src/api/menu.ts new file mode 100644 index 0000000..a3ae80e --- /dev/null +++ b/src/api/menu.ts @@ -0,0 +1,11 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { RouteRecordRaw } from 'vue-router'; + +// 获取路由 +export function getRouters(): AxiosPromise { + return request({ + url: '/system/menu/getRouters', + method: 'get' + }); +} diff --git a/src/api/monitor/cache/index.ts b/src/api/monitor/cache/index.ts new file mode 100644 index 0000000..e45d6fb --- /dev/null +++ b/src/api/monitor/cache/index.ts @@ -0,0 +1,59 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { CacheVO } from './types'; + +// 查询缓存详细 +export function getCache(): AxiosPromise { + 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' + }); +} diff --git a/src/api/monitor/cache/types.ts b/src/api/monitor/cache/types.ts new file mode 100644 index 0000000..4017b65 --- /dev/null +++ b/src/api/monitor/cache/types.ts @@ -0,0 +1,7 @@ +export interface CacheVO { + commandStats: Array<{ name: string; value: string }>; + + dbSize: number; + + info: { [key: string]: string }; +} diff --git a/src/api/monitor/loginInfo/index.ts b/src/api/monitor/loginInfo/index.ts new file mode 100644 index 0000000..f8877c9 --- /dev/null +++ b/src/api/monitor/loginInfo/index.ts @@ -0,0 +1,36 @@ +import request from '@/utils/request'; +import { LoginInfoQuery, LoginInfoVO } from './types'; +import { AxiosPromise } from 'axios'; + +// 查询登录日志列表 +export function list(query: LoginInfoQuery): AxiosPromise { + return request({ + url: '/monitor/logininfor/list', + method: 'get', + params: query + }); +} + +// 删除登录日志 +export function delLoginInfo(infoId: string | number | Array) { + return request({ + url: '/monitor/logininfor/' + infoId, + method: 'delete' + }); +} + +// 解锁用户登录状态 +export function unlockLoginInfo(userName: string | Array) { + return request({ + url: '/monitor/logininfor/unlock/' + userName, + method: 'get' + }); +} + +// 清空登录日志 +export function cleanLoginInfo() { + return request({ + url: '/monitor/logininfor/clean', + method: 'delete' + }); +} diff --git a/src/api/monitor/loginInfo/types.ts b/src/api/monitor/loginInfo/types.ts new file mode 100644 index 0000000..202c779 --- /dev/null +++ b/src/api/monitor/loginInfo/types.ts @@ -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; +} diff --git a/src/api/monitor/online/index.ts b/src/api/monitor/online/index.ts new file mode 100644 index 0000000..5b3221c --- /dev/null +++ b/src/api/monitor/online/index.ts @@ -0,0 +1,36 @@ +import request from '@/utils/request'; +import { OnlineQuery, OnlineVO } from './types'; +import { AxiosPromise } from 'axios'; + +// 查询在线用户列表 +export function list(query: OnlineQuery): AxiosPromise { + 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' + }); +} diff --git a/src/api/monitor/online/types.ts b/src/api/monitor/online/types.ts new file mode 100644 index 0000000..8c0ec27 --- /dev/null +++ b/src/api/monitor/online/types.ts @@ -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; +} diff --git a/src/api/monitor/operlog/index.ts b/src/api/monitor/operlog/index.ts new file mode 100644 index 0000000..7ac3453 --- /dev/null +++ b/src/api/monitor/operlog/index.ts @@ -0,0 +1,28 @@ +import request from '@/utils/request'; +import { OperLogQuery, OperLogVO } from './types'; +import { AxiosPromise } from 'axios'; + +// 查询操作日志列表 +export function list(query: OperLogQuery): AxiosPromise { + return request({ + url: '/monitor/operlog/list', + method: 'get', + params: query + }); +} + +// 删除操作日志 +export function delOperlog(operId: string | number | Array) { + return request({ + url: '/monitor/operlog/' + operId, + method: 'delete' + }); +} + +// 清空操作日志 +export function cleanOperlog() { + return request({ + url: '/monitor/operlog/clean', + method: 'delete' + }); +} diff --git a/src/api/monitor/operlog/types.ts b/src/api/monitor/operlog/types.ts new file mode 100644 index 0000000..10f65c7 --- /dev/null +++ b/src/api/monitor/operlog/types.ts @@ -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; +} diff --git a/src/api/system/client/index.ts b/src/api/system/client/index.ts new file mode 100644 index 0000000..6b302b0 --- /dev/null +++ b/src/api/system/client/index.ts @@ -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 => { + return request({ + url: '/system/client/list', + method: 'get', + params: query + }); +}; + +/** + * 查询客户端管理详细 + * @param id + */ +export const getClient = (id: string | number): AxiosPromise => { + 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) => { + 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 + }); +} diff --git a/src/api/system/client/types.ts b/src/api/system/client/types.ts new file mode 100644 index 0000000..142118d --- /dev/null +++ b/src/api/system/client/types.ts @@ -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; +} diff --git a/src/api/system/config/index.ts b/src/api/system/config/index.ts new file mode 100644 index 0000000..1e4842d --- /dev/null +++ b/src/api/system/config/index.ts @@ -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 { + return request({ + url: '/system/config/list', + method: 'get', + params: query + }); +} + +// 查询参数详细 +export function getConfig(configId: string | number): AxiosPromise { + return request({ + url: '/system/config/' + configId, + method: 'get' + }); +} + +// 根据参数键名查询参数值 +export function getConfigKey(configKey: string): AxiosPromise { + 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) { + return request({ + url: '/system/config/' + configId, + method: 'delete' + }); +} + +// 刷新参数缓存 +export function refreshCache() { + return request({ + url: '/system/config/refreshCache', + method: 'delete' + }); +} diff --git a/src/api/system/config/types.ts b/src/api/system/config/types.ts new file mode 100644 index 0000000..b68f073 --- /dev/null +++ b/src/api/system/config/types.ts @@ -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; +} diff --git a/src/api/system/dept/index.ts b/src/api/system/dept/index.ts new file mode 100644 index 0000000..f16cb2c --- /dev/null +++ b/src/api/system/dept/index.ts @@ -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 => { + return request({ + url: '/system/dept/optionselect?deptIds=' + deptIds, + method: 'get' + }); +}; + +// 查询部门列表(排除节点) +export const listDeptExcludeChild = (deptId: string | number): AxiosPromise => { + return request({ + url: '/system/dept/list/exclude/' + deptId, + method: 'get' + }); +}; + +// 查询部门详细 +export const getDept = (deptId: string | number): AxiosPromise => { + return request({ + url: '/system/dept/' + deptId, + method: 'get' + }); +}; + +// 查询部门下拉树结构 +export const treeselect = (): AxiosPromise => { + 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' + }); +}; diff --git a/src/api/system/dept/types.ts b/src/api/system/dept/types.ts new file mode 100644 index 0000000..adaefd2 --- /dev/null +++ b/src/api/system/dept/types.ts @@ -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; +} diff --git a/src/api/system/dict/data/index.ts b/src/api/system/dict/data/index.ts new file mode 100644 index 0000000..7692abc --- /dev/null +++ b/src/api/system/dict/data/index.ts @@ -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 { + return request({ + url: '/system/dict/data/type/' + dictType, + method: 'get' + }); +} + +// 查询字典数据列表 +export function listData(query: DictDataQuery): AxiosPromise { + return request({ + url: '/system/dict/data/list', + method: 'get', + params: query + }); +} + +// 查询字典数据详细 +export function getData(dictCode: string | number): AxiosPromise { + 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) { + return request({ + url: '/system/dict/data/' + dictCode, + method: 'delete' + }); +} diff --git a/src/api/system/dict/data/types.ts b/src/api/system/dict/data/types.ts new file mode 100644 index 0000000..e4abb9b --- /dev/null +++ b/src/api/system/dict/data/types.ts @@ -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; +} diff --git a/src/api/system/dict/type/index.ts b/src/api/system/dict/type/index.ts new file mode 100644 index 0000000..7dc3d66 --- /dev/null +++ b/src/api/system/dict/type/index.ts @@ -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 { + return request({ + url: '/system/dict/type/list', + method: 'get', + params: query + }); +} + +// 查询字典类型详细 +export function getType(dictId: number | string): AxiosPromise { + 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) { + 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 { + return request({ + url: '/system/dict/type/optionselect', + method: 'get' + }); +} diff --git a/src/api/system/dict/type/types.ts b/src/api/system/dict/type/types.ts new file mode 100644 index 0000000..4987dbf --- /dev/null +++ b/src/api/system/dict/type/types.ts @@ -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; +} diff --git a/src/api/system/menu/index.ts b/src/api/system/menu/index.ts new file mode 100644 index 0000000..7a0cf74 --- /dev/null +++ b/src/api/system/menu/index.ts @@ -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 => { + return request({ + url: '/system/menu/list', + method: 'get', + params: query + }); +}; + +// 查询菜单详细 +export const getMenu = (menuId: string | number): AxiosPromise => { + return request({ + url: '/system/menu/' + menuId, + method: 'get' + }); +}; + +// 查询菜单下拉树结构 +export const treeselect = (): AxiosPromise => { + return request({ + url: '/system/menu/treeselect', + method: 'get' + }); +}; + +// 根据角色ID查询菜单下拉树结构 +export const roleMenuTreeselect = (roleId: string | number): AxiosPromise => { + return request({ + url: '/system/menu/roleMenuTreeselect/' + roleId, + method: 'get' + }); +}; + +// 根据角色ID查询菜单下拉树结构 +export const tenantPackageMenuTreeselect = (packageId: string | number): AxiosPromise => { + 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' + }); +}; diff --git a/src/api/system/menu/types.ts b/src/api/system/menu/types.ts new file mode 100644 index 0000000..ca19840 --- /dev/null +++ b/src/api/system/menu/types.ts @@ -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; +} diff --git a/src/api/system/notice/index.ts b/src/api/system/notice/index.ts new file mode 100644 index 0000000..285d1f4 --- /dev/null +++ b/src/api/system/notice/index.ts @@ -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 { + return request({ + url: '/system/notice/list', + method: 'get', + params: query + }); +} + +// 查询公告详细 +export function getNotice(noticeId: string | number): AxiosPromise { + 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) { + return request({ + url: '/system/notice/' + noticeId, + method: 'delete' + }); +} diff --git a/src/api/system/notice/types.ts b/src/api/system/notice/types.ts new file mode 100644 index 0000000..abfd5b2 --- /dev/null +++ b/src/api/system/notice/types.ts @@ -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; +} diff --git a/src/api/system/oss/index.ts b/src/api/system/oss/index.ts new file mode 100644 index 0000000..4472112 --- /dev/null +++ b/src/api/system/oss/index.ts @@ -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 { + return request({ + url: '/resource/oss/list', + method: 'get', + params: query + }); +} + +// 查询OSS对象基于id串 +export function listByIds(ossId: string | number): AxiosPromise { + return request({ + url: '/resource/oss/listByIds/' + ossId, + method: 'get' + }); +} + +// 删除OSS对象存储 +export function delOss(ossId: string | number | Array) { + return request({ + url: '/resource/oss/' + ossId, + method: 'delete' + }); +} diff --git a/src/api/system/oss/types.ts b/src/api/system/oss/types.ts new file mode 100644 index 0000000..bc0bc1f --- /dev/null +++ b/src/api/system/oss/types.ts @@ -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; +} diff --git a/src/api/system/ossConfig/index.ts b/src/api/system/ossConfig/index.ts new file mode 100644 index 0000000..d0faefe --- /dev/null +++ b/src/api/system/ossConfig/index.ts @@ -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 { + return request({ + url: '/resource/oss/config/list', + method: 'get', + params: query + }); +} + +// 查询对象存储配置详细 +export function getOssConfig(ossConfigId: string | number): AxiosPromise { + 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) { + 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 + }); +} diff --git a/src/api/system/ossConfig/types.ts b/src/api/system/ossConfig/types.ts new file mode 100644 index 0000000..d227bd0 --- /dev/null +++ b/src/api/system/ossConfig/types.ts @@ -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; +} diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts new file mode 100644 index 0000000..5f6ab18 --- /dev/null +++ b/src/api/system/post/index.ts @@ -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 { + return request({ + url: '/system/post/list', + method: 'get', + params: query + }); +} + +// 查询岗位详细 +export function getPost(postId: string | number): AxiosPromise { + return request({ + url: '/system/post/' + postId, + method: 'get' + }); +} + +// 获取岗位选择框列表 +export function optionselect(deptId?: number | string, postIds?: (number | string)[]): AxiosPromise { + 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' + }); +} diff --git a/src/api/system/post/types.ts b/src/api/system/post/types.ts new file mode 100644 index 0000000..45a0540 --- /dev/null +++ b/src/api/system/post/types.ts @@ -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; +} diff --git a/src/api/system/role/index.ts b/src/api/system/role/index.ts new file mode 100644 index 0000000..fb0fcab --- /dev/null +++ b/src/api/system/role/index.ts @@ -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 => { + return request({ + url: '/system/role/list', + method: 'get', + params: query + }); +}; + +/** + * 通过roleIds查询角色 + * @param roleIds + */ +export const optionSelect = (roleIds: (number | string)[]): AxiosPromise => { + return request({ + url: '/system/role/optionselect?roleIds=' + roleIds, + method: 'get' + }); +}; + +/** + * 查询角色详细 + */ +export const getRole = (roleId: string | number): AxiosPromise => { + 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) => { + return request({ + url: '/system/role/' + roleId, + method: 'delete' + }); +}; + +/** + * 查询角色已授权用户列表 + */ +export const allocatedUserList = (query: UserQuery): AxiosPromise => { + return request({ + url: '/system/role/authUser/allocatedList', + method: 'get', + params: query + }); +}; + +/** + * 查询角色未授权用户列表 + */ +export const unallocatedUserList = (query: UserQuery): AxiosPromise => { + 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 => { + return request({ + url: '/system/role/deptTree/' + roleId, + method: 'get' + }); +}; + +export default { + optionSelect, + listRole +}; diff --git a/src/api/system/role/types.ts b/src/api/system/role/types.ts new file mode 100644 index 0000000..7dbb6ff --- /dev/null +++ b/src/api/system/role/types.ts @@ -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; + deptIds?: Array; + 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; + deptIds: Array; +} diff --git a/src/api/system/social/auth.ts b/src/api/system/social/auth.ts new file mode 100644 index 0000000..69f0d7e --- /dev/null +++ b/src/api/system/social/auth.ts @@ -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' + }); +} diff --git a/src/api/system/tenant/index.ts b/src/api/system/tenant/index.ts new file mode 100644 index 0000000..e7d743f --- /dev/null +++ b/src/api/system/tenant/index.ts @@ -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 { + return request({ + url: '/system/tenant/list', + method: 'get', + params: query + }); +} + +// 查询租户详细 +export function getTenant(id: string | number): AxiosPromise { + 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) { + 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' + }) +} + + diff --git a/src/api/system/tenant/types.ts b/src/api/system/tenant/types.ts new file mode 100644 index 0000000..25395fa --- /dev/null +++ b/src/api/system/tenant/types.ts @@ -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; +} diff --git a/src/api/system/tenantPackage/index.ts b/src/api/system/tenantPackage/index.ts new file mode 100644 index 0000000..70d0dab --- /dev/null +++ b/src/api/system/tenantPackage/index.ts @@ -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 { + return request({ + url: '/system/tenant/package/list', + method: 'get', + params: query + }); +} + +// 查询租户套餐下拉选列表 +export function selectTenantPackage(): AxiosPromise { + return request({ + url: '/system/tenant/package/selectList', + method: 'get' + }); +} + +// 查询租户套餐详细 +export function getTenantPackage(packageId: string | number): AxiosPromise { + 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) { + return request({ + url: '/system/tenant/package/' + packageId, + method: 'delete' + }); +} diff --git a/src/api/system/tenantPackage/types.ts b/src/api/system/tenantPackage/types.ts new file mode 100644 index 0000000..c24b8fc --- /dev/null +++ b/src/api/system/tenantPackage/types.ts @@ -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; +} diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts new file mode 100644 index 0000000..883a729 --- /dev/null +++ b/src/api/system/user/index.ts @@ -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 => { + return request({ + url: '/system/user/list', + method: 'get', + params: query + }); +}; + +/** + * 通过用户ids查询用户 + * @param userIds + */ +export const optionSelect = (userIds: (number | string)[]): AxiosPromise => { + return request({ + url: '/system/user/optionselect?userIds=' + userIds, + method: 'get' + }); +}; + +/** + * 获取用户详情 + * @param userId + */ +export const getUser = (userId?: string | number): AxiosPromise => { + 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) => { + 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 => { + 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 => { + return request({ + url: '/system/user/list/dept/' + deptId, + method: 'get' + }); +}; + +/** + * 查询部门下拉树结构 + */ +export const deptTreeSelect = (): AxiosPromise => { + 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 +}; diff --git a/src/api/system/user/newuser/index.ts b/src/api/system/user/newuser/index.ts new file mode 100644 index 0000000..e3c570d --- /dev/null +++ b/src/api/system/user/newuser/index.ts @@ -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 + }); +}; diff --git a/src/api/system/user/newuser/types.ts b/src/api/system/user/newuser/types.ts new file mode 100644 index 0000000..8f0b13d --- /dev/null +++ b/src/api/system/user/newuser/types.ts @@ -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, +} diff --git a/src/api/system/user/types.ts b/src/api/system/user/types.ts new file mode 100644 index 0000000..0f3d4f1 --- /dev/null +++ b/src/api/system/user/types.ts @@ -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; +} diff --git a/src/api/tool/gen/index.ts b/src/api/tool/gen/index.ts new file mode 100644 index 0000000..efe079c --- /dev/null +++ b/src/api/tool/gen/index.ts @@ -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 => { + return request({ + url: '/tool/gen/list', + method: 'get', + params: query + }); +}; +// 查询db数据库列表 +export const listDbTable = (query: DbTableQuery): AxiosPromise => { + return request({ + url: '/tool/gen/db/list', + method: 'get', + params: query + }); +}; + +// 查询表详细信息 +export const getGenTable = (tableId: string | number): AxiosPromise => { + return request({ + url: '/tool/gen/' + tableId, + method: 'get' + }); +}; + +// 修改代码生成信息 +export const updateGenTable = (data: DbTableForm): AxiosPromise => { + return request({ + url: '/tool/gen', + method: 'put', + data: data + }); +}; + +// 导入表 +export const importTable = (data: { tables: string; dataName: string }): AxiosPromise => { + 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) => { + 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' + }); +}; diff --git a/src/api/tool/gen/types.ts b/src/api/tool/gen/types.ts new file mode 100644 index 0000000..7f7b62f --- /dev/null +++ b/src/api/tool/gen/types.ts @@ -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; +} diff --git a/src/api/tool/shelving/index.ts b/src/api/tool/shelving/index.ts new file mode 100644 index 0000000..621c3b1 --- /dev/null +++ b/src/api/tool/shelving/index.ts @@ -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 => { + 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 => { + + 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; +} \ No newline at end of file diff --git a/src/api/types.ts b/src/api/types.ts new file mode 100644 index 0000000..85e8c6a --- /dev/null +++ b/src/api/types.ts @@ -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[]; +} diff --git a/src/api/workflow/category/index.ts b/src/api/workflow/category/index.ts new file mode 100644 index 0000000..b6a83ea --- /dev/null +++ b/src/api/workflow/category/index.ts @@ -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 => { + return request({ + url: '/workflow/category/list', + method: 'get', + params: query + }); +}; + +/** + * 查询流程分类详细 + * @param categoryId + */ +export const getCategory = (categoryId: string | number): AxiosPromise => { + 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) => { + return request({ + url: '/workflow/category/' + categoryId, + method: 'delete' + }); +}; + +/** + * 获取流程分类树列表 + * @param query 流程实例id + * @returns + */ +export const categoryTree = (query?: CategoryForm): AxiosPromise => { + return request({ + url: `/workflow/category/categoryTree`, + method: 'get', + params: query + }); +}; diff --git a/src/api/workflow/category/types.ts b/src/api/workflow/category/types.ts new file mode 100644 index 0000000..a093073 --- /dev/null +++ b/src/api/workflow/category/types.ts @@ -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; + +} diff --git a/src/api/workflow/definition/index.ts b/src/api/workflow/definition/index.ts new file mode 100644 index 0000000..49e6ee8 --- /dev/null +++ b/src/api/workflow/definition/index.ts @@ -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 => { + return request({ + url: `/workflow/definition/list`, + method: 'get', + params: query + }); +}; + +/** + * 查询未发布的流程定义列表 + * @param query 流程实例id + * @returns + */ +export const unPublishList = (query: FlowDefinitionQuery): AxiosPromise => { + return request({ + url: `/workflow/definition/unPublishList`, + method: 'get', + params: query + }); +}; + +/** + * 通过流程定义id获取xml + * @param definitionId 流程定义id + * @returns + */ +export const definitionXml = (definitionId: string): AxiosPromise => { + 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' + }); +}; diff --git a/src/api/workflow/definition/types.ts b/src/api/workflow/definition/types.ts new file mode 100644 index 0000000..5de7f77 --- /dev/null +++ b/src/api/workflow/definition/types.ts @@ -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; +} diff --git a/src/api/workflow/instance/index.ts b/src/api/workflow/instance/index.ts new file mode 100644 index 0000000..42d748d --- /dev/null +++ b/src/api/workflow/instance/index.ts @@ -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 => { + return request({ + url: '/workflow/instance/pageByRunning', + method: 'get', + params: query + }); +}; + +/** + * 查询已完成实例列表 + * @param query + * @returns {*} + */ +export const pageByFinish = (query: FlowInstanceQuery): AxiosPromise => { + 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 => { + 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) => { + 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 + }); +}; diff --git a/src/api/workflow/instance/types.ts b/src/api/workflow/instance/types.ts new file mode 100644 index 0000000..a12dab3 --- /dev/null +++ b/src/api/workflow/instance/types.ts @@ -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[]; +} diff --git a/src/api/workflow/leave/index.ts b/src/api/workflow/leave/index.ts new file mode 100644 index 0000000..4e6f363 --- /dev/null +++ b/src/api/workflow/leave/index.ts @@ -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 => { + return request({ + url: '/workflow/leave/list', + method: 'get', + params: query + }); +}; + +/** + * 查询请假详细 + * @param id + */ +export const getLeave = (id: string | number): AxiosPromise => { + return request({ + url: '/workflow/leave/' + id, + method: 'get' + }); +}; + +/** + * 新增请假 + * @param data + */ +export const addLeave = (data: LeaveForm): AxiosPromise => { + return request({ + url: '/workflow/leave', + method: 'post', + data: data + }); +}; + +/** + * 修改请假 + * @param data + */ +export const updateLeave = (data: LeaveForm): AxiosPromise => { + return request({ + url: '/workflow/leave', + method: 'put', + data: data + }); +}; + +/** + * 删除请假 + * @param id + */ +export const delLeave = (id: string | number | Array) => { + return request({ + url: '/workflow/leave/' + id, + method: 'delete' + }); +}; diff --git a/src/api/workflow/leave/types.ts b/src/api/workflow/leave/types.ts new file mode 100644 index 0000000..a44d35d --- /dev/null +++ b/src/api/workflow/leave/types.ts @@ -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; +} diff --git a/src/api/workflow/task/index.ts b/src/api/workflow/task/index.ts new file mode 100644 index 0000000..55ede45 --- /dev/null +++ b/src/api/workflow/task/index.ts @@ -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 => { + return request({ + url: '/workflow/task/pageByTaskWait', + method: 'get', + params: query + }); +}; + +/** + * 查询已办列表 + * @param query + * @returns {*} + */ +export const pageByTaskFinish = (query: TaskQuery): AxiosPromise => { + return request({ + url: '/workflow/task/pageByTaskFinish', + method: 'get', + params: query + }); +}; + +/** + * 查询当前用户的抄送列表 + * @param query + * @returns {*} + */ +export const pageByTaskCopy = (query: TaskQuery): AxiosPromise => { + return request({ + url: '/workflow/task/pageByTaskCopy', + method: 'get', + params: query + }); +}; + +/** + * 当前租户所有待办任务 + * @param query + * @returns {*} + */ +export const pageByAllTaskWait = (query: TaskQuery): AxiosPromise => { + return request({ + url: '/workflow/task/pageByAllTaskWait', + method: 'get', + params: query + }); +}; + +/** + * 当前租户所有已办任务 + * @param query + * @returns {*} + */ +export const pageByAllTaskFinish = (query: TaskQuery): AxiosPromise => { + 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, 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' + }); +}; diff --git a/src/api/workflow/task/types.ts b/src/api/workflow/task/types.ts new file mode 100644 index 0000000..8ea803b --- /dev/null +++ b/src/api/workflow/task/types.ts @@ -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; +} diff --git a/src/api/workflow/workflowCommon/index.ts b/src/api/workflow/workflowCommon/index.ts new file mode 100644 index 0000000..0f5ce1b --- /dev/null +++ b/src/api/workflow/workflowCommon/index.ts @@ -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 + } + }); + } +}; diff --git a/src/api/workflow/workflowCommon/types.ts b/src/api/workflow/workflowCommon/types.ts new file mode 100644 index 0000000..3e7a71d --- /dev/null +++ b/src/api/workflow/workflowCommon/types.ts @@ -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; +} diff --git a/src/api/zhishu/account/index.ts b/src/api/zhishu/account/index.ts new file mode 100644 index 0000000..c5f4eb9 --- /dev/null +++ b/src/api/zhishu/account/index.ts @@ -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 => { + return request({ + url: '/zhishu/account/list', + method: 'get', + params: query + }); +}; diff --git a/src/api/zhishu/account/types.ts b/src/api/zhishu/account/types.ts new file mode 100644 index 0000000..20dc4f2 --- /dev/null +++ b/src/api/zhishu/account/types.ts @@ -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; +} \ No newline at end of file diff --git a/src/api/zhishu/audit/index.ts b/src/api/zhishu/audit/index.ts new file mode 100644 index 0000000..21d2632 --- /dev/null +++ b/src/api/zhishu/audit/index.ts @@ -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 => { + return request({ + url: '/zhishu/audit/list', + method: 'get', + params: query + }); +}; + +/** + * 查询审核详细 + * @param id + */ +export const getAudit = (id: string | number): AxiosPromise => { + 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) => { + 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 + }); +} diff --git a/src/api/zhishu/audit/types.ts b/src/api/zhishu/audit/types.ts new file mode 100644 index 0000000..e607000 --- /dev/null +++ b/src/api/zhishu/audit/types.ts @@ -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 +} diff --git a/src/api/zhishu/baseInfo/data_column.ts b/src/api/zhishu/baseInfo/data_column.ts new file mode 100644 index 0000000..c60665e --- /dev/null +++ b/src/api/zhishu/baseInfo/data_column.ts @@ -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' + } + ]); +} diff --git a/src/api/zhishu/baseInfo/index.ts b/src/api/zhishu/baseInfo/index.ts new file mode 100644 index 0000000..f5cce70 --- /dev/null +++ b/src/api/zhishu/baseInfo/index.ts @@ -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 => { + 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 => { + 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> 格式 + 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) => { + 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 => { + return request({ + url: '/zhishu/baseInfo/pricingLink', + method: 'get', + params: query + }); +}; + +//获取销量信息 +// export const saleSearch = (isbn: string): AxiosPromise => { +// 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 => { + 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 => { + 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 => { + return request({ + url: '/zhishu/baseInfo/getImageDeit/' + isbn, + method: 'get' + }); +}; + +/** + * 检查订单状态 + * @param type 类型参数:0-页面展示会员,其他-高级搜索按钮会员 + */ +export const checkStatus = (type: string): AxiosPromise => { + return request({ + url: '/zhishu/baseInfo/checkStatus', + method: 'get', + params: { type } + }); +}; + +/** + * 根据isbn查询图书 + * @param isbn + */ +export const getBookDataByIsbn = (isbn: string): AxiosPromise => { + 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 => { + 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' + }); +}; diff --git a/src/api/zhishu/baseInfo/types.ts b/src/api/zhishu/baseInfo/types.ts new file mode 100644 index 0000000..1e1c1cf --- /dev/null +++ b/src/api/zhishu/baseInfo/types.ts @@ -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; + +/** + * 检查订单状态响应接口 + */ +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; +} diff --git a/src/api/zhishu/bookAudit/index.ts b/src/api/zhishu/bookAudit/index.ts new file mode 100644 index 0000000..fa9ab6d --- /dev/null +++ b/src/api/zhishu/bookAudit/index.ts @@ -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 => { + return request({ + url: '/zhishu/bookAudit/list', + method: 'get', + params: query + }); +}; + +/** + * 查询图书审核管理详细 + * @param id + */ +export const getBookAudit = (id: string | number): AxiosPromise => { + 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) => { + return request({ + url: '/zhishu/bookAudit/' + id, + method: 'delete' + }); +}; + +export const UpdateBookStatus=(data:BookAudit)=>{ + return request({ + url: '/zhishu/bookAudit/updateStatus', + method: 'put', + data: data + }); +}; diff --git a/src/api/zhishu/bookAudit/types.ts b/src/api/zhishu/bookAudit/types.ts new file mode 100644 index 0000000..4b40be9 --- /dev/null +++ b/src/api/zhishu/bookAudit/types.ts @@ -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' +} + + diff --git a/src/api/zhishu/daYin/index.ts b/src/api/zhishu/daYin/index.ts new file mode 100644 index 0000000..ef9ffa3 --- /dev/null +++ b/src/api/zhishu/daYin/index.ts @@ -0,0 +1,944 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import JsBarcode from 'jsbarcode'; + +let LODOP = null + +function getBlackTxt(width, height, txtLeft, txtTop) { + // 1. 创建 Canvas 画布 + var canvas = document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + var ctx = canvas.getContext("2d"); + // 2. 绘制白色背景 + ctx.fillStyle = "#ffffff"; + ctx.fillRect(0, 0, canvas.width, canvas.height); + ctx.fillStyle = "#FFFFFF"; + ctx.fillText("", txtLeft, txtTop); + // 3. 转换为 Base64 图片 + return canvas.toDataURL("image/png"); +} + + +/** + * 生成CODE128条码图片(支持旋转控制 + 高清防模糊) + * @param {string} trackingNumber 条码内容 + * @param {boolean} isRotate 是否旋转90°(默认不旋转) + * @returns {string} base64高清条码图片 + */ +function getCLodopWeightImg(trackingNumber, isRotate = false) { + // 高清优化:缩放倍数(2倍足够清晰,可根据需要调3) + const scale = 2; + // 基础条码配置 + const barcodeHeight = 40; // 条码竖条高度 + const lineWidth = 1; // 线条粗细 + const fontSize = 15; // 字体大小 + + // 1. 创建高清Canvas并生成条码(解决模糊核心) + const canvas = document.createElement("canvas"); + // 先临时生成条码,获取实际需要的宽度(避免Canvas默认尺寸导致的冗余) + const tempCanvas = document.createElement("canvas"); + JsBarcode(tempCanvas, trackingNumber, { + format: "CODE128", + fontSize, + margin: 0, + displayValue: true, + lineColor: "#000000", + width: lineWidth, + height: barcodeHeight + }); + // 设置高清Canvas尺寸(乘以缩放倍数) + canvas.width = tempCanvas.width * scale; + canvas.height = barcodeHeight * scale; + const ctx = canvas.getContext("2d"); + // 缩放上下文,绘制高清内容 + ctx.scale(scale, scale); + + // 正式生成CODE128条码 + JsBarcode(canvas, trackingNumber, { + format: "CODE128", + fontSize, + margin: 0, + displayValue: true, + lineColor: "#000000", + width: lineWidth, + height: barcodeHeight + }); + + // 2. 判断是否需要旋转90° + if (!isRotate) { + // 不旋转:直接返回高清图片(无压缩) + return canvas.toDataURL("image/png", 1.0); + } + + // 需要旋转:创建旋转后的高清Canvas + const rotatedCanvas = document.createElement("canvas"); + // 旋转后的高清尺寸(原高度*scale → 宽度;原宽度*scale → 高度) + rotatedCanvas.width = canvas.height; // 原高度(40*scale) + rotatedCanvas.height = canvas.width; // 原宽度(实际条码宽度*scale) + const rotCtx = rotatedCanvas.getContext("2d"); + + // 关键旋转操作(适配高清尺寸) + rotCtx.translate(rotatedCanvas.width / 2, rotatedCanvas.height / 2); // 移动旋转中心 + rotCtx.rotate(Math.PI / 2); // 顺时针旋转90° + // 绘制高清条码(修正偏移,适配缩放后的尺寸) + rotCtx.drawImage(canvas, -tempCanvas.width / 2, -barcodeHeight / 2); + + // 3. 返回旋转后的高清图片(无压缩) + return rotatedCanvas.toDataURL("image/png", 1.0); +} + +function getCLodopImg(trackingNumber) { + // 1. 先临时生成条码,获取实际需要的宽度(解决线条变宽导致的重叠) + const tempCanvas = document.createElement("canvas"); + JsBarcode(tempCanvas, trackingNumber, { + format: "CODE128", + fontSize: "15", + margin: 0, + displayValue: true, // 显示条码文字 + lineColor: "#000000", // 条码颜色 + width: 1, // 线条宽度改为1.6 + height: 40 // 条码高度 + }); + + // 2. 创建Canvas并生成横向条码(用临时画布的实际宽度,避免重叠) + const canvas = document.createElement("canvas"); + canvas.width = tempCanvas.width; // 动态适配条码实际宽度 + canvas.height = 40; // 固定高度 + JsBarcode(canvas, trackingNumber, { + format: "CODE128", + fontSize: "15", + margin: 0, + displayValue: true, + lineColor: "#000000", + width: 1.5, // 线条宽度设为1.6 + height: 40 + }); + + // 3. 创建新 Canvas 并旋转 90° + const rotatedCanvas = document.createElement("canvas"); + rotatedCanvas.width = canvas.height; // 旋转后宽度 = 原高度 + rotatedCanvas.height = canvas.width; // 旋转后高度 = 原宽度(已适配线条宽度) + const ctx = rotatedCanvas.getContext("2d"); + + // 关键旋转操作! + ctx.translate(rotatedCanvas.width / 2, rotatedCanvas.height / 2); // 移动旋转中心 + ctx.rotate(Math.PI / 2); // 旋转90° + ctx.drawImage(canvas, -canvas.width / 2, -canvas.height / 2); // 绘制图像 + + // 4. 获取图片数据并打印 + return rotatedCanvas.toDataURL("image/png"); +} + +/** + * 脱敏函数 - 对 params 中的收件人/发件人信息进行原地脱敏 + * @param {object} params 包含 receiverStr 和 senderStr 的参数对象 + * @returns {object} 脱敏后的 params 对象 + */ +function encryption(params) { + if (!params) return params; + + // 处理收件人数据 + if (params.receiverStr) { + try { + const receiver = JSON.parse(params.receiverStr); + if (receiver) { + // 姓名脱敏(单字姓名不脱敏,两字姓名脱敏第二个字,三字及以上脱敏中间字) + if (receiver.name && receiver.name.length > 1) { + const name = receiver.name; + if (name.length === 2) { + receiver.name = name[0] + '*'; + } else if (name.length > 2) { + receiver.name = name[0] + '*'.repeat(name.length - 2) + name[name.length - 1]; + } + } + + // 手机号脱敏 + if (receiver.phone) { + const phone = receiver.phone; + if (phone.length === 11) { + receiver.phone = phone.slice(0, 3) + '****' + phone.slice(7); + } else if (phone.length > 4) { + const keepStart = Math.min(3, Math.floor(phone.length / 3)); + const keepEnd = Math.min(4, Math.floor(phone.length / 3)); + const maskLength = phone.length - keepStart - keepEnd; + receiver.phone = phone.slice(0, keepStart) + '*'.repeat(maskLength) + phone.slice(-keepEnd); + } + } + + // 详细地址脱敏(省市区不脱敏,只对address字段脱敏) + if (receiver.address) { + const address = receiver.address; + if (address.length > 6) { + receiver.address = address.slice(0, 6) + '***'; + } else if (address.length > 3) { + receiver.address = address.slice(0, 3) + '***'; + } + } + + // 省市区不脱敏,保持原样(注释掉脱敏逻辑) + // if (receiver.prov) { + // receiver.prov = receiver.prov.length > 1 ? receiver.prov[0] + '*' : receiver.prov; + // } + // if (receiver.city) { + // receiver.city = receiver.city.length > 1 ? receiver.city[0] + '*' : receiver.city; + // } + // if (receiver.county) { + // receiver.county = receiver.county.length > 1 ? receiver.county[0] + '*' : receiver.county; + // } + + params.receiverStr = JSON.stringify(receiver); + } + } catch (e) { + console.error("收件人数据脱敏失败:", e); + } + } + + // 处理发件人数据 + if (params.senderStr) { + try { + const sender = JSON.parse(params.senderStr); + if (sender) { + // 姓名脱敏(单字姓名不脱敏,两字姓名脱敏第二个字,三字及以上脱敏中间字) + if (sender.name && sender.name.length > 1) { + const name = sender.name; + if (name.length === 2) { + sender.name = name[0] + '*'; + } else if (name.length > 2) { + sender.name = name[0] + '*'.repeat(name.length - 2) + name[name.length - 1]; + } + } + + // 手机号脱敏 + if (sender.phone) { + const phone = sender.phone; + if (phone.length === 11) { + sender.phone = phone.slice(0, 3) + '****' + phone.slice(7); + } else if (phone.length > 4) { + const keepStart = Math.min(3, Math.floor(phone.length / 3)); + const keepEnd = Math.min(4, Math.floor(phone.length / 3)); + const maskLength = phone.length - keepStart - keepEnd; + sender.phone = phone.slice(0, keepStart) + '*'.repeat(maskLength) + phone.slice(-keepEnd); + } + } + + // 详细地址脱敏(省市区不脱敏,只对address字段脱敏) + if (sender.address) { + const address = sender.address; + if (address.length > 6) { + sender.address = address.slice(0, 6) + '***'; + } else if (address.length > 3) { + sender.address = address.slice(0, 3) + '***'; + } + } + + + params.senderStr = JSON.stringify(sender); + } + } catch (e) { + console.error("发件人数据脱敏失败:", e); + } + } + + return params; +} + +/** + * + * @param params 数据 + * @param startY 起始Y坐标(mm) + * @param stepY 每行字段间隔(mm) + * @param x 固定X坐标(mm) + * @param width 文本宽度(mm) + * @param height 文本高度(mm) + */ +function goodsMod(params, startY = 96, stepY = 3.5, x = 2, width = 80, height = 5) { + + // ===================== 核心新增逻辑 start ===================== + // 1. 解析printTemplateData JSON字符串(做容错处理) + + let printTemplateList = []; + try { + printTemplateList = JSON.parse(params.printTemplateData || "[]"); + printTemplateList = printTemplateList.sort((a, b) => a.sort - b.sort); + } catch (e) { + console.error("解析printTemplateData失败:", e); + printTemplateList = []; + } + + // 2. 字符长度计算函数(汉字算2,英文/数字算1) + function getCharLength(str) { + if (!str) return 0; + let length = 0; + for (let i = 0; i < str.length; i++) { + // 匹配中文字符(Unicode范围) + const char = str.charAt(i); + if (/[\u4e00-\u9fa5]/.test(char)) { + length += 2; // 汉字加2 + } else { + length += 1; // 英文/数字加1 + } + } + return length; + } + + // 3. 截断文本函数(超过30字符省略) + function truncateText(str, maxLength = 30) { + if (!str) return "-"; + let currentLength = 0; + let result = ""; + for (let i = 0; i < str.length; i++) { + const char = str.charAt(i); + const charLen = /[\u4e00-\u9fa5]/.test(char) ? 2 : 1; + if (currentLength + charLen > maxLength) { + break; + } + result += char; + currentLength += charLen; + } + return result.length < str.length ? `${result}` : result; + } + + // 4. 定义字段映射关系 + const fieldMap = { + isGoodsIsbn: { label: "ISBN:", getValue: (item) => item.isbn || "-" }, + isGoodsName: { + label: "商品名称:", + getValue: (item) => truncateText(item.name) // 商品名称截断处理 + }, + isGoodsArtno: { label: "货号/原货号:", getValue: (item) => `${(item.artNo || "").toString().slice(0, 6)}/${item.originalArtNo || ""}` }, + isGoodsNum: { label: "数量:", getValue: (item) => item.num || 0 } + }; + + // 5. 动态生成打印文本(保持原有简单逻辑) + // 获取商品列表 + const goodsList = Array.isArray(JSON.parse(params.itemStr)) ? JSON.parse(params.itemStr) : []; + + // 遍历每个商品 + goodsList.forEach((goodsItem) => { + printTemplateList.forEach((fieldItem) => { + if (!fieldItem.checked) return; + const fieldConfig = fieldMap[fieldItem.value]; + if (!fieldConfig) return; + + const displayText = `${fieldConfig.label}${fieldConfig.getValue(goodsItem)}`; + LODOP.ADD_PRINT_TEXT(`${startY}mm`, `${x}mm`, `${width}mm`, `${height}mm`, displayText); + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9); + LODOP.SET_PRINT_STYLEA(0, "Bold", 1); + + startY += stepY; + }); + }); + // ===================== 核心新增逻辑 end ===================== + + LODOP.ADD_PRINT_TEXT("108mm", "55mm", "15mm", "50mm", '已验视'); + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9); + LODOP.SET_PRINT_STYLEA(0, "Bold", 1); + +} + + +// 模板注册中心(扩展新模板只需在此注册) +const templateModules = { + // 销售小票模板 + receipt: (LODOP, params) => { + LODOP.PRINT_INIT("销售小票") + LODOP.SET_PRINT_PAGESIZE(1, '76mm', '110mm', '') + + LODOP.ADD_PRINT_TEXT("10mm", "5mm", "60mm", "5mm", "=== 销售小票 ===") + LODOP.SET_PRINT_STYLEA(0, "FontSize", 12) + + params.items.forEach((item, index) => { + LODOP.ADD_PRINT_TEXT( + `${25 + index * 8}mm`, + "5mm", + "60mm", + "5mm", + `${item.name} x${item.qty} ¥${item.price}` + ) + }) + }, + + // 韵达快递模板(添加本地白色图片遮罩) + yunda: (LODOP, params) => { + + LODOP.PRINT_INIT("韵达快递单") + if (params.mailNo) { + LODOP.SET_PRINT_PAGESIZE(3, "76mm", "120mm", "") + LODOP.ADD_PRINT_PDF("-4mm", "-1mm", "10mm", "10mm", params.pdfInfo); + + // 参数 高 左 宽 高 + // 底部遮挡 + LODOP.ADD_PRINT_IMAGE("100.5mm", "1.5mm", "5mm", "15mm", getBlackTxt(210, 60, 0, 0)); + // 横向条码遮挡 + LODOP.ADD_PRINT_IMAGE("21.5mm", "1.5mm", "5mm", "15mm", getBlackTxt(210, 60, 0, 0)); + // 纵向条码遮挡 + LODOP.ADD_PRINT_IMAGE("38mm", "56mm", "4mm", "15mm", getBlackTxt(75, 225, 0, 0)); + // 条码区域(横) + LODOP.ADD_PRINT_IMAGE("22mm", "4mm", "40mm", "15mm", getCLodopWeightImg(params.mailNo, false)); + // 条码区域(竖) + LODOP.ADD_PRINT_IMAGE("40mm", "56mm", "0mm", "0mm", getCLodopImg(params.mailNo)); + + LODOP.ADD_PRINT_RECT("10.6mm", "0", "76mm", "118mm", 0, 1) // 外围边框 + } else { + LODOP.SET_PRINT_PAGESIZE(3, "77mm", "0mm", "") + LODOP.ADD_PRINT_PDF("0", "0mm", "10mm", "10mm", params.pdfInfo); + + // 收件人信息 + LODOP.ADD_PRINT_TEXT("55mm", "10mm", "48mm", "8mm", params.receiver.name + " " + params.receiver.mobile) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 10) + LODOP.ADD_PRINT_TEXT("60mm", "10mm", "48mm", "8mm", params.receiver.address) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9) + + // 寄件人信息 + LODOP.ADD_PRINT_TEXT("71mm", "10mm", "48mm", "8mm", params.sender.name + " " + params.sender.mobile) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 8) + LODOP.ADD_PRINT_TEXT("74mm", "10mm", "48mm", "8mm", params.sender.address) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 8) + } + + // ===================== 核心新增逻辑 start ===================== + // 1. 解析printTemplateData JSON字符串(做容错处理) + let printTemplateList = []; + try { + printTemplateList = JSON.parse(params.printTemplateData || "[]"); + printTemplateList = printTemplateList.sort((a, b) => a.sort - b.sort); + } catch (e) { + console.error("解析printTemplateData失败:", e); + printTemplateList = []; + } + + // 2. 字符长度计算函数(汉字算2,英文/数字算1) + function getCharLength(str) { + if (!str) return 0; + let length = 0; + for (let i = 0; i < str.length; i++) { + // 匹配中文字符(Unicode范围) + const char = str.charAt(i); + if (/[\u4e00-\u9fa5]/.test(char)) { + length += 2; // 汉字加2 + } else { + length += 1; // 英文/数字加1 + } + } + return length; + } + + // 3. 截断文本函数(超过30字符省略) + function truncateText(str, maxLength = 30) { + if (!str) return "-"; + let currentLength = 0; + let result = ""; + for (let i = 0; i < str.length; i++) { + const char = str.charAt(i); + const charLen = /[\u4e00-\u9fa5]/.test(char) ? 2 : 1; + if (currentLength + charLen > maxLength) { + break; + } + result += char; + currentLength += charLen; + } + return result.length < str.length ? `${result}` : result; + } + + // 4. 定义字段映射关系 + const fieldMap = { + isGoodsIsbn: { label: "ISBN:", getValue: (item) => item.isbn || "-" }, + isGoodsName: { + label: "商品名称:", + getValue: (item) => truncateText(item.goodsName) // 商品名称截断处理 + }, + isGoodsArtno: { label: "货号/原货号:", getValue: (item) => `${(item.artNo || "").toString().slice(0, 6)}/${item.originalArtNo || ""}` }, + isGoodsNum: { label: "数量:", getValue: (item) => item.goodsCount || 0 } + }; + + // 5. 动态生成打印文本(保持原有简单逻辑) + let startY = 95; // 起始Y坐标(mm) + const stepY = 3.5; // 每行字段间隔(mm) + const x = 2; // 固定X坐标(mm) + const width = 80; // 文本宽度(mm) + const height = 5; // 文本高度(mm) + + debugger; + // 获取商品列表 + const goodsList = Array.isArray(params.dataList) ? params.dataList : []; + + // 遍历每个商品 + goodsList.forEach((goodsItem) => { + printTemplateList.forEach((fieldItem) => { + if (!fieldItem.checked) return; + const fieldConfig = fieldMap[fieldItem.value]; + if (!fieldConfig) return; + + const displayText = `${fieldConfig.label}${fieldConfig.getValue(goodsItem)}`; + LODOP.ADD_PRINT_TEXT(`${startY}mm`, `${x}mm`, `${width}mm`, `${height}mm`, displayText); + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9); + LODOP.SET_PRINT_STYLEA(0, "Bold", 1); + + startY += stepY; + }); + }); + // ===================== 核心新增逻辑 end ===================== + + }, + ZTO: (LODOP, params) => { + LODOP.PRINT_INIT("中通快递单") + LODOP.SET_PRINT_PAGESIZE(3, "76mm", "120mm", "") + + // // ========== 外边框设计 ========== + LODOP.ADD_PRINT_RECT("10.6mm", "0", "76mm", "118mm", 0, 1) // 外围边框 + // LODOP.PRINT_DESIGN(); + + + //时间 + // LODOP.ADD_PRINT_TEXT("7mm", "2mm", "65mm", "8mm", params.orderTime) + // LODOP.SET_PRINT_STYLEA(0, "FontSize", 10) + + LODOP.ADD_PRINT_TEXT("1mm", "66mm", "15mm", "50mm", '快递包裹') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 13) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + + LODOP.ADD_PRINT_LINE("90mm", "55mm", "11mm", "55mm", 0, 1) // 中部竖线 + LODOP.ADD_PRINT_LINE("23mm", "0mm", "23mm", "55mm", 0, 1) // 左侧第一条横线 + LODOP.ADD_PRINT_LINE("40mm", "0mm", "40mm", "55mm", 0, 1) // 左侧第二条横线 + LODOP.ADD_PRINT_LINE("48mm", "0mm", "48mm", "55mm", 0, 1) // 左侧第三条横线 + LODOP.ADD_PRINT_LINE("74mm", "0mm", "74mm", "55mm", 0, 1) // 左侧第四条横线 + + + LODOP.ADD_PRINT_TEXT("13mm", "0mm", "55mm", "10mm", params.title) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "Alignment", 2) // 居中对齐 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 19) + + // 条码区域(横) + LODOP.ADD_PRINT_IMAGE("24mm", "4mm", "40mm", "15mm", getCLodopWeightImg(params.mailNo, false)); + // 条码区域(竖) + LODOP.ADD_PRINT_IMAGE("30mm", "58mm", "0mm", "0mm", getCLodopImg(params.mailNo)); + + + // 集 + LODOP.ADD_PRINT_RECT("41mm", "1mm", "6mm", "6mm", 0, 3);// 用绝对定位画一个矩形框(模拟边框) + LODOP.ADD_PRINT_TEXT("42mm", "2mm", "5mm", "8mm", '集') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 12) + LODOP.ADD_PRINT_TEXT("42mm", "9mm", "40mm", "8mm", params.jiStr) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 13) + + // 收货信息 + LODOP.ADD_PRINT_RECT("49mm", "1mm", "6mm", "6mm", 0, 3);// 用绝对定位画一个矩形框(模拟边框) + LODOP.ADD_PRINT_TEXT("50mm", "2mm", "5mm", "8mm", '收') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 11) + LODOP.ADD_PRINT_TEXT("50mm", "9mm", "48mm", "8mm", params.receiver.name + ' ' + params.receiver.phone) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 10) + LODOP.ADD_PRINT_TEXT("59mm", "9mm", "48mm", "20mm", params.receiver.address) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 10) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + + // 寄件信息 + LODOP.ADD_PRINT_TEXT("76mm", "2mm", "6mm", "6mm", '寄') + LODOP.SET_PRINT_STYLEA(0, "FontSize", 11) + LODOP.ADD_PRINT_TEXT("74.5mm", "9mm", "70mm", "8mm", params.sender.name + ' ' + params.sender.phone) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9) + LODOP.ADD_PRINT_TEXT("80mm", "9mm", "45mm", "20mm", params.sender.address) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + + LODOP.ADD_PRINT_LINE("90mm", "0mm", "90mm", "85mm", 0, 1) // 中部横线 + + // ===================== 核心新增逻辑 start ===================== + // 1. 解析printTemplateData JSON字符串(做容错处理) + debugger; + let printTemplateList = []; + try { + printTemplateList = JSON.parse(params.printTemplateData || "[]"); + printTemplateList = printTemplateList.sort((a, b) => a.sort - b.sort); + } catch (e) { + console.error("解析printTemplateData失败:", e); + printTemplateList = []; + } + + // 2. 字符长度计算函数(汉字算2,英文/数字算1) + function getCharLength(str) { + if (!str) return 0; + let length = 0; + for (let i = 0; i < str.length; i++) { + // 匹配中文字符(Unicode范围) + const char = str.charAt(i); + if (/[\u4e00-\u9fa5]/.test(char)) { + length += 2; // 汉字加2 + } else { + length += 1; // 英文/数字加1 + } + } + return length; + } + + // 3. 截断文本函数(超过30字符省略) + function truncateText(str, maxLength = 30) { + if (!str) return "-"; + let currentLength = 0; + let result = ""; + for (let i = 0; i < str.length; i++) { + const char = str.charAt(i); + const charLen = /[\u4e00-\u9fa5]/.test(char) ? 2 : 1; + if (currentLength + charLen > maxLength) { + break; + } + result += char; + currentLength += charLen; + } + return result.length < str.length ? `${result}` : result; + } + + // 4. 定义字段映射关系 + const fieldMap = { + isGoodsIsbn: { label: "ISBN:", getValue: (item) => item.isbn || "-" }, + isGoodsName: { + label: "商品名称:", + getValue: (item) => truncateText(item.goodsName) // 商品名称截断处理 + }, + isGoodsArtno: { label: "货号/原货号:", getValue: (item) => `${(item.artNo || "").toString().slice(0, 6)}/${item.originalArtNo || ""}` }, + isGoodsNum: { label: "数量:", getValue: (item) => item.goodsCount || 0 } + }; + + // 5. 动态生成打印文本(保持原有简单逻辑) + let startY = 91; // 起始Y坐标(mm) + const stepY = 3.5; // 每行字段间隔(mm) + const x = 2; // 固定X坐标(mm) + const width = 80; // 文本宽度(mm) + const height = 5; // 文本高度(mm) + + debugger; + // 获取商品列表 + const goodsList = Array.isArray(params.dataList) ? params.dataList : []; + + // 遍历每个商品 + goodsList.forEach((goodsItem) => { + printTemplateList.forEach((fieldItem) => { + if (!fieldItem.checked) return; + const fieldConfig = fieldMap[fieldItem.value]; + if (!fieldConfig) return; + + const displayText = `${fieldConfig.label}${fieldConfig.getValue(goodsItem)}`; + LODOP.ADD_PRINT_TEXT(`${startY}mm`, `${x}mm`, `${width}mm`, `${height}mm`, displayText); + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9); + LODOP.SET_PRINT_STYLEA(0, "Bold", 1); + + startY += stepY; + }); + }); + // ===================== 核心新增逻辑 end ===================== + }, + JTSD: (LODOP, params) => { + LODOP.PRINT_INIT("极兔速递") + LODOP.SET_PRINT_PAGESIZE(3, "76mm", "120mm", "") + + // // ========== 外边框设计 ========== + LODOP.ADD_PRINT_RECT("10.6mm", "0", "76mm", "118mm", 0, 1) // 外围边框 + // LODOP.PRINT_DESIGN(); + // 条码区域(横) + LODOP.ADD_PRINT_IMAGE("24mm", "18mm", "40mm", "15mm", getCLodopWeightImg(params.waybillNo, false)); + // 条码区域(竖) + LODOP.ADD_PRINT_IMAGE("50mm", "58mm", "0mm", "0mm", getCLodopImg(params.waybillNo)); + + LODOP.ADD_PRINT_LINE("106mm", "55mm", "40mm", "55mm", 0, 1) // 中部竖线 + LODOP.ADD_PRINT_LINE("106mm", "8mm", "56mm", "8mm", 0, 1) // 左侧竖线 + + + LODOP.ADD_PRINT_LINE("23mm", "0mm", "23mm", "76mm", 0, 1) // 左侧第一条横线 + LODOP.ADD_PRINT_LINE("40mm", "0mm", "40mm", "76mm", 0, 1) // 左侧第二条横线 + LODOP.ADD_PRINT_LINE("48mm", "0mm", "48mm", "55mm", 0, 1) // 左侧第三条横线 + LODOP.ADD_PRINT_LINE("56mm", "0mm", "56mm", "55mm", 0, 1) // 左侧第四条横线 + LODOP.ADD_PRINT_LINE("74mm", "0mm", "74mm", "55mm", 0, 1) // 左侧第五条横线 + LODOP.ADD_PRINT_LINE("90mm", "0mm", "90mm", "55mm", 0, 1) // 左侧第六条横线 + + // 大头笔 + LODOP.ADD_PRINT_TEXT("13mm", "0mm", "79mm", "10mm", params.markDestinationName) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "Alignment", 2) // 居中对齐 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 19) + // 集 + LODOP.ADD_PRINT_RECT("41mm", "1mm", "6mm", "6mm", 0, 3);// 用绝对定位画一个矩形框(模拟边框) + LODOP.ADD_PRINT_TEXT("42mm", "2mm", "5mm", "8mm", '集') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 12) + LODOP.ADD_PRINT_TEXT("42mm", "9mm", "40mm", "8mm", params.packageCodeName) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 13) + + // 末 + LODOP.ADD_PRINT_RECT("49mm", "1mm", "6mm", "6mm", 0, 3);// 用绝对定位画一个矩形框(模拟边框) + LODOP.ADD_PRINT_TEXT("50mm", "2mm", "5mm", "8mm", '末') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 12) + LODOP.ADD_PRINT_TEXT("50mm", "9mm", "40mm", "8mm", params.moStr) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 13) + + + + // 收货信息 + const receiver = JSON.parse(params.receiverStr); + LODOP.ADD_PRINT_RECT("57mm", "1mm", "6mm", "6mm", 0, 3);// 用绝对定位画一个矩形框(模拟边框) + LODOP.ADD_PRINT_TEXT("58mm", "2mm", "5mm", "8mm", '收') + LODOP.SET_PRINT_STYLEA(0, "FontSize", 11) + LODOP.ADD_PRINT_TEXT("57mm", "9mm", "48mm", "8mm", receiver.name + ' ' + receiver.phone) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9) + LODOP.ADD_PRINT_TEXT("64mm", "9mm", "48mm", "20mm", receiver.prov + receiver.city + receiver.county + receiver.address) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + + + // 寄件信息 + const sender = JSON.parse(params.senderStr); + LODOP.ADD_PRINT_TEXT("76mm", "2mm", "6mm", "6mm", '寄') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 12) + LODOP.ADD_PRINT_TEXT("74.5mm", "9mm", "70mm", "8mm", sender.name + ' ' + sender.phone) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 8) + LODOP.ADD_PRINT_TEXT("80mm", "9mm", "45mm", "20mm", sender.prov + sender.city + sender.county + sender.address) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 8) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + + // 保 + LODOP.ADD_PRINT_TEXT("93mm", "2mm", "5mm", "8mm", '保') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 12) + + LODOP.ADD_PRINT_LINE("96mm", "8mm", "96mm", "55mm", 0, 1) // 保 内部横线 + + LODOP.ADD_PRINT_LINE("106mm", "23mm", "90mm", "23mm", 0, 1) // 左侧竖线 + LODOP.ADD_PRINT_LINE("106mm", "40mm", "90mm", "40mm", 0, 1) // 左侧竖线 + + LODOP.ADD_PRINT_TEXT("91.5mm", "9mm", "20mm", "9mm", '代收贷款') // 代收贷款 + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.ADD_PRINT_TEXT("91.5mm", "25mm", "20mm", "25mm", '到付贷款') // 到付贷款 + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.ADD_PRINT_TEXT("91.5mm", "41mm", "20mm", "41mm", '计件重量') // 计件重量 + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + + LODOP.ADD_PRINT_LINE("106mm", "0mm", "106mm", "76mm", 0, 1) // 底线 + + goodsMod(params, 107); + + }, + YZXB: (LODOP, params) => { + // 调用脱敏函数,直接修改 params + params = encryption(params); + + LODOP.PRINT_INIT("邮政快递") + LODOP.SET_PRINT_PAGESIZE(3, "76mm", "130mm", "") + LODOP.SET_PRINT_MODE("PRINT_NO_PAGE", true); // 加上这行,强制禁止自动分页 + + // ========== 外边框设计 ========== + LODOP.ADD_PRINT_RECT("28mm", "0", "76mm", "93mm", 0, 1) // 外围边框 + + + + LODOP.ADD_PRINT_TEXT("1mm", "66mm", "15mm", "50mm", '快递包裹') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 13) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + + + LODOP.ADD_PRINT_LINE("95mm", "55mm", "28mm", "55mm", 0, 1) // 中部竖线 + // LODOP.ADD_PRINT_LINE("23mm", "0mm", "23mm", "55mm", 0, 1) // 左侧第一条横线 + LODOP.ADD_PRINT_LINE("45mm", "0mm", "45mm", "55mm", 0, 1) // 左侧第二条横线 + LODOP.ADD_PRINT_LINE("53mm", "0mm", "53mm", "55mm", 0, 1) // 左侧第三条横线 + LODOP.ADD_PRINT_LINE("79mm", "0mm", "79mm", "55mm", 0, 1) // 左侧第四条横线 + + + // 条码区域(横) + LODOP.ADD_PRINT_IMAGE("12mm", "14mm", "40mm", "15mm", getCLodopWeightImg(params.waybillNo, false)); + // 条码区域(竖) + LODOP.ADD_PRINT_IMAGE("35mm", "58mm", "0mm", "0mm", getCLodopImg(params.waybillNo)); + + // 大头笔 + LODOP.ADD_PRINT_TEXT("34mm", "0mm", "55mm", "10mm", params.markDestinationName) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "Alignment", 2) // 居中对齐 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 16) + + + + // 收货信息 + const receiver = JSON.parse(params.receiverStr); + LODOP.ADD_PRINT_RECT("54mm", "1mm", "6mm", "6mm", 0, 3);// 用绝对定位画一个矩形框(模拟边框) + LODOP.ADD_PRINT_TEXT("55mm", "2mm", "5mm", "8mm", '收') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 11) + LODOP.ADD_PRINT_TEXT("55mm", "9mm", "48mm", "8mm", receiver.name + ' ' + receiver.phone) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 10) + LODOP.ADD_PRINT_TEXT("64mm", "9mm", "48mm", "20mm", receiver.prov + receiver.city + receiver.county + receiver.address) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 10) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + + // 寄件信息 + const sender = JSON.parse(params.senderStr); + LODOP.ADD_PRINT_TEXT("81mm", "2mm", "6mm", "6mm", '寄') + LODOP.SET_PRINT_STYLEA(0, "FontSize", 11) + LODOP.ADD_PRINT_TEXT("79.5mm", "9mm", "70mm", "8mm", sender.name + ' ' + sender.phone) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9) + LODOP.ADD_PRINT_TEXT("85mm", "9mm", "45mm", "20mm", sender.prov + sender.city + sender.county + sender.address) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + LODOP.ADD_PRINT_LINE("95mm", "0mm", "95mm", "76mm", 0, 1) // 中部横线 + + goodsMod(params, 96); + + }, + YTO: (LODOP, params) => { + + // 调用脱敏函数,直接修改 params + params = encryption(params); + + LODOP.PRINT_INIT("邮政快递") + LODOP.SET_PRINT_PAGESIZE(3, "76mm", "130mm", "") + LODOP.SET_PRINT_MODE("PRINT_NO_PAGE", true); // 加上这行,强制禁止自动分页 + + // ========== 外边框设计 ========== + LODOP.ADD_PRINT_RECT("28mm", "0", "76mm", "93mm", 0, 1) // 外围边框 + + + + LODOP.ADD_PRINT_TEXT("1mm", "66mm", "15mm", "50mm", '快递包裹') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 13) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + + + LODOP.ADD_PRINT_LINE("38mm", "0mm", "38mm", "76mm", 0, 1) // 第一条横线 + LODOP.ADD_PRINT_LINE("60mm", "0mm", "60mm", "76mm", 0, 1) // 第二条横线 + LODOP.ADD_PRINT_LINE("73mm", "0mm", "73mm", "76mm", 0, 1) // 第三条横线 + LODOP.ADD_PRINT_LINE("90mm", "0mm", "90mm", "76mm", 0, 1) // 第四条横线 + + LODOP.ADD_PRINT_LINE("90mm", "30mm", "73mm", "30mm", 0, 1) // 中部竖线 + + + + // 条码区域(横) + const clodopWeightImg = getCLodopWeightImg(params.waybillNo, false); + LODOP.ADD_PRINT_IMAGE("12mm", "18mm", "40mm", "15mm", clodopWeightImg); + LODOP.ADD_PRINT_IMAGE("74mm", "34mm", "40mm", "15mm", clodopWeightImg); + + // 大头笔 + LODOP.ADD_PRINT_TEXT("30mm", "0mm", "75mm", "10mm", params.markDestinationName) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "Alignment", 2) // 居中对齐 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 18) + + + // 收货信息 + const receiver = JSON.parse(params.receiverStr); + LODOP.ADD_PRINT_RECT("40mm", "1mm", "6mm", "6mm", 0, 3);// 用绝对定位画一个矩形框(模拟边框) + LODOP.ADD_PRINT_TEXT("41mm", "2mm", "5mm", "8mm", '收') + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 11) + LODOP.ADD_PRINT_TEXT("41mm", "9mm", "75mm", "8mm", receiver.name + ' ' + receiver.phone) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 10) + LODOP.ADD_PRINT_TEXT("50mm", "9mm", "75mm", "20mm", receiver.prov + receiver.city + receiver.county + receiver.address) + LODOP.SET_PRINT_STYLEA(0, "Bold", 1) // 加粗 + LODOP.SET_PRINT_STYLEA(0, "FontSize", 10) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + + // 寄件信息 + const sender = JSON.parse(params.senderStr); + LODOP.ADD_PRINT_TEXT("62mm", "2mm", "6mm", "6mm", '寄') + LODOP.SET_PRINT_STYLEA(0, "FontSize", 15) + LODOP.ADD_PRINT_TEXT("60.5mm", "9mm", "75mm", "8mm", sender.name + ' ' + sender.phone) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9) + LODOP.ADD_PRINT_TEXT("66mm", "9mm", "75mm", "20mm", sender.prov + sender.city + sender.county + sender.address) + LODOP.SET_PRINT_STYLEA(0, "FontSize", 9) + LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); + + /** + * 商品信息 + */ + goodsMod(params, 92); + } + + // 可继续添加其他模板... +} + + + + +export const initLodop = () => { + return new Promise((resolve, reject) => { + if (LODOP) return resolve(LODOP) + + const script = document.createElement('script') + script.src = 'http://localhost:8000/CLodopfuncs.js' + script.onload = () => { + LODOP = getCLodop() + if (!LODOP) { + reject(new Error('C-Lodop 未正确安装')) + } + resolve(LODOP) + } + + // 脚本加载失败的逻辑 + script.onerror = () => { + const loadError = new Error('加载 C-Lodop 失败'); + console.error(loadError); + // 提示用户,点击确认才下载 + showDownloadPrompt('C-Lodop插件加载失败!'); + reject(loadError); + }; + document.head.appendChild(script) + }) +} + +function showDownloadPrompt(tipText) { + const confirmText = `${tipText}\n请先下载安装插件后重试!\n点击页面上方【打印插件下载】按钮,下载【网点面单打单插件】。`; + confirm(confirmText) +} + +export const createPrintTask = async (templateName, content) => { + try { + const LODOP = await initLodop() + LODOP.SET_LICENSES("", "630D8906DC4186920589CAE3FFA925A278D", "", ""); + // 检查模板是否存在 + if (templateName == 'YUNDA') { + templateName = 'yunda' + } + if (!templateModules[templateName]) { + console.log(templateName) + throw new Error(`未找到模板: ${templateName}`) + } + + // 执行模板渲染 + templateModules[templateName](LODOP, content) + + return LODOP + } catch (error) { + throw error + } +} + +/** + * 最简单的获取打印机列表 + */ +export const getSimplePrinterList = async (): Promise => { + try { + const LODOP = await initLodop(); + const printers = []; + const count = LODOP.GET_PRINTER_COUNT(); + for (let i = 0; i < count; i++) { + const name = LODOP.GET_PRINTER_NAME(i); + printers.push(name); + } + return printers; + } catch (error) { + console.error('获取失败:', error); + return []; + } +}; diff --git a/src/api/zhishu/daYinPdd/index.ts b/src/api/zhishu/daYinPdd/index.ts new file mode 100644 index 0000000..47aeb06 --- /dev/null +++ b/src/api/zhishu/daYinPdd/index.ts @@ -0,0 +1,251 @@ +/** + * 拼多多官方打印组件工具类 + * 严格对照官方协议 | 100% 标准实现 + * 已增加:自定义模板 + goodsName 变量渲染 + */ + +// ---------------------- 类型定义 ---------------------- +export interface PddPrintData { + waybill_code: string; + object_id?: string; + print_data: string; // 后端返回的加密打印数据 + goodsName: string; // 【新增】商品名称(你传进来即可) +} + +export interface PddPrinterConfig { + name: string; + PrintTopLogo: boolean; + PrintBottomLogo: boolean; + horizontalOffset: number; + verticalOffset: number; +} + +// ---------------------- 核心工具 ---------------------- + +/** + * 获取WebSocket连接(官方标准 ws) + */ +function getPddSocket() { + return new WebSocket('ws://127.0.0.1:5000'); +} + +/** + * 发送指令并等待返回(Promise封装) + */ +function sendCommand(cmdData: any): Promise { + return new Promise((resolve, reject) => { + const socket = getPddSocket(); + + socket.onopen = () => { + socket.send(JSON.stringify(cmdData)); + }; + + socket.onmessage = (event) => { + try { + const res = JSON.parse(event.data); + resolve(res); + } catch (e) { + reject(e); + } + socket.close(); + }; + + socket.onerror = (err) => { + reject(new Error('拼多多打印组件连接失败,请确认组件已启动')); + }; + }); +} + +// ---------------------- 官方标准接口 ---------------------- + +/** + * 获取打印机配置(官方接口) + */ +export async function getPrinterConfig(printerName: string) { + const req = { + cmd: 'getPrinterConfig', + printer: printerName, + version: '1.0', + requestID: Date.now().toString(), + }; + return sendCommand(req); +} + +/** + * 设置打印机配置(严格按照官方协议) + */ +export async function setPrinterConfig( + printerName: string, + config: { + horizontalOffset?: number; + verticalOffset?: number; + PrintTopLogo?: boolean; + PrintBottomLogo?: boolean; + } +) { + const req = { + cmd: "setPrinterConfig", + requestID: Date.now().toString(), + version: "1.0", + printer: { + name: printerName, + ...config + } + }; + return sendCommand(req); +} + +/** + * 获取打印机列表 + */ +export async function getPddPrinterList() { + const req = { + cmd: 'getPrinters', + version: '1.0', + requestID: Date.now().toString(), + }; + return sendCommand(req); +} + +/** + * 【官方标准】打印快递面单 + 自定义区域(重叠法加粗 100%生效) + */ +export async function pddPrintWaybill(printerName: string,printData,printTemplateData: string) { + const info = JSON.parse(printData.print_data); + const taskID = 'TASK_' + Date.now(); + + // ===================== 动态生成商品列表 START ===================== + // 1. 解析打印配置(哪些字段要打、顺序) + let templateList = []; + try { + templateList = JSON.parse(printTemplateData || '[]'); + templateList = templateList + .filter(item => item.checked) + .sort((a, b) => a.sort - b.sort); + } catch (e) { + templateList = []; + } + + // 2. 字段映射(和你韵达模板保持一致) + const fieldMap = { + isGoodsName: { + label: '商品名称:', + getValue: (item) => item.goodsName || '-' + }, + isGoodsIsbn: { + label: 'ISBN:', + getValue: (item) => item.isbn || '-' + }, + isGoodsArtno: { + label: '货号/原货号:', + getValue: (item) => `${(item.artNo || '').slice(0, 6)}/${item.originalArtNo || ''}` + }, + isGoodsNum: { + label: '数量:', + getValue: (item) => item.goodsCount || 0 + } + }; + + // 3. 动态生成 list 数组(拼多多打印格式) + const dynamicList = []; + let top = 0; // 起始 Y 坐标 + const lineHeight = 25; // 每行间距 + const fontSize = 45; + + // 遍历商品 + (printData.dataList || []).forEach((goodsItem) => { + // 遍历勾选的字段 + templateList.forEach((field) => { + const config = fieldMap[field.value]; + if (!config) return; + + const text = config.label + config.getValue(goodsItem); + + // =============== 核心:重叠打印两次 =============== + // 第一层(原位置) + dynamicList.push({ + left: 20, + top: top, + fontSize: fontSize, + text: text, + width: 900, + height: 50 + }); + // 第二层(轻微偏移 + 重叠 = 加粗) + dynamicList.push({ + left: 21, // 往右偏移1像素 + top: top + 1, // 往下偏移1像素 + fontSize: fontSize, + text: text, + width: 900, + height: 50 + }); + // ================================================ + + top += lineHeight; // 换行 + }); + }); + // ===================== 动态生成商品列表 END ===================== + + + const cmd = { + ERPId: 'isv id', + ISVName: 'isv name', + cmd: 'print', + requestID: 'REQ_' + Date.now(), + task: { + documents: [ + { + contents: [ + // 1. 标准面单(你原有代码,不动) + { + encryptedData: info.encryptedData, + signature: info.signature, + templateUrl: info.templateUrl, + ver: info.ver || '11', + }, + // 2. 【新增】自定义区域 + goodsName 变量 + { + templateURL: "https://pinduoduoimg.yangkeduo.com/logistics/2019-07-14/5d7e8b5969d954539fcfba3268bbeb3a.xml", + data: { + "width": 1000, + "height": 1000, + "list": dynamicList, + "waterdata": { "text": "" } + } + } + ], + documentID: printData.waybill_code, + }, + ], + notifyType: ['print'], + preview: false, + previewType: 'image', + printer: printerName, + taskID: taskID, + }, + version: '1.0', + }; + + return sendCommand(cmd); +} + +/** + * 测试连通性 + */ +export async function testPddPrintConnect() { + try { + await getPddPrinterList(); + return true; + } catch { + return false; + } +} + +export default { + getPrinterConfig, + setPrinterConfig, + getPddPrinterList, + pddPrintWaybill, + testPddPrintConnect, +}; diff --git a/src/api/zhishu/depot/index.ts b/src/api/zhishu/depot/index.ts new file mode 100644 index 0000000..c45ef8d --- /dev/null +++ b/src/api/zhishu/depot/index.ts @@ -0,0 +1,126 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { DepotVO, DepotForm, DepotQuery } from '@/api/zhishu/depot/types'; +import { templateData } from '@/api/zhishu/district/types'; +import { ShelvesVO } from '@/api/zhishu/shelves/types'; +import { FreightVO } from '@/api/zhishu/freight/types'; + +/** + * 查询仓库信息列表 + * 查询仓库信息设置列表 + * @param query + * @returns {*} + */ + +export const listDepot = (query?: DepotQuery): AxiosPromise => { + return request({ + url: '/depot/depot/list', + method: 'get', + params: query + }); +}; + +/** + * 查询仓库信息详细 +export const listDepots = (query?: DepotQuery): AxiosPromise => { + return request({ + url: '/depot/depot/list1', + method: 'get', + params: query + }); +}; + + + +/** + * 查询仓库信息设置详细 + * @param id + */ +export const getDepot = (id: string | number): AxiosPromise => { + return request({ + url: '/depot/depot/' + id, + method: 'get' + }); +}; + +/** + * 新增仓库信息设置 + * @param data + */ +export const addDepot = (data: DepotForm) => { + return request({ + url: '/depot/depot', + method: 'post', + data: data + }); +}; + +/** + * 修改仓库信息 + * @param data + */ +export const updateDepot = (data: DepotForm) => { + return request({ + url: '/depot/depot', + method: 'put', + data: data + }); +}; + +/** + * 删除仓库信息 + * 删除仓库信息设置 + * @param id + */ +export const delDepot = (id: string | number | Array) => { + return request({ + url: '/depot/depot/' + id, + method: 'delete' + }); +}; + + +// export const shelveList = (id: number|string): AxiosPromise => { +// return request({ +// url: , +// method: 'get' +// }); +// }; + +/** + * 获取三级货区信息 + * @param id + */ +export const shelveInfoList = (id: string | number): AxiosPromise => { + return request({ + url: '/depot/depot/shelves/' + id, + method: 'get' + }); +}; + +/** + * 获取二级货区信息 + * @param id + */ +export const freList = (id: string | number): AxiosPromise => { + return request({ + url: '/depot/depot/freight/' + id, + method: 'get' + }); +}; + + +/** + * 查询仓库信息列表 + * 查询仓库信息设置列表 + * @param query + * @returns {*} + */ + +export const depotNameListAll = (query?: DepotQuery): AxiosPromise => { + return request({ + url: '/depot/depot/getDepotAll', + method: 'get', + params: query + }); +}; diff --git a/src/api/zhishu/depot/types.ts b/src/api/zhishu/depot/types.ts new file mode 100644 index 0000000..75076a3 --- /dev/null +++ b/src/api/zhishu/depot/types.ts @@ -0,0 +1,225 @@ +import { templateData } from '@/api/zhishu/district/types'; +import { ShelvesVO } from '@/api/zhishu/shelves/types'; + +export interface DepotVO { + /** + * 仓库id + */ + id: string | number; + + /** + * 仓库编号 + */ + code: string; + + /** + * 仓库名称 + */ + name: string; + + /** + * 单位 + */ + unit: string; + + /** + * 仓库地址 + */ + address: string; + + /** + * 仓库管理员 + */ + manager: string; + + + /** + * 仓库状态(0正常 1停用) + */ + status: string; + + /** + * 备注 + */ + remark: string; + + /** + * 货架数量 + */ + sheQuantityMax: number; + + + /** + * 已用数量 + */ + sheNumber?: number; + + + /** + * 用户姓名 + */ + userName: string; + + /** + * 用户id + */ + userId: string | number; + /** + * 是否有下一级 + */ + hasChildren:boolean; + + /** + * 层级 + */ + level:number; + + + children: string; + + /** + * 模版名称 + */ + templateName:number; + + /** + * 书品库存总数 + */ + inventory:number; + + /** + * 书品类型数量 + */ + categoryNumber:number; +} + +export interface DepotForm extends BaseEntity { + /** + * 仓库id + */ + id?: string | number; + + /** + * 仓库编号 + */ + code?: string; + + /** + * 仓库名称 + */ + name?: string; + + /** + * 单位 + */ + unit?: string; + + /** + * 仓库地址 + */ + address?: string; + + /** + * 仓库管理员 + */ + manager?: string; + + + /** + * 仓库状态(0正常 1停用) + */ + status?: string; + + /** + * 备注 + */ + remark?: string; + + /** + * 货架数量 + */ + sheQuantityMax?: number; + + /** + * 已用数量 + */ + sheNumber?: number; + + + /** + * 用户姓名 + */ + userName?: string; + /** + * 用户id + */ + userId?: string | number; + + templateId?: string |number; + /** + * 是否有下一级 + */ + hasChildren?:boolean; + + /** + * 层级 + */ + level:number; + +} + +export interface DepotQuery extends PageQuery { + + /** + * 仓库编号 + */ + code?: string; + + /** + * 仓库名称 + */ + name?: string; + + /** + * 单位 + */ + unit?: string; + + /** + * 仓库地址 + */ + address?: string; + + /** + * 仓库管理员 + */ + manager?: string; + + + /** + * 仓库状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 用户姓名 + */ + userName?: string; + /** + * 用户id + */ + userId?: string | number; + /** + * 是否有下一级 + */ + hasChildren?:boolean; + +} + + + diff --git a/src/api/zhishu/depot/userAccount/index.ts b/src/api/zhishu/depot/userAccount/index.ts new file mode 100644 index 0000000..ff41f2b --- /dev/null +++ b/src/api/zhishu/depot/userAccount/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { UserAccountVO, UserAccountForm, UserAccountQuery } from '@/api/zhishu/userAccount/types'; + +/** + * 查询账号管理列表 + * @param query + * @returns {*} + */ + +export const listUserAccount = (query?: UserAccountQuery): AxiosPromise => { + return request({ + url: '/zhishu/userAccount/list', + method: 'get', + params: query + }); +}; + +/** + * 查询账号管理详细 + * @param id + */ +export const getUserAccount = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/userAccount/' + id, + method: 'get' + }); +}; + +/** + * 新增账号管理 + * @param data + */ +export const addUserAccount = (data: UserAccountForm) => { + return request({ + url: '/zhishu/userAccount', + method: 'post', + data: data + }); +}; + +/** + * 修改账号管理 + * @param data + */ +export const updateUserAccount = (data: UserAccountForm) => { + return request({ + url: '/zhishu/userAccount', + method: 'put', + data: data + }); +}; + +/** + * 删除账号管理 + * @param id + */ +export const delUserAccount = (id: string | number | Array) => { + return request({ + url: '/zhishu/userAccount/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/depot/userAccount/types.ts b/src/api/zhishu/depot/userAccount/types.ts new file mode 100644 index 0000000..1547e6a --- /dev/null +++ b/src/api/zhishu/depot/userAccount/types.ts @@ -0,0 +1,116 @@ +export interface UserAccountVO { + /** + * + */ + id: string | number; + + /** + * 出入帐账户类型 0 出账 1 入账 + */ + type: string; + + /** + * 账号类型 + */ + accountType: string; + + /** + * 账号名称 + */ + accountName: string; + + /** + * 账号 + */ + account: string; + + /** + * 是否默认账号 0 否 1 是 + */ + isDefault: string; + + /** + * 店铺状态(0正常 1停用) + */ + status: string; + +} + +export interface UserAccountForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 出入帐账户类型 0 出账 1 入账 + */ + type?: string; + + /** + * 账号类型 + */ + accountType?: string; + + /** + * 账号名称 + */ + accountName?: string; + + /** + * 账号 + */ + account?: string; + + /** + * 是否默认账号 0 否 1 是 + */ + isDefault?: string; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + +} + +export interface UserAccountQuery extends PageQuery { + + /** + * 出入帐账户类型 0 出账 1 入账 + */ + type?: string; + + /** + * 账号类型 + */ + accountType?: string; + + /** + * 账号名称 + */ + accountName?: string; + + /** + * 账号 + */ + account?: string; + + /** + * 是否默认账号 0 否 1 是 + */ + isDefault?: string; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/zhishu/depotOrder/index.ts b/src/api/zhishu/depotOrder/index.ts new file mode 100644 index 0000000..a42c5db --- /dev/null +++ b/src/api/zhishu/depotOrder/index.ts @@ -0,0 +1,152 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { DepotOrderVO, DepotOrderForm, DepotOrderQuery } from '@/api/zhishu/depotOrder/types'; + +/** + * 查询仓库订单信息列表 + * @param query + * @returns {*} + */ + +export const listDepotOrder = (query?: DepotOrderQuery): AxiosPromise => { + return request({ + url: '/zhishu/depotOrder/list', + method: 'get', + params: query + }); +}; + +/** + * 查询仓库订单信息详细 + * @param id + */ +export const getDepotOrder = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/depotOrder/' + id, + method: 'get' + }); +}; + +/** + * 新增仓库订单信息 + * @param data + */ +export const addDepotOrder = (data: DepotOrderForm) => { + return request({ + url: '/zhishu/depotOrder', + method: 'post', + data: data + }); +}; + +/** + * 修改仓库订单信息 + * @param data + */ +export const updateDepotOrder = (data: DepotOrderForm) => { + return request({ + url: '/zhishu/depotOrder', + method: 'put', + data: data + }); +}; + +/** + * 删除仓库订单信息 + * @param id + */ +export const delDepotOrder = (id: string | number | Array) => { + return request({ + url: '/zhishu/depotOrder/' + id, + method: 'delete' + }); +}; + +/** + * 韵达发货获取订单号 + */ +export const getMailNo = (id) =>{ + return request({ + url: '/zhishu/depotOrder/getMailNo?id=' + id, + method: 'get' + }); +} + +/** + * 韵达获取pdf + * @param id + * @returns + */ +export const getPdf = (mailNo) =>{ + return request({ + url: '/zhishu/depotOrder/getPdf?mailNo=' + mailNo, + method: 'get' + }); +} + /** + * 圆通发货获取订单号 + */ +export const getMailNoByYuanTong = (id) => { + return request({ + url: '/zhishu/depotOrder/getMailNoByYuanTong?id=' + id, + method: 'get' + }); +} + +/** + * 圆通获取pdf + * @param waybillNo + * @returns + */ +export const getPdfByYuanTong = (waybillNo) => { + // 确保参数作为字符串传递,避免被序列化为数组 + return request({ + url: `/zhishu/depotOrder/getPdfByYuanTong?waybillNo=`+waybillNo, + method: 'get' + }); +} + +/** + * 申通获取运单号 + */ +export const getMailNoByShenTong = (id) => { + // 确保参数作为字符串传递,避免被序列化为数组 + return request({ + url: `/zhishu/depotOrder/getMailNoByShentong?id=`+id, + method: 'get' + }); +} + +/** + * 申通获取pdf + * @param waybillNo + * @returns + */ +export const getPdfByShenTong = (waybillNo) => { + return request({ + url: `/zhishu/depotOrder/getPdfByShenTong?waybillNo=`+waybillNo, + method: 'get' + }); +} + +/** + * 中通获取运单号 + */ +export const getMailNoByZhongTong = (id) => { + // 确保参数作为字符串传递,避免被序列化为数组 + return request({ + url: `/zhishu/depotOrder/getMailNoByZhongTong?id=`+id, + method: 'get' + }); +} + +/** + * 中通 获取pdf + */ +export const getPdfByZhongTong = (waybillNo) => { + return request({ + url: `/zhishu/depotOrder/getPdfByZhongTong?waybillNo=`+waybillNo, + method: 'get' + }); +} + diff --git a/src/api/zhishu/depotOrder/types.ts b/src/api/zhishu/depotOrder/types.ts new file mode 100644 index 0000000..cb2f0c5 --- /dev/null +++ b/src/api/zhishu/depotOrder/types.ts @@ -0,0 +1,1137 @@ +export interface DepotOrderVO { + /** + * 主键 + */ + id: string | number; + + /** + * 店铺订单id + */ + shopOrderId: string | number; + + /** + * 处理人 + */ + userId: string | number; + + /** + * 商品信息 + */ + itemList: string; + + /** + * 仓库订单状态 0 待发货 1 已发货 2 无库存 3 转发任务 + */ + status: string; + + /** + * 创建者 + */ + createBy: number; + + /** + * 创建时间 + */ + createTime: string; + + /** + * 店铺id + */ + shopId: string | number; + + /** + * 店铺名称 + */ + shopName: string; + + /** + * 地址 + */ + address: string; + + /** + * 详细地址 + */ + addressMask: string; + + /** + * 售后状态 0:无售后 2:买家申请退款,待商家处理 3:退货退款,待商家处理 4:商家同意退款,退款中 5:平台同意退款,退款中 6:驳回退款,待买家处理 7:已同意退货退款,待用户发货 8:平台处理中 9:平台拒绝退款,退款关闭 10:退款成功 11:买家撤销 12:买家逾期未处理,退款失败 13:买家逾期,超过有效期 14:换货补寄待商家处理 15:换货补寄待用户处理 16:换货补寄成功 17:换货补寄失败 18:换货补寄待用户确认完成 21:待商家同意维修 22:待用户确认发货 24:维修关闭 25:维修成功 27:待用户确认收货 31:已同意拒收退款,待用户拒收 32:补寄待商家发货 33:同意召回后退款,待商家召回 + */ + afterSalesStatus: number; + + /** + * 买家留言信息 + */ + buyerMemo: string; + + /** + * 成交状态:0:未成交、1:已成交、2:已取消 + */ + confirmStatus: number; + + /** + * 成交时间 + */ + confirmTime: string; + + /** + * 订单创建时间 + */ + createdTime: string; + + /** + * 是否当日发货,1-是,0-否 + */ + deliveryOneDay: string; + + /** + * 折扣金额,单位:元,折扣金额=平台优惠+商家优惠+团长免单优惠金额 + */ + discountAmount: string; + + /** + * 多多支付立减金额,单位:元 + */ + duoDuoPayReduction: number; + + /** + * 是否多多批发 + */ + duoduoWholesale: number; + + /** + * 商品金额 + */ + goodsAmount: number; + + /** + * 仓库编码 + */ + depotCode: string; + + /** + * 仓库id + */ + depotId: string | number; + + /** + * 支付申报订单号 + */ + depotName: string; + + /** + * 仓库类型,1:自有仓 2:订阅仓 两者都不是则传空 + */ + depotType: number; + + /** + * 货品id + */ + wareId: string | number; + + /** + * 货品名称 + */ + wareName: string; + + /** + * 货品编码 + */ + wareSn: string; + + /** + * 货品类型(0:普通货品:1:组合货品) + */ + wareType: string; + + /** + * 订单编号 + */ + orderSn: string; + + /** + * 订单状态 + */ + orderStatus: number; + + /** + * 支付金额 + */ + payAmount: number; + + /** + * 支付单号 + */ + payNo: number; + + /** + * 支付时间 + */ + payTime: string; + + /** + * 支付方式 + */ + payType: string; + + /** + * 平台优惠金额 + */ + platformDiscount: number; + + /** + * 邮费 + */ + postage: number; + + /** + * 预售时间 + */ + preSaleTime: string; + + /** + * 承诺送达时间 + */ + promiseDeliveryTime: string; + + /** + * 省份 + */ + province: string; + + /** + * 省份编码 + */ + provinceId: string | number; + + /** + * 确认收货时间 + */ + receiveTime: string; + /** + * 市 + */ + city:string; + + /** + * 市编码 + */ + cityId:string; + + /** + * 收件人地址 + */ + receiverAddress: string; + + /** + * 收件人地址 + */ + receiverAddressMask: string; + + /** + * 收件人姓名 + */ + receiverName: string; + + /** + * 收件人姓名 + */ + receiverNameMask: string; + + /** + * 确认收货时间 + */ + receiverPhone: string; + + /** + * 收件人手机号(打码) + */ + receiverPhoneMask: string; + + /** + * 售后状态 + */ + refundStatus: number; + + /** + * 订单备注 + */ + remark: string; + + /** + * 1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag: string; + + /** + * 订单备注标记名称 + */ + remarkTagName: string; + + /** + * 退货包运费,1:是,0:否 + */ + returnFreightPayer: number; + + /** + * 订单审核状态(0-正常订单, 1-审核中订单) + */ + riskControlStatus: number; + + /** + * 是否门店自提 + */ + selfContained: number; + + /** + * 商家优惠金额 + */ + sellerDiscount: number; + + /** + * 缺货处理状态 -1:无缺货处理 0: 缺货待处理 1缺货已处理 + */ + stockOutHandleStatus: number; + + /** + * 全国联保,1:是,0:否 + */ + supportNationwideWarranty: string | number; + + /** + * 区,乡镇 + */ + town: string; + + /** + * 区县编码 + */ + townId: string | number; + + /** + * 快递单号 + */ + trackingNumber: string; + + /** + * 以旧换新国家补贴金额,单位:元 + */ + tradeInNationalSubsidyAmount: string | number; + + /** + * 订单类型 0-普通订单 ,1- 定金订单 + */ + tradeType: number; + + /** + * 订单的更新时间 + */ + updatedAt: string; + + /** + * 催发货时间 + */ + urgeShippingTime: string; + + /** + * 预约配送日期 + */ + yypsDate: string; + + /** + * 预约配送时段 + */ + yypsTime: string; + + /** + * 合单ID2 + */ + openAddressId2: string | number; + + + /** + * 订单异常类型状态 + */ + orderExceptionTypeList:string[]; + + /** + * 订单状态 + */ + orderSourceType:number; + /** + * 商品信息 + */ + orderItemList:OrderItem; + /** + * 货号 + */ + artNo:string; + +} + +export interface DepotOrderForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 店铺订单id + */ + shopOrderId?: string | number; + + /** + * 处理人 + */ + userId?: string | number; + + /** + * 商品信息 + */ + itemList?: string; + + /** + * 仓库订单状态 0 待发货 1 已发货 2 无库存 3 转发任务 + */ + status?: string; + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 地址 + */ + address?: string; + + /** + * 详细地址 + */ + addressMask?: string; + + /** + * 售后状态 0:无售后 2:买家申请退款,待商家处理 3:退货退款,待商家处理 4:商家同意退款,退款中 5:平台同意退款,退款中 6:驳回退款,待买家处理 7:已同意退货退款,待用户发货 8:平台处理中 9:平台拒绝退款,退款关闭 10:退款成功 11:买家撤销 12:买家逾期未处理,退款失败 13:买家逾期,超过有效期 14:换货补寄待商家处理 15:换货补寄待用户处理 16:换货补寄成功 17:换货补寄失败 18:换货补寄待用户确认完成 21:待商家同意维修 22:待用户确认发货 24:维修关闭 25:维修成功 27:待用户确认收货 31:已同意拒收退款,待用户拒收 32:补寄待商家发货 33:同意召回后退款,待商家召回 + */ + afterSalesStatus?: number; + + /** + * 买家留言信息 + */ + buyerMemo?: string; + + /** + * 成交状态:0:未成交、1:已成交、2:已取消 + */ + confirmStatus?: number; + + /** + * 成交时间 + */ + confirmTime?: string; + + /** + * 订单创建时间 + */ + createdTime?: string; + + /** + * 是否当日发货,1-是,0-否 + */ + deliveryOneDay?: string; + + /** + * 折扣金额,单位:元,折扣金额=平台优惠+商家优惠+团长免单优惠金额 + */ + discountAmount?: string; + + /** + * 多多支付立减金额,单位:元 + */ + duoDuoPayReduction?: number; + + /** + * 是否多多批发 + */ + duoduoWholesale?: number; + + /** + * 商品金额 + */ + goodsAmount?: number; + + /** + * 仓库编码 + */ + depotCode?: string; + + /** + * 仓库id + */ + depotId?: string | number; + + /** + * 支付申报订单号 + */ + depotName?: string; + + /** + * 仓库类型,1:自有仓 2:订阅仓 两者都不是则传空 + */ + depotType?: number; + + /** + * 货品id + */ + wareId?: string | number; + + /** + * 货品名称 + */ + wareName?: string; + + /** + * 货品编码 + */ + wareSn?: string; + + /** + * 货品类型(0:普通货品:1:组合货品) + */ + wareType?: string; + + /** + * 订单编号 + */ + orderSn?: string; + + /** + * 订单状态 + */ + orderStatus?: number; + + /** + * 支付金额 + */ + payAmount?: number; + + /** + * 支付单号 + */ + payNo?: number; + + /** + * 支付时间 + */ + payTime?: string; + + /** + * 支付方式 + */ + payType?: string; + + /** + * 平台优惠金额 + */ + platformDiscount?: number; + + /** + * 邮费 + */ + postage?: number; + + /** + * 预售时间 + */ + preSaleTime?: string; + + /** + * 承诺送达时间 + */ + promiseDeliveryTime?: string; + + /** + * 省份 + */ + province?: string; + + /** + * 省份编码 + */ + provinceId?: string | number; + + /** + * 确认收货时间 + */ + receiveTime?: string; + + /** + * 收件人地址 + */ + receiverAddress?: string; + + /** + * 收件人地址 + */ + receiverAddressMask?: string; + + /** + * 收件人姓名 + */ + receiverName?: string; + + /** + * 收件人姓名 + */ + receiverNameMask?: string; + + /** + * 确认收货时间 + */ + receiverPhone?: string; + + /** + * 收件人手机号(打码) + */ + receiverPhoneMask?: string; + + /** + * 售后状态 + */ + refundStatus?: number; + + /** + * 订单备注 + */ + remark?: string; + + /** + * 1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag?: string; + + /** + * 订单备注标记名称 + */ + remarkTagName?: string; + + /** + * 退货包运费,1:是,0:否 + */ + returnFreightPayer?: number; + + /** + * 订单审核状态(0-正常订单, 1-审核中订单) + */ + riskControlStatus?: number; + + /** + * 是否门店自提 + */ + selfContained?: number; + + /** + * 商家优惠金额 + */ + sellerDiscount?: number; + + /** + * 缺货处理状态 -1:无缺货处理 0: 缺货待处理 1缺货已处理 + */ + stockOutHandleStatus?: number; + + /** + * 全国联保,1:是,0:否 + */ + supportNationwideWarranty?: string | number; + + /** + * 区,乡镇 + */ + town?: string; + + /** + * 区县编码 + */ + townId?: string | number; + + /** + * 快递单号 + */ + trackingNumber?: string; + + /** + * 以旧换新国家补贴金额,单位:元 + */ + tradeInNationalSubsidyAmount?: string | number; + + /** + * 订单类型 0-普通订单 ,1- 定金订单 + */ + tradeType?: number; + + /** + * 订单的更新时间 + */ + updatedAt?: string; + + /** + * 催发货时间 + */ + urgeShippingTime?: string; + + /** + * 预约配送日期 + */ + yypsDate?: string; + + /** + * 预约配送时段 + */ + yypsTime?: string; + + /** + * 合单ID2 + */ + openAddressId2?: string | number; + + /** + * 订单异常类型状态 + */ + orderExceptionTypeList?:string[]; + + /** + * 订单状态 + */ + orderSourceType?:number; + + /** + * 商品详细信息 + */ + orderItemList:OrderItem; + + /** + * 货号 + */ + artNo:string; + +} + +export interface DepotOrderQuery extends PageQuery { + + /** + * 店铺订单id + */ + shopOrderId?: string | number; + + /** + * 处理人 + */ + userId?: string | number; + + /** + * 商品信息 + */ + itemList?: string; + + /** + * 仓库订单状态 0 待发货 1 已发货 2 无库存 3 转发任务 + */ + status?: string; + + /** + * 创建者 + */ + createBy?: number; + + /** + * 创建时间 + */ + createTime?: string; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 地址 + */ + address?: string; + + /** + * 详细地址 + */ + addressMask?: string; + + /** + * 售后状态 0:无售后 2:买家申请退款,待商家处理 3:退货退款,待商家处理 4:商家同意退款,退款中 5:平台同意退款,退款中 6:驳回退款,待买家处理 7:已同意退货退款,待用户发货 8:平台处理中 9:平台拒绝退款,退款关闭 10:退款成功 11:买家撤销 12:买家逾期未处理,退款失败 13:买家逾期,超过有效期 14:换货补寄待商家处理 15:换货补寄待用户处理 16:换货补寄成功 17:换货补寄失败 18:换货补寄待用户确认完成 21:待商家同意维修 22:待用户确认发货 24:维修关闭 25:维修成功 27:待用户确认收货 31:已同意拒收退款,待用户拒收 32:补寄待商家发货 33:同意召回后退款,待商家召回 + */ + afterSalesStatus?: number; + + /** + * 买家留言信息 + */ + buyerMemo?: string; + + /** + * 成交状态:0:未成交、1:已成交、2:已取消 + */ + confirmStatus?: number; + + /** + * 成交时间 + */ + confirmTime?: string; + + /** + * 订单创建时间 + */ + createdTime?: string; + + /** + * 是否当日发货,1-是,0-否 + */ + deliveryOneDay?: string; + + /** + * 折扣金额,单位:元,折扣金额=平台优惠+商家优惠+团长免单优惠金额 + */ + discountAmount?: string; + + /** + * 多多支付立减金额,单位:元 + */ + duoDuoPayReduction?: number; + + /** + * 是否多多批发 + */ + duoduoWholesale?: number; + + /** + * 商品金额 + */ + goodsAmount?: number; + + /** + * 仓库编码 + */ + depotCode?: string; + + /** + * 仓库id + */ + depotId?: string | number; + + /** + * 支付申报订单号 + */ + depotName?: string; + + /** + * 仓库类型,1:自有仓 2:订阅仓 两者都不是则传空 + */ + depotType?: number; + + /** + * 货品id + */ + wareId?: string | number; + + /** + * 货品名称 + */ + wareName?: string; + + /** + * 货品编码 + */ + wareSn?: string; + + /** + * 货品类型(0:普通货品:1:组合货品) + */ + wareType?: string; + + /** + * 订单编号 + */ + orderSn?: string; + + /** + * 订单状态 + */ + orderStatus?: number; + + /** + * 支付金额 + */ + payAmount?: number; + + /** + * 支付单号 + */ + payNo?: number; + + /** + * 支付时间 + */ + payTime?: string; + + /** + * 支付方式 + */ + payType?: string; + + /** + * 平台优惠金额 + */ + platformDiscount?: number; + + /** + * 邮费 + */ + postage?: number; + + /** + * 预售时间 + */ + preSaleTime?: string; + + /** + * 承诺送达时间 + */ + promiseDeliveryTime?: string; + + /** + * 省份 + */ + province?: string; + + /** + * 省份编码 + */ + provinceId?: string | number; + + /** + * 确认收货时间 + */ + receiveTime?: string; + + /** + * 收件人地址 + */ + receiverAddress?: string; + + /** + * 收件人地址 + */ + receiverAddressMask?: string; + + /** + * 收件人姓名 + */ + receiverName?: string; + + /** + * 收件人姓名 + */ + receiverNameMask?: string; + + /** + * 确认收货时间 + */ + receiverPhone?: string; + + /** + * 收件人手机号(打码) + */ + receiverPhoneMask?: string; + + /** + * 售后状态 + */ + refundStatus?: number; + + /** + * 1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag?: string; + + /** + * 订单备注标记名称 + */ + remarkTagName?: string; + + /** + * 退货包运费,1:是,0:否 + */ + returnFreightPayer?: number; + + /** + * 订单审核状态(0-正常订单, 1-审核中订单) + */ + riskControlStatus?: number; + + /** + * 是否门店自提 + */ + selfContained?: number; + + /** + * 商家优惠金额 + */ + sellerDiscount?: number; + + /** + * 缺货处理状态 -1:无缺货处理 0: 缺货待处理 1缺货已处理 + */ + stockOutHandleStatus?: number; + + /** + * 全国联保,1:是,0:否 + */ + supportNationwideWarranty?: string | number; + + /** + * 区,乡镇 + */ + town?: string; + + /** + * 区县编码 + */ + townId?: string | number; + + /** + * 快递单号 + */ + trackingNumber?: string; + + /** + * 以旧换新国家补贴金额,单位:元 + */ + tradeInNationalSubsidyAmount?: string | number; + + /** + * 订单类型 0-普通订单 ,1- 定金订单 + */ + tradeType?: number; + + /** + * 订单的更新时间 + */ + updatedAt?: string; + + /** + * 催发货时间 + */ + urgeShippingTime?: string; + + /** + * 预约配送日期 + */ + yypsDate?: string; + + /** + * 预约配送时段 + */ + yypsTime?: string; + + /** + * 合单ID2 + */ + openAddressId2?: string | number; + + + /** + * 开始时间 + */ + startTime?:string; + + + /** + * 结束时间 + */ + endTime?:string; + /** + * 结束时间 + */ + order_status?:string; + /** + * 结束时间 + */ + refund_status?:string; + + /** + * 时间集合 + */ + dateTime?:string; + // + confirmTimeList: undefined, + // startConfirmTime: undefined, + // endConfirmTime: undefined, + + /** + * 订单异常类型 + */ + orderExceptionTypeList?:string, + /** + * 订单来源 + */ + orderSourceType?:number, + + /** + * 查询订单创建时间起始时间 + */ + createdTimeStart:undefined, + + /** + * 查询订单创建时间截至时间 + */ + createdTimeEnd:undefined, +} + + + +// 商品信息详细信息 +export interface OrderItem{ + /** + * 商品名称 + */ + goodsName:string, + /** + * 商品图片 + */ + goodsImg:string, + + /** + * 商品价格(元) + */ + goodsPrice:string, + /** + * 商品数量 + */ + + goodsCount:string, + /** + * 货号 + */ + artNo:string, +} \ No newline at end of file diff --git a/src/api/zhishu/district/index.ts b/src/api/zhishu/district/index.ts new file mode 100644 index 0000000..6ec3e24 --- /dev/null +++ b/src/api/zhishu/district/index.ts @@ -0,0 +1,51 @@ +import request from '@/utils/request'; +import type { R } from '@/api/types'; +import { TDistrictVo, templateData } from '@/api/zhishu/district/types'; +import { DepotQuery, DepotVO } from '@/api/zhishu/depot/types'; +import { AxiosPromise } from 'axios'; + +// 获取所有省级数据 +export function getProvinces() { + return request.get>('/district/provinces'); +} + +export function getCitiesByProvinceId(provinceId: number) { + return request.get>(`/district/cities/${provinceId}`); +} + +export function getDistrictsByCityId(cityId: number) { + return request.get>(`/district/districts/${cityId}`); +} + +/** + * 获取省级市级 + * @returns + */ +export const getDistrictTree = () => { + return request({ + url: '/district/getDistrictTree', + method: 'get' + }); +} + +// 新增部门 +export const createTemplate = (data: templateData) => { + return request({ + url: '/logistics/logistics', + method: 'post', + data: data + }); +}; +export const getFreInfo = (id: string | number): AxiosPromise => { + return request({ + url: '/logistics/logistics/' + id, + method: 'get' + }); +}; +export const UpdateTemplate = (data: templateData) => { + return request({ + url: '/logistics/logistics', + method: 'put', + data: data + }); +}; diff --git a/src/api/zhishu/district/types.ts b/src/api/zhishu/district/types.ts new file mode 100644 index 0000000..71244a9 --- /dev/null +++ b/src/api/zhishu/district/types.ts @@ -0,0 +1,30 @@ +// 省市区数据接口 +export interface TDistrictVo { + /** ID */ + id: number; + /** 父ID */ + pid: number; + /** 名称 */ + name: string; + /** 层级 0:省 1:市 2:区县 */ + level: number; + /** 状态 0:正常 */ + status: number; +} + +/** + * 部门表单类型 + */ +export interface templateData { + id?: number; + template_name?: string; + delivery_province?: number; + delivery_city?: number; + delivery_area?: number; + pricing_method?: number; + shipping?: string; + // 使用 Record 来定义 shipping_range 的结构 + shipping_range?: Record; // 考虑到数组中既包含数字也包含字符串 + warehouse_id?: number; + remark?:string; +} diff --git a/src/api/zhishu/erpGoodsOrder/index.ts b/src/api/zhishu/erpGoodsOrder/index.ts new file mode 100644 index 0000000..720f89c --- /dev/null +++ b/src/api/zhishu/erpGoodsOrder/index.ts @@ -0,0 +1,131 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ErpGoodsOrderVO, ErpGoodsOrderForm, ErpGoodsOrderQuery } from '@/api/zhishu/erpGoodsOrder/types'; + +/** + * 查询平台订单列表 + * @param query + * @returns {*} + */ + +export const listErpGoodsOrder = (query?: ErpGoodsOrderQuery): AxiosPromise => { + return request({ + url: '/zhishu/erpGoodsOrder/list', + method: 'get', + params: query + }); +}; + +/** + * 匹配仓库 + * @param orderId + * @returns + */ +export const matchGoods = (orderId) => { + return request({ + url: '/zhishu/erpGoodsOrder/matchGoods?orderId='+orderId, + method: 'get' + }); +} + +/** + * 提交下发 + */ +export const submitIssue = (orderId,goodsId) =>{ + return request({ + url: '/zhishu/erpGoodsOrder/submitIssue', + method: 'post', + data: { + "orderId":orderId, + "goodsId":goodsId + } + }); +} + +/** + * 查询平台订单详细 + * @param id + */ +export const getErpGoodsOrder = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/erpGoodsOrder/' + id, + method: 'get' + }); +}; + +/** + * 获取订单操作记录 + * @param orderNo + * @returns + */ +export const getErpOrderLog = (orderSn) => { + return request({ + url: '/zhishu/erpGoodsOrder/getErpOrderLog?orderNo=' + orderSn, + method: 'get' + }); +}; + + +/** + * 新增平台订单 + * @param data + */ +export const addErpGoodsOrder = (data) => { + return request({ + url: '/zhishu/erpGoodsOrder/addErpGoodsOrder', + method: 'post', + data: data + }); +}; + + +/** + * 新增售后订单 + * @param data + * @returns + */ +export const addOrderAfterSales = (data) => { + return request({ + url: '/zhishu/erpGoodsOrder/submitAfterSales', + method: 'post', + data: data + }); +}; + +/** + * 手动同步订单 + * @param shopId + * @returns + */ +export const manualOrder = (shopId) => { + return request({ + url: '/zhishu/erpGoodsOrder/manualOrder', + method: 'post', + params: { + shopIds:shopId + } + }); +} + +/** + * 修改平台订单 + * @param data + */ +export const updateErpGoodsOrder = (data: ErpGoodsOrderForm) => { + return request({ + url: '/zhishu/erpGoodsOrder', + method: 'put', + data: data + }); +}; + +/** + * 删除平台订单 + * @param id + */ +export const delErpGoodsOrder = (id: string | number | Array) => { + return request({ + url: '/zhishu/erpGoodsOrder/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/erpGoodsOrder/types.ts b/src/api/zhishu/erpGoodsOrder/types.ts new file mode 100644 index 0000000..70df428 --- /dev/null +++ b/src/api/zhishu/erpGoodsOrder/types.ts @@ -0,0 +1,695 @@ +export interface ErpGoodsOrderVO { + /** + * + */ + id: string | number; + + /** + * 订单编号 + */ + orderSn: string; + + /** + * 平台店铺id + */ + shopId: string | number; + + /** + * erp店铺id + */ + shopErpId: string | number; + + /** + * 店铺类型 + */ + shopType: number; + + /** + * 商品一级id + */ + catId1: string | number; + + /** + * 商品二级id + */ + catId2: string | number; + + /** + * 商品三级id + */ + catId3: string | number; + + /** + * 商品四级id + */ + catId4: string | number; + + /** + * 订单中商品sku列表 + */ + itemList: string; + + /** + * 订单金额 单位:分 + */ + orderTotal: number; + + /** + * 商品金额(以分为单位)商品金额=商品销售价格*商品数量-订单改价折扣金额 + */ + goodsAmount: number; + + /** + * 订单改价折扣金额(以分为单位) + */ + orderChangeAmount: number; + + /** + * 支付金额 (以分为单位) 支付金额=商品金额-折扣金额+邮费+服务费 + */ + payAmount: number; + + /** + * 创建时间 时间戳 + */ + createdAt: number; + + /** + * 成交状态 + */ + confirmStatus: number; + + /** + * 成交时间 时间戳 + */ + confirmAt: number; + + /** + * 支付单号 + */ + payNo: string; + + /** + * 支付时间 时间戳 + */ + payAt: number; + + /** + * 支付方式 + */ + payType: number; + + /** + * 平台优惠金额 (以分为单位) + */ + platformDiscount: number; + + /** + * 买家留言信息 + */ + buyerMemo: string; + + /** + * 发货状态 1:待发货,2:已发货待签收,3:已签收 + */ + orderStatus: number; + + /** + * 物流id + */ + shippingId: string | number; + + /** + * 发货时间 时间戳 + */ + shippingAt: number; + + /** + * 收件地城市 + */ + city: string; + + /** + * 城市编码 + */ + cityId: string | number; + + /** + * 收件地省份 + */ + province: string; + + /** + * 省份编码 + */ + provinceId: string | number; + + /** + * 收件地国家或地区 + */ + country: string; + + /** + * 国家或地区编码 + */ + countryId: string | number; + + /** + * 收件地区县 + */ + town: string; + + /** + * 区县编码 + */ + townId: string | number; + + /** + * 快递单号 + */ + trackingNumber: string; + + /** + * 商家订单备注 + */ + remark: string; + + /** + * 订单备注标记,1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag: number; + + /** + * 订单备注标记名称 + */ + remarkTagName: string; + + /** + * 确认收货时间 + */ + receiveAt: number; + + /** + * 售后状态 + */ + afterSalesStatus: number; + + /** + * 订单最近一次更新时间 + */ + updatedAt: number; + + /** + * 是否可视化 + */ + isShow: number; + + /** + * shop_id的MD5首字母(大写)用于分区 + */ + shopMd5Prefix: string; + + /** + * 是否下发 + */ + isIssue: number; + + /** + * ERP商品id + */ + erpGoodsId: string; + + /** + * 货号 + */ + artNo: string; + + /** + * 原货号 + */ + originalArtNo: string; +} + +export interface ErpGoodsOrderForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 订单编号 + */ + orderSn?: string; + + /** + * 平台店铺id + */ + shopId?: string | number; + + /** + * erp店铺id + */ + shopErpId?: string | number; + + /** + * 店铺类型 + */ + shopType?: number; + + /** + * 商品一级id + */ + catId1?: string | number; + + /** + * 商品二级id + */ + catId2?: string | number; + + /** + * 商品三级id + */ + catId3?: string | number; + + /** + * 商品四级id + */ + catId4?: string | number; + + /** + * 订单中商品sku列表 + */ + itemList?: string; + + /** + * 订单金额 单位:分 + */ + orderTotal?: number; + + /** + * 商品金额(以分为单位)商品金额=商品销售价格*商品数量-订单改价折扣金额 + */ + goodsAmount?: number; + + /** + * 订单改价折扣金额(以分为单位) + */ + orderChangeAmount?: number; + + /** + * 支付金额 (以分为单位) 支付金额=商品金额-折扣金额+邮费+服务费 + */ + payAmount?: number; + + /** + * 创建时间 时间戳 + */ + createdAt?: number; + + /** + * 成交状态 + */ + confirmStatus?: number; + + /** + * 成交时间 时间戳 + */ + confirmAt?: number; + + /** + * 支付单号 + */ + payNo?: string; + + /** + * 支付时间 时间戳 + */ + payAt?: number; + + /** + * 支付方式 + */ + payType?: number; + + /** + * 平台优惠金额 (以分为单位) + */ + platformDiscount?: number; + + /** + * 买家留言信息 + */ + buyerMemo?: string; + + /** + * 发货状态 1:待发货,2:已发货待签收,3:已签收 + */ + orderStatus?: number; + + /** + * 物流id + */ + shippingId?: string | number; + + /** + * 发货时间 时间戳 + */ + shippingAt?: number; + + /** + * 收件地城市 + */ + city?: string; + + /** + * 城市编码 + */ + cityId?: string | number; + + /** + * 收件地省份 + */ + province?: string; + + /** + * 省份编码 + */ + provinceId?: string | number; + + /** + * 收件地国家或地区 + */ + country?: string; + + /** + * 国家或地区编码 + */ + countryId?: string | number; + + /** + * 收件地区县 + */ + town?: string; + + /** + * 区县编码 + */ + townId?: string | number; + + /** + * 快递单号 + */ + trackingNumber?: string; + + /** + * 商家订单备注 + */ + remark?: string; + + /** + * 订单备注标记,1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag?: number; + + /** + * 订单备注标记名称 + */ + remarkTagName?: string; + + /** + * 确认收货时间 + */ + receiveAt?: number; + + /** + * 售后状态 + */ + afterSalesStatus?: number; + + /** + * 订单最近一次更新时间 + */ + updatedAt?: number; + + /** + * 是否可视化 + */ + isShow?: number; + + /** + * shop_id的MD5首字母(大写)用于分区 + */ + shopMd5Prefix?: string; + + /** + * 是否下发 + */ + isIssue?: number; + + /** + * ERP商品id + */ + erpGoodsId?: string; + + /** + * 货号 + */ + artNo?: string; + + /** + * 原货号 + */ + originalArtNo?: string; + + /** + * 商品列表对象 + */ + zhishuShopGoodsList?: []; + +} + +export interface ErpGoodsOrderQuery extends PageQuery { + + /** + * 订单编号 + */ + orderSn?: string; + + /** + * 平台店铺id + */ + shopId?: string | number; + + /** + * erp店铺id + */ + shopErpId?: string | number; + + /** + * 店铺类型 + */ + shopType?: number; + + /** + * 商品一级id + */ + catId1?: string | number; + + /** + * 商品二级id + */ + catId2?: string | number; + + /** + * 商品三级id + */ + catId3?: string | number; + + /** + * 商品四级id + */ + catId4?: string | number; + + /** + * 订单中商品sku列表 + */ + itemList?: string; + + /** + * 订单金额 单位:分 + */ + orderTotal?: number; + + /** + * 商品金额(以分为单位)商品金额=商品销售价格*商品数量-订单改价折扣金额 + */ + goodsAmount?: number; + + /** + * 订单改价折扣金额(以分为单位) + */ + orderChangeAmount?: number; + + /** + * 支付金额 (以分为单位) 支付金额=商品金额-折扣金额+邮费+服务费 + */ + payAmount?: number; + + /** + * 创建时间 时间戳 + */ + createdAt?: number; + + /** + * 成交状态 + */ + confirmStatus?: number; + + /** + * 成交时间 时间戳 + */ + confirmAt?: number; + + /** + * 支付单号 + */ + payNo?: string; + + /** + * 支付时间 时间戳 + */ + payAt?: number; + + /** + * 支付方式 + */ + payType?: number; + + /** + * 平台优惠金额 (以分为单位) + */ + platformDiscount?: number; + + /** + * 买家留言信息 + */ + buyerMemo?: string; + + /** + * 发货状态 1:待发货,2:已发货待签收,3:已签收 + */ + orderStatus?: number; + + /** + * 物流id + */ + shippingId?: string | number; + + /** + * 发货时间 时间戳 + */ + shippingAt?: number; + + /** + * 收件地城市 + */ + city?: string; + + /** + * 城市编码 + */ + cityId?: string | number; + + /** + * 收件地省份 + */ + province?: string; + + /** + * 省份编码 + */ + provinceId?: string | number; + + /** + * 收件地国家或地区 + */ + country?: string; + + /** + * 国家或地区编码 + */ + countryId?: string | number; + + /** + * 收件地区县 + */ + town?: string; + + /** + * 区县编码 + */ + townId?: string | number; + + /** + * 快递单号 + */ + trackingNumber?: string; + + /** + * 订单备注标记,1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag?: number; + + /** + * 订单备注标记名称 + */ + remarkTagName?: string; + + /** + * 确认收货时间 + */ + receiveAt?: number; + + /** + * 售后状态 + */ + afterSalesStatus?: number; + + /** + * 订单最近一次更新时间 + */ + updatedAt?: number; + + /** + * 是否可视化 + */ + isShow?: number; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 是否下发 + */ + isIssue?: number; + + /** + * ERP商品id + */ + erpGoodsId: string; + + /** + * 货号 + */ + artNo?: string; + + /** + * 原货号 + */ + originalArtNo?: string; +} + + + diff --git a/src/api/zhishu/excelTask/index.ts b/src/api/zhishu/excelTask/index.ts new file mode 100644 index 0000000..7f238ed --- /dev/null +++ b/src/api/zhishu/excelTask/index.ts @@ -0,0 +1,117 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import exp from 'constants'; +import { ExcelTaskForm, ExcelTaskQuery, ExcelTaskVO } from '@/api/zhishu/excelTask/types'; + +/** + * 查询任务列表列表 + * @param query + * @returns {*} + */ + +export const excelListTask = (query?: ExcelTaskQuery): AxiosPromise => { + return request({ + url: '/zhishu/excelTask/list', + method: 'get', + params: query + }); +}; + +export const excelLogsTask = (id) =>{ + return request({ + url: '/zhishu/excelTask/logsList', + method: 'get', + params: { + "id":id + } + }); +} + +export const excelLogsMsg = (id) =>{ + return request({ + url: '/zhishu/excelTask/logsMsg', + method: 'get', + params: { + "id":id + } + }); +} + +export const excelLogsDetailTask = (data) => { + return request({ + url: '/zhishu/excelTask/logsDetailList/'+data.taskId+"/"+data.shopId, + method: 'get' + }); +} + +export const excelDownloadLog = (fileName) => { + return request({ + url: '/zhishu/excelTask/downloadLogs/'+fileName, + method: 'get' + }); +} +/** + * 暂停线程 + */ +export const excelPauseThread = (threadId,id) =>{ + return request({ + url: '/zhishu/excelTask/pauseThread/'+threadId+"/"+id, + method: 'get' + }); +} + +/** + * 恢复线程 + */ +export const excelContinueThread = (threadId,id) =>{ + return request({ + url: '/zhishu/excelTask/continueThread/'+threadId+"/"+id, + method: 'get' + }); +} + +/** + * 查询任务列表详细 + * @param id + */ +export const excelGetTask = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/excelTask/' + id, + method: 'get' + }); +}; + +/** + * 新增任务列表 + * @param data + */ +export const excelAddTask = (data) => { + return request({ + url: '/zhishu/excelTask', + method: 'post', + data: data + }); +}; + +/** + * 修改任务列表 + * @param data + */ +export const excelUpdateTask = (data: ExcelTaskForm) => { + return request({ + url: '/zhishu/excelTask', + method: 'put', + data: data + }); +}; + +/** + * 删除任务列表 + * @param id + */ +export const excelDelTask = (id: string | number | Array) => { + return request({ + url: '/zhishu/excelTask/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/excelTask/types.ts b/src/api/zhishu/excelTask/types.ts new file mode 100644 index 0000000..d24e42f --- /dev/null +++ b/src/api/zhishu/excelTask/types.ts @@ -0,0 +1,164 @@ +import { string } from "vue-types"; + +export interface ExcelTaskVO extends BaseEntity { + /** + * + */ + id: string | number; + + /** + * 任务类型 1 发布商品 + */ + taskType: string; + + /** + * 仓库id 字符串 + */ + depotIds: string | number; + + /** + * 文件名称 + */ + fileName: string; + + /** + * 执行数据条数 + */ + dataNum: number; + + /** + * 任务状态 + */ + taskStatus: string; + + /** + * 状态(0正常 1停用) + */ + status: string; + + /** + * 线程id + */ + threadId: string | number; +} + +export interface ExcelTaskForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 任务类型 1 发布商品 + */ + taskType?: string; + /** + * 仓库id 字符串 + */ + depotIds?: string | number; + + /** + * 文件名称 + */ + fileName?: string; + + /** + * 执行数据条数 + */ + dataNum?: number; + + /** + * 任务状态 + */ + taskStatus?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 线程id + */ + threadId: string | number; +} + +export interface ExcelTaskQuery extends PageQuery { + + /** + * 任务类型 1 发布商品 + */ + taskType?: string; + /** + * 仓库id 字符串 + */ + depotIds?: string | number; + + /** + * 文件名称 + */ + fileName?: string; + + /** + * 执行数据条数 + */ + dataNum?: number; + + /** + * 任务状态 + */ + taskStatus?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 线程id + */ + threadId: string | number; +} + + + +/** + * 发布任务Vo + */ +export interface ReleaseExccelTaskVO{ + + id?: number; + /** + * 任务类型 + */ + taskType?: string; + /** + * 更新方式 + */ + way?: string; + + /** + * 上架状态 + */ + listStatus?: string; + + /** + * 图书类目 + */ + bookCategory?: string; + + /** + * 指定类目 + */ + appointCategory?: string; + /** + * 仓库id 选择 + */ + depotIds?: string; +} + diff --git a/src/api/zhishu/fastMail/index.ts b/src/api/zhishu/fastMail/index.ts new file mode 100644 index 0000000..5f76fa9 --- /dev/null +++ b/src/api/zhishu/fastMail/index.ts @@ -0,0 +1,83 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { FastMailVO, FastMailForm, FastMailQuery } from '@/api/zhishu/fastMail/types'; + +/** + * 查询快递打单账号管理列表 + * @param query + * @returns {*} + */ + +export const listFastMail = (query?: FastMailQuery): AxiosPromise => { + return request({ + url: '/zhishu/fastMail/list', + method: 'get', + params: query + }); +}; + +export const listFastMailNoPage = (query?: FastMailQuery): AxiosPromise => { + return request({ + url: '/zhishu/fastMail/listNoPage', + method: 'get', + params: query + }); +}; + +/** + * 获取拼多多面单账号 + * @param shopId + * @returns + */ +export const getPddFastMail = (shopId) => { + return request({ + url: '/zhishu/fastMail/getPddFastMail?shopId=' + shopId, + method: 'get' + }); +} + +/** + * 查询快递打单账号管理详细 + * @param id + */ +export const getFastMail = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/fastMail/' + id, + method: 'get' + }); +}; + +/** + * 新增快递打单账号管理 + * @param data + */ +export const addFastMail = (data: FastMailForm) => { + return request({ + url: '/zhishu/fastMail', + method: 'post', + data: data + }); +}; + +/** + * 修改快递打单账号管理 + * @param data + */ +export const updateFastMail = (data: FastMailForm) => { + return request({ + url: '/zhishu/fastMail', + method: 'put', + data: data + }); +}; + +/** + * 删除快递打单账号管理 + * @param id + */ +export const delFastMail = (id: string | number | Array) => { + return request({ + url: '/zhishu/fastMail/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/fastMail/types.ts b/src/api/zhishu/fastMail/types.ts new file mode 100644 index 0000000..465320d --- /dev/null +++ b/src/api/zhishu/fastMail/types.ts @@ -0,0 +1,164 @@ +export interface FastMailVO { + /** + * 主键 + */ + id: string | number; + + /** + * 类型 1 韵达 + */ + type: string; + + /** + * 账号 + */ + partnerId: string | number; + + /** + * 联调密码 + */ + secret: string; + + /** + * 创建时间 + */ + createTime: string; + + /** + * 更新时间 + */ + updateTime: string; + + /** + * 状态(0正常 1停用) + */ + status: string; + + /** + * 普通快递余额 + */ + commonRemainNum: string; + + /** + * 代付快递余额 + */ + codRemainNum: string; + + /** + * 面单类型 1 网点面单 2 拼多多面单 + */ + fastMailType: string; + + /** + * 备注 + */ + remark: string; +} + +export interface FastMailForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 类型 1 韵达 + */ + type?: string; + + /** + * 账号 + */ + partnerId?: string | number; + + /** + * 联调密码 + */ + secret?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 普通快递余额 + */ + commonRemainNum?: string; + + /** + * 代付快递余额 + */ + codRemainNum?: string; + + /** + * 面单类型 1 网点面单 2 拼多多面单 + */ + fastMailType?: string; + + /** + * 备注 + */ + remark?: string; +} + +export interface FastMailQuery extends PageQuery { + + /** + * 类型 1 韵达 + */ + type?: string; + + /** + * 账号 + */ + partnerId?: string | number; + + /** + * 联调密码 + */ + secret?: string; + + /** + * 创建时间 + */ + createTime?: string; + + /** + * 更新时间 + */ + updateTime?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 普通快递余额 + */ + commonRemainNum?: string; + + /** + * 代付快递余额 + */ + codRemainNum?: string; + + /** + * 面单类型 1 网点面单 2 拼多多面单 + */ + fastMailType?: string; + + /** + * 备注 + */ + remark?: string; +} + + + diff --git a/src/api/zhishu/filterSet/index.ts b/src/api/zhishu/filterSet/index.ts new file mode 100644 index 0000000..39a2a82 --- /dev/null +++ b/src/api/zhishu/filterSet/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { FilterSetVO, FilterSetForm, FilterSetQuery } from '@/api/zhishu/filterSet/types'; + +/** + * 查询过滤设置列表 + * @param query + * @returns {*} + */ + +export const listFilterSet = (query?: FilterSetQuery): AxiosPromise => { + return request({ + url: '/zhishu/filterSet/list', + method: 'get', + params: query + }); +}; + +/** + * 查询过滤设置详细 + * @param id + */ +export const getFilterSet = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/filterSet/' + id, + method: 'get' + }); +}; + +/** + * 新增过滤设置 + * @param data + */ +export const addFilterSet = (data: FilterSetForm) => { + return request({ + url: '/zhishu/filterSet', + method: 'post', + data: data + }); +}; + +/** + * 修改过滤设置 + * @param data + */ +export const updateFilterSet = (data: FilterSetForm) => { + return request({ + url: '/zhishu/filterSet', + method: 'put', + data: data + }); +}; + +/** + * 删除过滤设置 + * @param id + */ +export const delFilterSet = (id: string | number | Array) => { + return request({ + url: '/zhishu/filterSet/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/filterSet/types.ts b/src/api/zhishu/filterSet/types.ts new file mode 100644 index 0000000..2423073 --- /dev/null +++ b/src/api/zhishu/filterSet/types.ts @@ -0,0 +1,111 @@ +export interface FilterSetVO { + /** + * 主键 + */ + id: string | number; + + /** + * 过滤类型 + */ + filterType: string; + + /** + * 限制类型 + */ + limitationType: string; + + /** + * 添加方式 + */ + addWay: string; + + /** + * 内容文件 + */ + addTxt: string; + + /** + * 状态(0正常 1停用) + */ + status: string; + + sort?: string; + + /** + * 加入原因 + */ + reason: string; +} + +export interface FilterSetForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 过滤类型 + */ + filterType?: string; + + /** + * 限制类型 + */ + limitationType?: string; + + /** + * 添加方式 + */ + addWay?: string; + + /** + * 内容文件 + */ + addTxt?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + sort?: string; + + reason?: string; +} + +export interface FilterSetQuery extends PageQuery { + + /** + * 过滤类型 + */ + filterType?: string; + + /** + * 限制类型 + */ + limitationType?: string; + + /** + * 添加方式 + */ + addWay?: string; + + /** + * 内容文件 + */ + addTxt?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + sort?: string; + + reason?: string; +} diff --git a/src/api/zhishu/freight/index.ts b/src/api/zhishu/freight/index.ts new file mode 100644 index 0000000..4722e70 --- /dev/null +++ b/src/api/zhishu/freight/index.ts @@ -0,0 +1,84 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { FreightVO, FreightForm, FreightQuery } from '@/api/zhishu/freight/types'; +import { ShelvesVO } from '@/api/zhishu/shelves/types'; + +/** + * 查询三级货区管理列表 + * @param query + * @returns {*} + */ + +export const listFreight = (query?: FreightQuery): AxiosPromise => { + return request({ + url: '/zhishu/freight/list', + method: 'get', + params: query + }); +}; + +/** + * 查询三级货区管理详细 + * @param id + */ +export const getFreight = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/freight/' + id, + method: 'get' + }); +}; + +/** + * 新增三级货区管理 + * @param data + */ +export const addFreight = (data: FreightForm) => { + return request({ + url: '/zhishu/freight', + method: 'post', + data: data + }); +}; + +/** + * 获取货架树数据 + * @returns + */ +export const getDepotTree = () => { + return request({ + url: '/zhishu/freight/getDepotTree', + method: 'get' + }); +} + +/** + * 修改三级货区管理 + * @param data + */ +export const updateFreight = (data: FreightForm) => { + return request({ + url: '/zhishu/freight', + method: 'put', + data: data + }); +}; + +/** + * 删除三级货区管理 + * @param id + */ +export const delFreight = (id: string | number | Array) => { + return request({ + url: '/zhishu/freight/' + id, + method: 'delete' + }); +}; + + + +export const shelveListData = (): AxiosPromise => { + return request({ + url: '/zhishu/freight/sheList', + method: 'get' + }); +}; diff --git a/src/api/zhishu/freight/types.ts b/src/api/zhishu/freight/types.ts new file mode 100644 index 0000000..636615d --- /dev/null +++ b/src/api/zhishu/freight/types.ts @@ -0,0 +1,184 @@ + export interface FreightVO { + /** + * 货位id + */ + id: string | number; + + /** + * 货架id + */ + shelvesId: string | number; + + /** + * 货位编码 + */ + code: string; + + /** + * 货位名称 + */ + name: string; + + /** + * 单位 + */ + unit: string; + + /** + * 货位容量 + */ + capMax: number; + + /** + * 货号 + */ + artNo: string; + + /** + * 仓库状态(0正常 1停用) + */ + status: string; + + /** + * 二级货区名称 + */ + shelvesName: string; + + /** + * 二级货区code + */ + shelvesCode:string; + + /** + * 是否开启分销 + */ + allowDistribution:string; +} + +export interface FreightForm extends BaseEntity { + /** + * 货位id + */ + id?: string | number; + + /** + * 货架id + */ + shelvesId?: string | number; + + /** + * 货位编码 + */ + code?: string; + + /** + * 货位名称 + */ + name?: string; + /** + * 单位 + */ + unit?: string; + + /** + * 货位容量 + */ + capMax?: number; + + /** + * 货号 + */ + artNo?: string; + + /** + * 仓库状态(0正常 1停用) + */ + status?: string; + + /** + * 二级货区名称 + */ + shelvesName?: string; + + /** + * 完整code + */ + comcode?:string; + + /** + * 是否有下一级 + */ + hasChildren?:boolean; + + /** + * 层级 + */ + level:number; + + /** + * 是否开启分销 + */ + allowDistribution:string; + +} + +export interface FreightQuery extends PageQuery { + + /** + * 货架id + */ + shelvesId?: string | number; + + /** + * 货位编码 + */ + code?: string; + + /** + * 货位名称 + */ + name?: string; + + /** + * 单位 + */ + unit?: string; + + /** + * 货位容量 + */ + capMax?: number; + + /** + * 货号 + */ + artNo?: string; + + /** + * 仓库状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 二级货区名称 + */ + shelvesName?: string; + + /** + * 完整code + */ + comcode?:string; + + /** + * 是否开启分销 + */ + allowDistribution:string; +} + + + diff --git a/src/api/zhishu/goodsAutoFail/index.ts b/src/api/zhishu/goodsAutoFail/index.ts new file mode 100644 index 0000000..03c9199 --- /dev/null +++ b/src/api/zhishu/goodsAutoFail/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { GoodsAutoFailVO, GoodsAutoFailForm, GoodsAutoFailQuery } from '@/api/zhishu/goodsAutoFail/types'; + +/** + * 查询自动发布失败列表 + * @param query + * @returns {*} + */ + +export const listGoodsAutoFail = (query?: GoodsAutoFailQuery): AxiosPromise => { + return request({ + url: '/zhishu/goodsAutoFail/list', + method: 'get', + params: query + }); +}; + +/** + * 查询自动发布失败详细 + * @param id + */ +export const getGoodsAutoFail = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/goodsAutoFail/' + id, + method: 'get' + }); +}; + +/** + * 新增自动发布失败 + * @param data + */ +export const addGoodsAutoFail = (data: GoodsAutoFailForm) => { + return request({ + url: '/zhishu/goodsAutoFail', + method: 'post', + data: data + }); +}; + +/** + * 修改自动发布失败 + * @param data + */ +export const updateGoodsAutoFail = (data: GoodsAutoFailForm) => { + return request({ + url: '/zhishu/goodsAutoFail', + method: 'put', + data: data + }); +}; + +/** + * 删除自动发布失败 + * @param id + */ +export const delGoodsAutoFail = (id: string | number | Array) => { + return request({ + url: '/zhishu/goodsAutoFail/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/goodsAutoFail/types.ts b/src/api/zhishu/goodsAutoFail/types.ts new file mode 100644 index 0000000..7839832 --- /dev/null +++ b/src/api/zhishu/goodsAutoFail/types.ts @@ -0,0 +1,96 @@ +export interface GoodsAutoFailVO { + /** + * + */ + id: string | number; + + + shopId: string | number; + + shopName : string; + + /** + * 商品id + */ + goodsId: string | number; + + goodsName: string; + + isbn: string; + + artNo: string; + + price: string | number; + + inventory: string; + + conditionCode: string; + + firPrice: string; + +} + +export interface GoodsAutoFailForm extends BaseEntity { + /** + * + */ + id?: string | number; + + shopId?: string | number; + + shopName?: string; + + /** + * 商品id + */ + goodsId?: string | number; + + goodsName?: string; + + artNo?: string; + + isbn?: string; + + price?: string | number; + + inventory?: string; + + conditionCode?: string; + + firPrice?: string; + +} + +export interface GoodsAutoFailQuery extends PageQuery { + + shopId?: string | number; + + shopName?: string; + + /** + * 商品id + */ + goodsId?: string | number; + + goodsName?: string; + + artNo?: string; + + isbn?: string; + + price?: string | number; + + inventory?: string; + + conditionCode?: string; + + firPrice?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/zhishu/image/index.ts b/src/api/zhishu/image/index.ts new file mode 100644 index 0000000..6f5295d --- /dev/null +++ b/src/api/zhishu/image/index.ts @@ -0,0 +1,17 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; + +export async function getImage(fileName){ + return request({ + url:'/zhishu/image/getImage?fileName='+fileName, + method:'get' + }) +} + + +export async function getImageMd5(fileName,bookName){ + return request({ + url:'/zhishu/image/getImageMd5?fileName='+fileName+'&bookName='+bookName, + method:'get' + }) +} \ No newline at end of file diff --git a/src/api/zhishu/invite/index.ts b/src/api/zhishu/invite/index.ts new file mode 100644 index 0000000..b8eba7b --- /dev/null +++ b/src/api/zhishu/invite/index.ts @@ -0,0 +1,15 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { parseStrEmpty } from '@/utils/ruoyi'; +import { UserInfoVO } from '@/api/system/user/types'; + +/** + * 获取用户详情 + * @param userId + */ +export const getUserInvite = (userId?: string | number): AxiosPromise => { + return request({ + url: '/zhishu/inviteRelations/' + parseStrEmpty(userId), + method: 'get' + }); +}; diff --git a/src/api/zhishu/invite/types.ts b/src/api/zhishu/invite/types.ts new file mode 100644 index 0000000..bac58f4 --- /dev/null +++ b/src/api/zhishu/invite/types.ts @@ -0,0 +1,37 @@ +/** + * 邀请码对象 + */ +export interface InviteCodeVO { + /** 邀请码ID */ + id: string | number; + /** 邀请码 */ + code: string; + /** 邀请链接 */ + inviteUrl: string; + /** 过期时间 */ + expireTime: string; + /** 使用状态(0未使用 1已使用) */ + used: boolean; + /** 创建时间 */ + createdAt: string; + /** 创建用户 */ + createBy: string; +} + +/** + * 邀请码查询参数 + */ +export interface InviteCodeQuery { + /** 页码 */ + pageNum: number; + /** 每页条数 */ + pageSize: number; +} + +/** + * 生成邀请码参数 + */ +export interface InviteCodeForm { + /** 有效期(天) */ + expireDays: number; +} \ No newline at end of file diff --git a/src/api/zhishu/kongfz/index.ts b/src/api/zhishu/kongfz/index.ts new file mode 100644 index 0000000..276c401 --- /dev/null +++ b/src/api/zhishu/kongfz/index.ts @@ -0,0 +1,14 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; + +// 获取孔夫子运费模板 +export function getTemplateSimpleList(shopId){ + return request({ + url:'/api/kongfz/getTemplateSimpleList/'+shopId, + method:'get' + }) +} + + + + diff --git a/src/api/zhishu/logistics/index.ts b/src/api/zhishu/logistics/index.ts new file mode 100644 index 0000000..a880121 --- /dev/null +++ b/src/api/zhishu/logistics/index.ts @@ -0,0 +1,87 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { LogisticsVO, LogisticsForm, LogisticsQuery } from '@/api/zhishu/logistics/types'; +import { templateData } from '@/api/zhishu/district/types'; + +/** + * 查询物流管理列表 + * @param query + * @returns {*} + */ + +export const listLogistics = (query?: LogisticsQuery): AxiosPromise => { + return request({ + url: '/zhishu/logistics/list', + method: 'get', + params: query + }); +}; + + /** + * 查询打印机设置列表 + * @param query + * @returns {*} + */ + export const listLogisticsNoPage = (query?: LogisticsQuery): AxiosPromise => { + return request({ + url: '/zhishu/logistics/listNoPage', + method: 'get', + params: query + }); + }; + +/** + * 查询物流管理详细 + * @param id + */ +export const getLogistics = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/logistics/' + id, + method: 'get' + }); +}; + +/** + * 新增物流管理 + * @param data + */ +export const addLogistics = (data: LogisticsForm) => { + return request({ + url: '/zhishu/logistics', + method: 'post', + data: data + }); +}; + +/** + * 修改物流管理 + * @param data + */ +export const updateLogistics = (data: LogisticsForm) => { + return request({ + url: '/zhishu/logistics', + method: 'put', + data: data + }); +}; + +/** + * 删除物流管理 + * @param id + */ +export const delLogistics = (id: string | number | Array) => { + return request({ + url: '/zhishu/logistics/' + id, + method: 'delete' + }); +}; + +/** + * 获取运费模版名称和id + */ +export const templateNameList = (): AxiosPromise => { + return request({ + url: '/zhishu/logistics/namelist', + method: 'get' + }); +}; diff --git a/src/api/zhishu/logistics/types.ts b/src/api/zhishu/logistics/types.ts new file mode 100644 index 0000000..6cb945b --- /dev/null +++ b/src/api/zhishu/logistics/types.ts @@ -0,0 +1,254 @@ +export interface LogisticsVO { + + /** + * 物流模版id + */ + id: number | string; + /** + * 物流模板名称 + */ + templateName: string; + + /** + * 发货地-省 + */ + deliveryProvince: string; + + /** + * 发货地-市 + */ + deliveryCity: string; + + /** + * 发货地-区 + */ + deliveryArea: string; + + /** + * 详细地址 + */ + deliveryAddress: string; + + /** + * 计价方式(0按重量 1按标准本数(图书专用) 2按件数 3单独设置运费) + */ + pricingMethod: string; + + /** + * 运送方式(0快递 1自提) + */ + shipping: string; + + /** + * 首重 首本 首件 + */ + firWbv: number; + + /** + * 首费 单位:元 + */ + firPrice: number; + + /** + * 续重 续本 续件 + */ + continueWbv: number; + + /** + * 续费 单位:元 + */ + continuePrice: number; + + /** + * 模板状态(0正常 1停用) + */ + status: string; + + /** + * 运送范围 + */ + shippingRange: string; + + /** + * 仓库ID + */ + warehouseId: string | number; + + /** + * 仓库名称 + */ + warehouseName:string; + +} + +export interface LogisticsForm extends BaseEntity { + /** + * 物流模版id + */ + id?: number | string; + /** + * 物流模板名称 + */ + templateName?: string; + + /** + * 发货地-省 + */ + deliveryProvince?: string; + + /** + * 发货地-市 + */ + deliveryCity?: string; + + /** + * 发货地-区 + */ + deliveryArea?: string; + + /** + * 详细地址 + */ + deliveryAddress?: string; + + /** + * 计价方式(0按重量 1按标准本数(图书专用) 2按件数 3单独设置运费) + */ + pricingMethod?: string; + + /** + * 运送方式(0快递 1自提) + */ + shipping?: string; + + /** + * 首重 首本 首件 + */ + firWbv?: number; + + /** + * 首费 单位:元 + */ + firPrice?: number; + + /** + * 续重 续本 续件 + */ + continueWbv?: number; + + /** + * 续费 单位:元 + */ + continuePrice?: number; + + /** + * 模板状态(0正常 1停用) + */ + status?: string; + + /** + * 运送范围 + */ + shippingRange?: string; + + /** + * 仓库ID + */ + warehouseId?: string | number; + + /** + * 仓库名称 + */ + warehouseName?:string; + +} + +export interface LogisticsQuery extends PageQuery { + /** + * 物流模版id + */ + id?: number | string; + + /** + * 物流模板名称 + */ + templateName?: string; + + /** + * 发货地-省 + */ + deliveryProvince?: string; + + /** + * 发货地-市 + */ + deliveryCity?: string; + + /** + * 发货地-区 + */ + deliveryArea?: string; + + /** + * 详细地址 + */ + deliveryAddress?: string; + + /** + * 计价方式(0按重量 1按标准本数(图书专用) 2按件数 3单独设置运费) + */ + pricingMethod?: string; + + /** + * 运送方式(0快递 1自提) + */ + shipping?: string; + + /** + * 首重 首本 首件 + */ + firWbv?: number; + + /** + * 首费 单位:元 + */ + firPrice?: number; + + /** + * 续重 续本 续件 + */ + continueWbv?: number; + + /** + * 续费 单位:元 + */ + continuePrice?: number; + + /** + * 模板状态(0正常 1停用) + */ + status?: string; + + /** + * 运送范围 + */ + shippingRange?: string; + + /** + * 仓库ID + */ + warehouseId?: string | number; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 仓库名称 + */ + warehouseName?:string; +} + + + diff --git a/src/api/zhishu/notice/index.ts b/src/api/zhishu/notice/index.ts new file mode 100644 index 0000000..d127ceb --- /dev/null +++ b/src/api/zhishu/notice/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { NoticeVO, NoticeForm, NoticeQuery } from '@/api/zhishu/notice/types'; + +/** + * 查询消息通知列表 + * @param query + * @returns {*} + */ + +export const listNotice = (query?: NoticeQuery): AxiosPromise => { + return request({ + url: '/zhishu/notice/list', + method: 'get', + params: query + }); +}; + +/** + * 查询消息通知详细 + * @param id + */ +export const getNotice = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/notice/' + id, + method: 'get' + }); +}; + +/** + * 新增消息通知 + * @param data + */ +export const addNotice = (data: NoticeForm) => { + return request({ + url: '/zhishu/notice', + method: 'post', + data: data + }); +}; + +/** + * 修改消息通知 + * @param data + */ +export const updateNotice = (data: NoticeForm) => { + return request({ + url: '/zhishu/notice', + method: 'put', + data: data + }); +}; + +/** + * 删除消息通知 + * @param id + */ +export const delNotice = (id: string | number | Array) => { + return request({ + url: '/zhishu/notice/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/notice/types.ts b/src/api/zhishu/notice/types.ts new file mode 100644 index 0000000..250e7e2 --- /dev/null +++ b/src/api/zhishu/notice/types.ts @@ -0,0 +1,96 @@ +export interface NoticeVO { + /** + * 主键 + */ + id: string | number; + + /** + * 发件人 + */ + sender: string; + + /** + * 收件人 + */ + recipient: string; + + /** + * 消息 + */ + content: string; + + /** + * 状态 0 未读 1 已读 + */ + status: string; + + /** + * 创建时间 + */ + createTime: string; + +} + +export interface NoticeForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 发件人 + */ + sender?: string; + + /** + * 收件人 + */ + recipient?: string; + + /** + * 消息 + */ + content?: string; + + /** + * 状态 0 未读 1 已读 + */ + status?: string; + +} + +export interface NoticeQuery extends PageQuery { + + /** + * 发件人 + */ + sender?: string; + + /** + * 收件人 + */ + recipient?: string; + + /** + * 消息 + */ + content?: string; + + /** + * 状态 0 未读 1 已读 + */ + status?: string; + + /** + * 创建时间 + */ + createTime?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/zhishu/orderExternalGoods/index.ts b/src/api/zhishu/orderExternalGoods/index.ts new file mode 100644 index 0000000..5207e7d --- /dev/null +++ b/src/api/zhishu/orderExternalGoods/index.ts @@ -0,0 +1,168 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { OrderExternalGoodsVO, OrderExternalGoodsForm, OrderExternalGoodsQuery } from '@/api/zhishu/orderExternalGoods/types'; + +/** + * 查询平台订单列表 + * @param query + * @returns {*} + */ + +export const listOrderExternalGoods = (query?: OrderExternalGoodsQuery): AxiosPromise => { + return request({ + url: '/zhishu/orderExternalGoods/list', + method: 'get', + params: query + }); +}; + +/** + * 获取订单操作记录 + * @param orderNo + * @returns + */ +export const getOrderLog = (orderSn) => { + return request({ + url: '/zhishu/orderExternalGoods/getErpAfterSalesOrderLog?orderNo=' + orderSn, + method: 'get' + }); +}; + +/** + * 根据快递单号匹配快递公司 + * @param query + * @returns + */ +export const getCompanyInfo = (trackingNumber) => { + return request({ + url: '/zhishu/orderExternalGoods/getCompanyInfo?trackingNumber='+trackingNumber, + method: 'get' + }); +}; + +/** + * 回收运单 + * @param erpOrderId + * @returns + */ +export const cancelBmOrder = (erpOrderId) => { + return request({ + url: '/zhishu/orderExternalGoods/cancelBmOrder?erpOrderId='+erpOrderId, + method: 'get' + }); +} + +/** + * 获取打印单 + * @param erpOrderId + * @returns + */ +export const getPrintView = (erpOrderId) => { + return request({ + url: '/zhishu/orderExternalGoods/printView?erpOrderId='+erpOrderId, + method: 'get' + }); +} + +/** + * 获取韵达打印单pdf + * @param erpOrderId + * @param type + * @returns + */ +export const orderCreate = (erpOrderId,fastMailId,printTemplateData,type,erpGoodsId,deliveryMode,orderSn) => { + return request({ + url: '/zhishu/orderExternalGoods/orderCreate', + method: 'get', + params:{ + "erpOrderId":erpOrderId, + "fastMailId":fastMailId, + "printTemplateData":printTemplateData, + "type":type, + "erpGoodsId":erpGoodsId, + "deliveryMode":deliveryMode, + "orderSn":orderSn + } + }); +}; + +/** + * 获取韵达打印单预览pdf + * @param erpOrderId + * @param orderSn + * @param deliveryMode + * @returns + */ +export const getYunDaPreviewPdf = (erpOrderId,orderSn,deliveryMode,printTemplateData) => { + return request({ + url: '/zhishu/orderExternalGoods/getYunDaPreviewPdf', + method: 'get', + params:{ + "erpOrderId":erpOrderId, + "deliveryMode":deliveryMode, + "orderSn":orderSn, + "printTemplateData":printTemplateData + } + }); +} + +export const getU = () => { + return request({ + url: '/zhishu/orderExternalGoods/getU', + method: 'get' + }); +} + +export const submitCompanyOrder = (data) => { + + return request({ + url: '/zhishu/orderExternalGoods/submitCompanyOrder', + method: 'post', + data: data + }); +} + + +export const process = (data) => { + return request({ + url: '/zhishu/orderExternalGoods/process', + method: 'post', + data: data + }); +} + + +/** + * 新增平台订单 + * @param data + */ +export const addOrderExternalGoods = (data: OrderExternalGoodsForm) => { + return request({ + url: '/zhishu/orderExternalGoods', + method: 'post', + data: data + }); +}; + +/** + * 修改平台订单 + * @param data + */ +export const updateOrderExternalGoods = (data: OrderExternalGoodsForm) => { + return request({ + url: '/zhishu/orderExternalGoods', + method: 'put', + data: data + }); +}; + +/** + * 删除平台订单 + * @param id + */ +export const delOrderExternalGoods = (id: string | number | Array) => { + return request({ + url: '/zhishu/orderExternalGoods/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/orderExternalGoods/types.ts b/src/api/zhishu/orderExternalGoods/types.ts new file mode 100644 index 0000000..f88add5 --- /dev/null +++ b/src/api/zhishu/orderExternalGoods/types.ts @@ -0,0 +1,731 @@ +export interface OrderExternalGoodsVO { + /** + * erp订单id(对应Java中的erpOrderId) + */ + id: string | number; + + /** + * 订单编号 + */ + orderSn: string; + + /** + * 平台店铺id + */ + shopId: string | number; + + /** + * erp店铺id + */ + shopErpId: string | number; + + /** + * 店铺类型 + */ + shopType: number; + + /** + * 商品一级id + */ + catId1: string | number; + + /** + * 商品二级id + */ + catId2: string | number; + + /** + * 商品三级id + */ + catId3: string | number; + + /** + * 商品四级id + */ + catId4: string | number; + + /** + * 订单中商品sku列表 + */ + itemList: string; + + /** + * 订单金额 单位:分 + */ + orderTotal: number; + + /** + * 商品金额(以分为单位)商品金额=商品销售价格*商品数量-订单改价折扣金额 + */ + goodsAmount: number; + + /** + * 订单改价折扣金额(以分为单位) + */ + orderChangeAmount: number; + + /** + * 支付金额 (以分为单位) 支付金额=商品金额-折扣金额+邮费+服务费 + */ + payAmount: number; + + /** + * 创建时间 时间戳(对应Java中的erpOrderCreatedAt) + */ + createdAt: number; + + /** + * 成交状态 + */ + confirmStatus: number; + + /** + * 成交时间 时间戳 + */ + confirmAt: number; + + /** + * 支付单号 + */ + payNo: string; + + /** + * 支付时间 时间戳 + */ + payAt: number; + + /** + * 支付方式 + */ + payType: number; + + /** + * 平台优惠金额 (以分为单位) + */ + platformDiscount: number; + + /** + * 买家留言信息 + */ + buyerMemo: string; + + /** + * 发货状态 1:待发货,2:已发货待签收,3:已签收 + */ + orderStatus: number; + + /** + * 物流id + */ + shippingId: string | number; + + /** + * 发货时间 时间戳 + */ + shippingAt: number; + + /** + * 收件地城市 + */ + city: string; + + /** + * 城市编码 + */ + cityId: string | number; + + /** + * 收件地省份 + */ + province: string; + + /** + * 省份编码 + */ + provinceId: string | number; + + /** + * 收件地国家或地区 + */ + country: string; + + /** + * 国家或地区编码 + */ + countryId: string | number; + + /** + * 收件地区县 + */ + town: string; + + /** + * 区县编码 + */ + townId: string | number; + + /** + * 快递单号 + */ + trackingNumber: string; + + /** + * 商家订单备注 + */ + remark: string; + + /** + * 订单备注标记,1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag: number; + + /** + * 订单备注标记名称 + */ + remarkTagName: string; + + /** + * 确认收货时间 + */ + receiveAt: number; + + /** + * 售后状态 + */ + afterSalesStatus: number; + + /** + * 订单最近一次更新时间 + */ + updatedAt: number; + + /** + * 是否可视化 + */ + isShow: number; + + /** + * shop_id的MD5首字母(大写)用于分区 + */ + shopMd5Prefix: string; + + /** + * 是否下发 + */ + isIssue: number; + + /** + * erp的订单售后状态 0 无售后 1 仅退款 2 退货退款 3 处理完成 4 拒绝 5 延后处理 + */ + erpAfterSalesStatus: number; + + /** + * erp订单售后发起时间 + */ + erpAssCreateAt:number; + + /** + * 拒绝原因 + */ + erpAssRemark:string; + + /** + * 退货地址 + */ + erpAssAddress:string; + + /** + * 收件人 + */ + receiverName: string; + + /** + * 收件人名称 + */ + mobile: string; +} + +export interface OrderExternalGoodsForm extends BaseEntity { + /** + * erp订单id(对应Java中的erpOrderId) + */ + id?: string | number; + + /** + * 订单编号 + */ + orderSn?: string; + + /** + * 平台店铺id + */ + shopId?: string | number; + + /** + * erp店铺id + */ + shopErpId?: string | number; + + /** + * 店铺类型 + */ + shopType?: number; + + /** + * 商品一级id + */ + catId1?: string | number; + + /** + * 商品二级id + */ + catId2?: string | number; + + /** + * 商品三级id + */ + catId3?: string | number; + + /** + * 商品四级id + */ + catId4?: string | number; + + /** + * 订单中商品sku列表 + */ + itemList?: string; + + /** + * 订单金额 单位:分 + */ + orderTotal?: number; + + /** + * 商品金额(以分为单位)商品金额=商品销售价格*商品数量-订单改价折扣金额 + */ + goodsAmount?: number; + + /** + * 订单改价折扣金额(以分为单位) + */ + orderChangeAmount?: number; + + /** + * 支付金额 (以分为单位) 支付金额=商品金额-折扣金额+邮费+服务费 + */ + payAmount?: number; + + /** + * 创建时间 时间戳(对应Java中的erpOrderCreatedAt) + */ + createdAt?: number; + + /** + * 成交状态 + */ + confirmStatus?: number; + + /** + * 成交时间 时间戳 + */ + confirmAt?: number; + + /** + * 支付单号 + */ + payNo?: string; + + /** + * 支付时间 时间戳 + */ + payAt?: number; + + /** + * 支付方式 + */ + payType?: number; + + /** + * 平台优惠金额 (以分为单位) + */ + platformDiscount?: number; + + /** + * 买家留言信息 + */ + buyerMemo?: string; + + /** + * 发货状态 1:待发货,2:已发货待签收,3:已签收 + */ + orderStatus?: number; + + /** + * 物流id + */ + shippingId?: string | number; + + /** + * 发货时间 时间戳 + */ + shippingAt?: number; + + /** + * 收件地城市 + */ + city?: string; + + /** + * 城市编码 + */ + cityId?: string | number; + + /** + * 收件地省份 + */ + province?: string; + + /** + * 省份编码 + */ + provinceId?: string | number; + + /** + * 收件地国家或地区 + */ + country?: string; + + /** + * 国家或地区编码 + */ + countryId?: string | number; + + /** + * 收件地区县 + */ + town?: string; + + /** + * 区县编码 + */ + townId?: string | number; + + /** + * 快递单号 + */ + trackingNumber?: string; + + /** + * 商家订单备注 + */ + remark?: string; + + /** + * 订单备注标记,1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag?: number; + + /** + * 订单备注标记名称 + */ + remarkTagName?: string; + + /** + * 确认收货时间 + */ + receiveAt?: number; + + /** + * 售后状态 + */ + afterSalesStatus?: number; + + /** + * 订单最近一次更新时间 + */ + updatedAt?: number; + + /** + * 是否可视化 + */ + isShow?: number; + + /** + * shop_id的MD5首字母(大写)用于分区 + */ + shopMd5Prefix?: string; + + /** + * 是否下发 + */ + isIssue?: number; + + /** + * erp的订单售后状态 0 无售后 1 仅退款 2 退货退款 3 处理完成 4 拒绝 5 延后处理 + */ + erpAfterSalesStatus?: number; + + /** + * erp订单售后发起时间 + */ + erpAssCreateAt?:number; + + /** + * 拒绝原因 + */ + erpAssRemark?:string; + + /** + * 退货地址 + */ + erpAssAddress?:string; + + /** + * 收件人 + */ + receiverName?: string; + + /** + * 收件人名称 + */ + mobile?: string; +} + +export interface OrderExternalGoodsQuery extends PageQuery { + + /** + * 订单编号 + */ + orderSn?: string; + + /** + * 平台店铺id + */ + shopId?: string | number; + + /** + * erp店铺id + */ + shopErpId?: string | number; + + /** + * 店铺类型 + */ + shopType?: number; + + /** + * 商品一级id + */ + catId1?: string | number; + + /** + * 商品二级id + */ + catId2?: string | number; + + /** + * 商品三级id + */ + catId3?: string | number; + + /** + * 商品四级id + */ + catId4?: string | number; + + /** + * 订单中商品sku列表 + */ + itemList?: string; + + /** + * 订单金额 单位:分 + */ + orderTotal?: number; + + /** + * 商品金额(以分为单位)商品金额=商品销售价格*商品数量-订单改价折扣金额 + */ + goodsAmount?: number; + + /** + * 订单改价折扣金额(以分为单位) + */ + orderChangeAmount?: number; + + /** + * 支付金额 (以分为单位) 支付金额=商品金额-折扣金额+邮费+服务费 + */ + payAmount?: number; + + /** + * 创建时间 时间戳(对应Java中的erpOrderCreatedAt) + */ + createdAt?: number; + + /** + * 成交状态 + */ + confirmStatus?: number; + + /** + * 成交时间 时间戳 + */ + confirmAt?: number; + + /** + * 支付单号 + */ + payNo?: string; + + /** + * 支付时间 时间戳 + */ + payAt?: number; + + /** + * 支付方式 + */ + payType?: number; + + /** + * 平台优惠金额 (以分为单位) + */ + platformDiscount?: number; + + /** + * 买家留言信息 + */ + buyerMemo?: string; + + /** + * 发货状态 1:待发货,2:已发货待签收,3:已签收 + */ + orderStatus?: number; + + /** + * 物流id + */ + shippingId?: string | number; + + /** + * 发货时间 时间戳 + */ + shippingAt?: number; + + /** + * 收件地城市 + */ + city?: string; + + /** + * 城市编码 + */ + cityId?: string | number; + + /** + * 收件地省份 + */ + province?: string; + + /** + * 省份编码 + */ + provinceId?: string | number; + + /** + * 收件地国家或地区 + */ + country?: string; + + /** + * 国家或地区编码 + */ + countryId?: string | number; + + /** + * 收件地区县 + */ + town?: string; + + /** + * 区县编码 + */ + townId?: string | number; + + /** + * 快递单号 + */ + trackingNumber?: string; + + /** + * 订单备注标记,1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag?: number; + + /** + * 订单备注标记名称 + */ + remarkTagName?: string; + + /** + * 确认收货时间 + */ + receiveAt?: number; + + /** + * 售后状态 + */ + afterSalesStatus?: number; + + /** + * 订单最近一次更新时间 + */ + updatedAt?: number; + + /** + * 是否可视化 + */ + isShow?: number; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 是否下发 + */ + isIssue?: number; + + /** + * erp的订单售后状态 0 无售后 1 仅退款 2 退货退款 3 处理完成 4 拒绝 5 延后处理 + */ + erpAfterSalesStatus?: number; + + /** + * erp订单售后发起时间 + */ + erpAssCreateAt?:number; + + /** + * 拒绝原因 + */ + erpAssRemark?:string; + + /** + * 退货地址 + */ + erpAssAddress?:string; + + /** + * 收件人 + */ + receiverName?: string; + + /** + * 收件人名称 + */ + mobile?: string; +} diff --git a/src/api/zhishu/pdd/index.ts b/src/api/zhishu/pdd/index.ts new file mode 100644 index 0000000..1960847 --- /dev/null +++ b/src/api/zhishu/pdd/index.ts @@ -0,0 +1,260 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; + +var pageCode = ''; +var pati = ''; + +async function getPageCodeAndPati(mallId) { + try { + // 注意:这里必须 await request + pageCode = await request({ + url: '/huidiao/pdd/getPageCode/'+mallId, + method: 'get' + }); + + await PDD_OPEN_init({ + code: pageCode + }); + + pati = await window.PDD_OPEN_getPati(); + } catch (e) { + console.log(e); + } +} + +async function getPati(){ + await PDD_OPEN_init({ + code: '' + }); + pageCode = ''; + pati = await window.PDD_OPEN_getPati(); + return pati; +} + +/** 获取getPati */ +export function getPatiAndPageCode(){ + getPati(); + return { + "pageCode":"", + "pati":pati + } +} + +// 前往拼多多授权页面 +export function toPddGetCode(id){ + return request({ + url:'/huidiao/pdd/toPddGetCode?id='+id, + method:'get' + }) +} + + +// 获取商品运费模板接口 +export async function getLogisticsTemplate(shopId,mallId){ + await getPageCodeAndPati(mallId); + return request({ + url:'/huidiao/pdd/getLogisticsTemplate/'+shopId, + method:'get', + headers:{ + 'X-PDD-Pati':pati, + 'X-PDD-PageCode':pageCode + } + }) +} + +export async function getCats(){ + await getPati() + return request({ + url:'/huidiao/pdd/getCats', + method:'get', + headers:{ + 'X-PDD-Pati':pati, + 'X-PDD-PageCode':pageCode + } + }) +} + +export async function getSpecs(shopId,mallId){ + await getPageCodeAndPati(mallId); + return request({ + url:'/huidiao/pdd/getSpec/'+shopId, + method:'get', + headers:{ + 'X-PDD-Pati':pati, + 'X-PDD-PageCode':pageCode + } + }) +} + +export async function getShopGoodsList(shopId,isOnsale,isbn,priceDown,priceUp,startDate,endDate,page,pageSize,goodsName,stockDown,stockUp,trilateralId,goodsCode,skuCode){ + return request({ + url:'/huidiao/pdd/getShopGoodsList?shopId='+shopId + +"&isOnsale="+isOnsale + +"&isbn="+isbn + +"&priceDown="+priceDown + +"&priceUp="+priceUp + +"&startDate="+startDate + +"&endDate="+endDate + +"&page="+page + +"&pageSize="+pageSize + +"&goodsName="+goodsName + +"&stockDown="+stockDown + +"&stockUp="+stockUp + +"&trilateralId="+trilateralId + +"&goodsCode="+goodsCode + +"&skuCode="+skuCode + , + method:'get' + }) +} + +export async function delShopGoods(shopId,isOnsale,isbn,priceDown,priceUp,startDate,endDate,page,pageSize){ + return request({ + url:'/huidiao/pdd/delShopGoods?shopId='+shopId+"&isOnsale="+isOnsale+"&isbn="+isbn+"&priceDown="+priceDown+"&priceUp="+priceUp+"&startDate="+startDate+"&endDate="+endDate+"&page="+page+"&pageSize="+pageSize, + method:'get' + }) +} + +export async function getShopGoodsTotalNum(shopId){ + return request({ + url:'/huidiao/pdd/getShopGoodsTotalNum?shopId='+shopId, + method:'get' + }) +} + + + +export async function emportShopGoods(shopId,isOnsale){ + return request({ + url:'/huidiao/pdd/emportShopGoods?shopId='+shopId+"&isOnsale="+isOnsale, + method:'get' + }) +} + +/** + * 整店上架/下架 + * @param shopId + * @returns + */ +export const editShopGoodsAllByIsOnSale = (shopId,isOnSale,isbn,priceDown,priceUp,startDate,endDate,goodsName,stockDown,stockUp,trilateralId,goodsCode,skuCode) => { + return request({ + url: '/huidiao/pdd/editShopGoodsAllByIsOnSale', + params:{ + "shopId":shopId, + "isOnSale":isOnSale, + "isbn":isbn, + "priceDown":priceDown, + "priceUp":priceUp, + "startDate":startDate, + "endDate":endDate, + "goodsName":goodsName, + "stockDown":stockDown, + "stockUp":stockUp, + "trilateralId":trilateralId, + "goodsCode":goodsCode, + "skuCode":skuCode + }, + method: 'post' + }); +}; + + + + +export async function createShopGoodsList(shopId,sycFlag){ + return request({ + url:'/huidiao/pdd/createShopGoodsList?shopId='+shopId+"&sycFlag="+sycFlag, + method:'get' + }) +} + +export async function createShopGoodsDetailList(shopId){ + return request({ + url:'/huidiao/pdd/createShopGoodsDetailList?shopId='+shopId, + method:'get' + }) +} + +export async function createShopGoodsmovie(shopId,targetShopIds){ + return request({ + url:'/huidiao/pdd/createShopGoodsmovie?shopId='+shopId+"&targetShopIds="+targetShopIds, + method:'get' + }) +} + + + +export async function checkFile(shopId){ + return request({ + url:'/huidiao/pdd/checkFile?shopId='+shopId, + method:'get' + }) +} + + + +/** + * 下架重复商品 + */ +export const batchSetSoldOut = (shopId) => { + return request({ + url: '/huidiao/pdd/batchSetSoldOut/'+shopId, + method: 'post' + }); +}; + +/** + * 批量翻新上架商品(通过CSV文件) + * @param file 上传的文件 + * @param shopId 店铺ID + */ +export const batchRenovateOnSaleByCsv = (file: File, shopId: string): AxiosPromise => { + const formData = new FormData(); + formData.append('file', file); + return request({ + url: '/huidiao/pdd/batchRenovateOnSaleByCsv?shopId=' + shopId, + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + + +/** + * 授权码授权登录 + */ +export const tokenLogin = (code) => { + return request({ + url:'/huidiao/pdd/tokenSq?code='+code, + method:'get' + }) + +}; + +/** + * 校验 + * @param shopId 店铺ID + * @returns + */ +export function checkPriceTemplate(shopId) { + return request({ + url: '/huidiao/pdd/checkPriceTemplate', + method: 'get', + params: { shopId } + }); +} + + +/** + * pdd续拉 + * @param shopId 店铺ID + * @returns + */ +export function continueGetGoodsTask(taskId,shopId) { + return request({ + url: '/huidiao/pdd/continueGetGoodsTask?taskId='+taskId+"&shopId="+shopId, + method: 'get' + }); +} diff --git a/src/api/zhishu/priceTemplate/index.ts b/src/api/zhishu/priceTemplate/index.ts new file mode 100644 index 0000000..a947e57 --- /dev/null +++ b/src/api/zhishu/priceTemplate/index.ts @@ -0,0 +1,71 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { PriceTemplateVO, PriceTemplateForm, PriceTemplateQuery } from '@/api/zhishu/priceTemplate/types'; + +/** + * 查询价格模板列表 + * @param query + * @returns {*} + */ + +export const listPriceTemplate = (query?: PriceTemplateQuery): AxiosPromise => { + return request({ + url: '/zhishu/priceTemplate/list', + method: 'get', + params: query + }); +}; + +export const listNoPage = (query?: PriceTemplateQuery): AxiosPromise => { + return request({ + url: '/zhishu/priceTemplate/listNoPage', + method: 'get', + params: query + }); +}; + +/** + * 查询价格模板详细 + * @param id + */ +export const getPriceTemplate = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/priceTemplate/' + id, + method: 'get' + }); +}; + +/** + * 新增价格模板 + * @param data + */ +export const addPriceTemplate = (data: PriceTemplateForm) => { + return request({ + url: '/zhishu/priceTemplate', + method: 'post', + data: data + }); +}; + +/** + * 修改价格模板 + * @param data + */ +export const updatePriceTemplate = (data: PriceTemplateForm) => { + return request({ + url: '/zhishu/priceTemplate', + method: 'put', + data: data + }); +}; + +/** + * 删除价格模板 + * @param id + */ +export const delPriceTemplate = (id: string | number | Array) => { + return request({ + url: '/zhishu/priceTemplate/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/priceTemplate/types.ts b/src/api/zhishu/priceTemplate/types.ts new file mode 100644 index 0000000..75fe035 --- /dev/null +++ b/src/api/zhishu/priceTemplate/types.ts @@ -0,0 +1,134 @@ +export interface PriceTemplateVO { + /** + * 主键 + */ + id: string | number; + + /** + * 价格模板名称 + */ + templateName: string; + + /** + * 价格类型 0 书价 1 总价(书价+运费) + */ + priceType: string; + + /** + * 增加比例 + */ + proportion: number; + + /** + * 增加金额 + */ + addAmount: number; + + /** + * 价格模板状态(0正常 1停用) + */ + status: string; + + /** + * 价格参数 + */ + priceAdjustments?: { + minPrice?: number; + maxPrice?: number; + adjustPercent?: number; + adjustAmount?: number; + }[]; + +} + +export interface PriceTemplateForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 价格模板名称 + */ + templateName?: string; + + /** + * 价格类型 0 书价 1 总价(书价+运费) + */ + priceType?: string; + + /** + * 增加比例 + */ + proportion?: number; + + /** + * 增加金额 + */ + addAmount?: number; + + /** + * 价格模板状态(0正常 1停用) + */ + status?: string; + + /** + * 高价 + */ + highPrice?:number; + /** + * 低价 + */ + lowPrice?:number; + + /** + * 价格参数 + */ + priceAdjustments?: { + minPrice?: number; + maxPrice?: number; + adjustPercent?: number; + adjustAmount?: number; + }[]; + + /** + * 传递的价格参数 + */ + rangePrice?:string; +} + +export interface PriceTemplateQuery extends PageQuery { + + /** + * 价格模板名称 + */ + templateName?: string; + + /** + * 价格类型 0 书价 1 总价(书价+运费) + */ + priceType?: string; + + /** + * 增加比例 + */ + proportion?: number; + + /** + * 增加金额 + */ + addAmount?: number; + + /** + * 价格模板状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/zhishu/printTemplate/index.ts b/src/api/zhishu/printTemplate/index.ts new file mode 100644 index 0000000..26f0bdb --- /dev/null +++ b/src/api/zhishu/printTemplate/index.ts @@ -0,0 +1,71 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { PrintTemplateVO, PrintTemplateForm, PrintTemplateQuery } from '@/api/zhishu/printTemplate/types'; + +/** + * 查询打印模板列表 + * @param query + * @returns {*} + */ + +export const listPrintTemplate = (query?: PrintTemplateQuery): AxiosPromise => { + return request({ + url: '/zhishu/printTemplate/list', + method: 'get', + params: query + }); +}; + +export const listPrintTemplateNoPage = (query?: PrintTemplateQuery): AxiosPromise => { + return request({ + url: '/zhishu/printTemplate/listNoPage', + method: 'get', + params: query + }); +}; + +/** + * 查询打印模板详细 + * @param id + */ +export const getPrintTemplate = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/printTemplate/' + id, + method: 'get' + }); +}; + +/** + * 新增打印模板 + * @param data + */ +export const addPrintTemplate = (data: PrintTemplateForm) => { + return request({ + url: '/zhishu/printTemplate', + method: 'post', + data: data + }); +}; + +/** + * 修改打印模板 + * @param data + */ +export const updatePrintTemplate = (data: PrintTemplateForm) => { + return request({ + url: '/zhishu/printTemplate', + method: 'put', + data: data + }); +}; + +/** + * 删除打印模板 + * @param id + */ +export const delPrintTemplate = (id: string | number | Array) => { + return request({ + url: '/zhishu/printTemplate/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/printTemplate/types.ts b/src/api/zhishu/printTemplate/types.ts new file mode 100644 index 0000000..5f8db03 --- /dev/null +++ b/src/api/zhishu/printTemplate/types.ts @@ -0,0 +1,97 @@ +export interface PrintTemplateVO { + /** + * + */ + id: string | number; + + /** + * 快递类型 + */ + expressType: string; + + /** + * 模板名称 + */ + printTemplateName: string; + + /** + * 更新时间 + */ + updateTime: string; + + /** + * 0正常 1停用 + */ + status: string; + + /** + * 包裹信息json字符串 + */ + parcelInformation: string; + + createBy: string; + +} + +export interface PrintTemplateForm extends BaseEntity { + /** + * + */ + id?: string | number; + + + /** + * 快递类型 + */ + expressType?: string; + + /** + * 模板名称 + */ + printTemplateName?: string; + + /** + * 0正常 1停用 + */ + status?: string; + + /** + * 包裹信息json字符串 + */ + parcelInformation?: string; + + createBy?: string; +} + +export interface PrintTemplateQuery extends PageQuery { + + /** + * 模板名称 + */ + printTemplateName?: string; + + /** + * 快递类型 + */ + expressType?: string; + + /** + * 0正常 1停用 + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 包裹信息json字符串 + */ + parcelInformation?: string; + + createBy?: string; +} + + + diff --git a/src/api/zhishu/printer/index.ts b/src/api/zhishu/printer/index.ts new file mode 100644 index 0000000..74ee42e --- /dev/null +++ b/src/api/zhishu/printer/index.ts @@ -0,0 +1,89 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { PrinterVO, PrinterForm, PrinterQuery } from '@/api/zhishu/printer/types'; + +/** + * 查询打印机设置列表 + * @param query + * @returns {*} + */ +export const listPrinter = (query?: PrinterQuery): AxiosPromise => { + return request({ + url: '/zhishu/printer/list', + method: 'get', + params: query + }); +}; + +/** + * 查询打印机设置列表 + * @param query + * @returns {*} + */ +export const listPrinterNoPage = (query?: PrinterQuery): AxiosPromise => { + return request({ + url: '/zhishu/printer/listNoPage', + method: 'get', + params: query + }); +}; + +/** + * 获取拼多多云打印机验证码 + * @param query + * @returns + */ +export const getCaptcha = (query?: PrinterQuery): AxiosPromise => { + return request({ + url: '/zhishu/printer/getCaptcha', + method: 'get', + params: query + }); +}; + + +/** + * 查询打印机设置详细 + * @param id + */ +export const getPrinter = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/printer/' + id, + method: 'get' + }); +}; + +/** + * 新增打印机设置 + * @param data + */ +export const addPrinter = (data: PrinterForm) => { + return request({ + url: '/zhishu/printer', + method: 'post', + data: data + }); +}; + +/** + * 修改打印机设置 + * @param data + */ +export const updatePrinter = (data: PrinterForm) => { + return request({ + url: '/zhishu/printer', + method: 'put', + data: data + }); +}; + +/** + * 删除打印机设置 + * @param id + */ +export const delPrinter = (id: string | number | Array) => { + return request({ + url: '/zhishu/printer/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/printer/types.ts b/src/api/zhishu/printer/types.ts new file mode 100644 index 0000000..eb82cbc --- /dev/null +++ b/src/api/zhishu/printer/types.ts @@ -0,0 +1,146 @@ +export interface PrinterVO { + /** + * + */ + id: string | number; + +/** + * 打印机类型 1 本地打印机 2 拼多多云打印机 + */ + printType: string; + +/** + * 拼多多云打印机共享码 + */ + shareCode: string; + + /** + * 打印机 + */ + printer: string; + + /** + * 打印机名称 + */ + printerName: string; + + /** + * 是否启用全程打印 + */ + isRemotePrinting: string; + + /** + * 0正常 1停用 + */ + status: string; + + /** + * 验证码 + */ + captcha: string; + + accessToken: string; + +} + +export interface PrinterForm extends BaseEntity { + /** + * + */ + id?: string | number; + + + /** + * 打印机类型 1 本地打印机 2 拼多多云打印机 + */ + printType?: string; + +/** + * 拼多多云打印机共享码 + */ + shareCode?: string; + + /** + * 打印机 + */ + printer?: string; + + /** + * 打印机名称 + */ + printerName?: string; + + /** + * 是否启用全程打印 + */ + isRemotePrinting?: string; + + /** + * 0正常 1停用 + */ + status?: string; + + + /** + * 验证码 + */ + captcha?: string; + + accessToken?: string; + +} + +export interface PrinterQuery extends PageQuery { + + + /** + * 打印机类型 1 本地打印机 2 拼多多云打印机 + */ + printType?: string; + +/** + * 拼多多云打印机共享码 + */ + shareCode?: string; + + /** + * 打印机 + */ + printer?: string; + + /** + * 打印机名称 + */ + printerName?: string; + + /** + * 是否启用全程打印 + */ + isRemotePrinting?: string; + + /** + * 更新时间 + */ + updateTime?: string; + + /** + * 0正常 1停用 + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + + /** + * 验证码 + */ + captcha?: string; + + accessToken?: string; +} + + + diff --git a/src/api/zhishu/product/index.ts b/src/api/zhishu/product/index.ts new file mode 100644 index 0000000..4e2c564 --- /dev/null +++ b/src/api/zhishu/product/index.ts @@ -0,0 +1,44 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { SinglePrintVO, SinglePrintForm, SinglePrintQuery } from './types'; + + + +/** + * + * @param query + * @returns {*} + */ +export const listMapping = () => { + return request({ + url: '/zhishu/product/getMappingList', + method: 'get' + }); +}; + + +/** + * 查新商品 + * @param query + * @returns {*} + */ +export const listProduct = (query) => { + return request({ + url: '/zhishu/product/list', + method: 'get', + params: query + }); +}; + +/** + * 发布商品 + * @param data + * @returns + */ +export const releaseGoods = (data) => { + return request({ + url: '/zhishu/product/releaseGoods', + method: 'post', + data: data + }); +}; diff --git a/src/api/zhishu/profitSharingLog/index.ts b/src/api/zhishu/profitSharingLog/index.ts new file mode 100644 index 0000000..059e35e --- /dev/null +++ b/src/api/zhishu/profitSharingLog/index.ts @@ -0,0 +1,17 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ProfitSharingLogVO, ProfitSharingLogForm, ProfitSharingLogQuery } from '@/api/zhishu/profitSharingLog/types'; + +/** + * 查询平台订单列表 + * @param query + * @returns {*} + */ + +export const listProfitSharingLog = (query?: ProfitSharingLogQuery): AxiosPromise => { + return request({ + url: '/zhishu/profitSharingLog/list', + method: 'get', + params: query + }); +}; diff --git a/src/api/zhishu/profitSharingLog/types.ts b/src/api/zhishu/profitSharingLog/types.ts new file mode 100644 index 0000000..e812831 --- /dev/null +++ b/src/api/zhishu/profitSharingLog/types.ts @@ -0,0 +1,277 @@ +/** + * 分润记录 VO + * 对应Java中的 ProfitSharingLog 实体类 + */ +export interface ProfitSharingLogVO { + /** + * 主键ID + */ + id: number; + + /** + * 订单ID + */ + orderId: number; + + /** + * 订单编号 + */ + orderSn: string; + + /** + * 分润规则ID + */ + cfgId: number; + + /** + * 状态 0-待出款 1-已出款 + */ + status: number; + + /** + * 分润受益方ID(平台 商家 上级) + */ + beneficiaryId: number; + + /** + * 分润受益方名字 + */ + beneficiaryName: string; + + /** + * 计算基准金额(单位:分) + */ + calcBaseAmount: number; + + /** + * 分润比例 + */ + shareRate: number; + + /** + * 分润金额(单位:分) + */ + shareAmount: number; + + /** + * 结算时间戳(毫秒) + */ + settlementTime: number; + + /** + * 账期(例如202509,用于按月度对账) + */ + accountingPeriod: number; + + /** + * 创建时间戳(毫秒) + */ + createdTime: number; + + /** + * 创建人ID + */ + createdBy: number; + + /** + * 更新时间戳(毫秒) + */ + updatedTime: number; + + /** + * 更新人ID + */ + updatedBy: number; + + /** + * 是否启用 0-启用 1-禁用 + */ + isDel: number; +} + +/** + * 分润记录 Form + * 用于表单提交/数据编辑 + */ +export interface ProfitSharingLogForm extends BaseEntity { + /** + * 主键ID + */ + id?: number; + + /** + * 订单ID + */ + orderId?: number; + + /** + * 订单编号 + */ + orderSn?: string; + + /** + * 分润规则ID + */ + cfgId?: number; + + /** + * 状态 0-待出款 1-已出款 + */ + status?: number; + + /** + * 分润受益方ID(平台 商家 上级) + */ + beneficiaryId?: number; + + /** + * 分润受益方名字 + */ + beneficiaryName?: string; + + /** + * 计算基准金额(单位:分) + */ + calcBaseAmount?: number; + + /** + * 分润比例 + */ + shareRate?: number; + + /** + * 分润金额(单位:分) + */ + shareAmount?: number; + + /** + * 结算时间戳(毫秒) + */ + settlementTime?: number; + + /** + * 账期(例如202509,用于按月度对账) + */ + accountingPeriod?: number; + + /** + * 创建时间戳(毫秒) + */ + createdTime?: number; + + /** + * 创建人ID + */ + createdBy?: number; + + /** + * 更新时间戳(毫秒) + */ + updatedTime?: number; + + /** + * 更新人ID + */ + updatedBy?: number; + + /** + * 是否启用 0-启用 1-禁用 + */ + isDel?: number; +} + +/** + * 分润记录 Query + * 用于分页查询/条件筛选 + */ +export interface ProfitSharingLogQuery extends PageQuery { + /** + * 订单ID + */ + orderId?: number; + + /** + * 订单编号 + */ + orderSn?: string; + + /** + * 分润规则ID + */ + cfgId?: number; + + /** + * 状态 0-待出款 1-已出款 + */ + status?: number; + + /** + * 分润受益方ID(平台 商家 上级) + */ + beneficiaryId?: number; + + /** + * 分润受益方名字 + */ + beneficiaryName?: string; + + /** + * 账期(例如202509,用于按月度对账) + */ + accountingPeriod?: number; + + /** + * 是否启用 0-启用 1-禁用 + */ + isDel?: number; + + /** + * 日期范围参数 + */ + params?: any; +} + +// 补充基础类型定义(如果项目中已有可删除) +/** + * 基础实体类型 + */ +interface BaseEntity { + /** + * 创建人 + */ + createBy?: string | number; + /** + * 创建时间 + */ + createTime?: number; + /** + * 更新人 + */ + updateBy?: string | number; + /** + * 更新时间 + */ + updateTime?: number; +} + +/** + * 分页查询基础参数 + */ +interface PageQuery { + /** + * 当前页码 + */ + pageNum?: number; + /** + * 每页条数 + */ + pageSize?: number; + /** + * 排序字段 + */ + orderByColumn?: string; + /** + * 排序方式(asc/desc) + */ + isAsc?: string; +} \ No newline at end of file diff --git a/src/api/zhishu/service/index.ts b/src/api/zhishu/service/index.ts new file mode 100644 index 0000000..6794898 --- /dev/null +++ b/src/api/zhishu/service/index.ts @@ -0,0 +1,36 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ShelvesVO } from '@/api/zhishu/shelves/types'; +import { FreightVO } from '@/api/zhishu/freight/types'; + + + +export const getAllServices = (type) => { + return request({ + url: '/service/getAllServices?type='+type, + method: 'get' + }); +}; + +export const payServiceSuccess = (wxPayOrderId,shopId,serviceId,type) => { + return request({ + url: '/service/payServiceSuccess', + method: 'post', + params: { + wxPayOrderId, + shopId, + serviceId, + type + } + }); +}; + +export const payServiceXySuccess = (wxPayOrderId) => { + return request({ + url: '/service/payServiceXySuccess', + method: 'post', + params: { + wxPayOrderId + } + }); +} diff --git a/src/api/zhishu/shelves/index.ts b/src/api/zhishu/shelves/index.ts new file mode 100644 index 0000000..0b66731 --- /dev/null +++ b/src/api/zhishu/shelves/index.ts @@ -0,0 +1,83 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ShelvesVO, ShelvesForm, ShelvesQuery } from '@/api/zhishu/shelves/types'; +import { DepotVO } from '@/api/zhishu/depot/types'; + +/** + * 查询货架信息列表 + * @param query + * @returns {*} + */ + +export const listShelves = (query?: ShelvesQuery): AxiosPromise => { + return request({ + url: '/shelves/shelves/list', + method: 'get', + params: query + }); +}; + +/** + * 查询货架信息详细 + * @param id + */ +export const getShelves = (id: string | number): AxiosPromise => { + return request({ + url: '/shelves/shelves/' + id, + method: 'get' + }); +}; + +/** + * 本地回显用查询货架信息详细 + * @param id + */ +export const getShelvesForLocal = (depotId: string | number, code: string | number): AxiosPromise => { + return request({ + url: '/shelves/shelves/forLocal/' + depotId + '/' + code, + method: 'get' + }); +}; + +/** + * 新增货架信息 + * @param data + */ +export const addShelves = (data: ShelvesForm) => { + return request({ + url: '/shelves/shelves', + method: 'post', + data: data + }); +}; + +/** + * 修改货架信息 + * @param data + */ +export const updateShelves = (data: ShelvesForm) => { + return request({ + url: '/shelves/shelves', + method: 'put', + data: data + }); +}; + +/** + * 删除货架信息 + * @param id + */ +export const delShelves = (id: string | number | Array) => { + return request({ + url: '/shelves/shelves/' + id, + method: 'delete' + }); +}; + + +export const depotNameList = (): AxiosPromise => { + return request({ + url: '/shelves/shelves/namelist', + method: 'get' + }); +}; diff --git a/src/api/zhishu/shelves/types.ts b/src/api/zhishu/shelves/types.ts new file mode 100644 index 0000000..1c615b0 --- /dev/null +++ b/src/api/zhishu/shelves/types.ts @@ -0,0 +1,134 @@ +export interface ShelvesVO { + /** + * 货架id + */ + id: string | number; + + /** + * 货架名称 + */ + name: string; + + + /** + * 单位 + */ + unit: string; + + /** + * 货架容量 + */ + sheCapMax: number; + + /** + * 货架状态(0正常 1停用) + */ + status: string; + + /** + * 货架编码 + */ + code: string; + + /** + * 仓库名称 + */ + depotName: string; + + + +} + +export interface ShelvesForm extends BaseEntity { + /** + * 货架id + */ + id?: string | number; + + /** + * 货架名称 + */ + name?: string; + + /** + * 单位 + */ + unit?: string; + + + /** + * 货架容量 + */ + sheCapMax?: number; + + /** + * 仓库id + */ + depotId?: string | number; + + /** + * 货架状态(0正常 1停用) + */ + status?: string; + + /** + * 货架编码 + */ + code?: string; + + /** + * 仓库名称 + */ + depotName?: string; + /** + * 是否有下一级 + */ + hasChildren?:boolean; + + /** + * 层级 + */ + level:number; + +} + +export interface ShelvesQuery extends PageQuery { + + /** + * 货架名称 + */ + name?: string; + + /** + * 单位 + */ + unit?: string; + + /** + * 货架容量 + */ + sheCapMax?: number; + + /** + * 货架状态(0正常 1停用) + */ + status?: string; + + /** + * 货架编码 + */ + code?: string; + + /** + * 仓库名称 + */ + depotName?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/zhishu/shop/index.ts b/src/api/zhishu/shop/index.ts new file mode 100644 index 0000000..a0c122e --- /dev/null +++ b/src/api/zhishu/shop/index.ts @@ -0,0 +1,338 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ShopVO, ShopForm, ShopQuery, saveArtNo, WlnShopList, EncrypData, ShopMap } from '@/api/zhishu/shop/types'; +import { ShelvesVO } from '@/api/zhishu/shelves/types'; +import { FreightVO } from '@/api/zhishu/freight/types'; +import { CategoryVO } from '@/api/workflow/category/types'; +import { XyCategoryVo } from '@/api/zhishu/xyCategory/types'; + +/** + * 查询店铺主表列表 + * @param query + * @returns {*} + */ + +export const listShop = (query?: ShopQuery): AxiosPromise => { + return request({ + url: '/zhishu/shop/list', + method: 'get', + params: query + }); +}; + +export const listShopInvite = (query?: ShopQuery): AxiosPromise => { + return request({ + url: '/zhishu/shop/inviteList', + method: 'get', + params: query + }); +}; + +export const limitedTimeFree = (id,priceStr) =>{ + return request({ + url: '/zhishu/shop/limitedTimeFree', + method: 'get', + params: { + "id":id, + "priceStr":priceStr + } + }); +} + +/** + * 查询店铺数据集合 + * @returns + */ +export const getListShop = () => { + return request({ + url: '/zhishu/shop/getList', + method: 'get' + }); +}; + +/** + * 获取商品核价文件下载链接 + * @returns + */ +export const getVerifyPriceUrl = (shopId) => { + return request({ + url: '/huidiao/pdd/getVerifyPriceUrl?shopId=' + shopId, + method: 'get' + }); +}; + +/** + * 查询店铺主表详细 + * @param id + */ +export const getShop = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/shop/' + id, + method: 'get' + }); +}; + +/** + * 根据店铺类型查询店铺列表 + * @param type + */ +export const getTypeShopList = (type: string): AxiosPromise => { + return request({ + url: '/zhishu/shop/type/' + type, + method: 'get' + }); +}; + +/** + * 新增店铺主表 + * @param data + */ +export const addShop = (data: ShopForm) => { + return request({ + url: '/zhishu/shop', + method: 'post', + data: data + }); +}; + +/** + * 修改店铺主表 + * @param data + */ +export const updateShop = (data: ShopForm) => { + return request({ + url: '/zhishu/shop', + method: 'put', + data: data + }); +}; + +/** + * 删除店铺主表 + * @param id + */ +export const delShop = (id: string | number | Array) => { + return request({ + url: '/zhishu/shop/' + id, + method: 'delete' + }); +}; + +// 前往拼多多授权页面 +export function toPddGetCode(id) { + return request({ + url: '/huidiao/pdd/toPddGetCode?id=' + id, + method: 'get' + }); +} + +var pageCode = ''; +var pati = ''; + +async function getPageCodeAndPati(mallId) { + try { + // 注意:这里必须 await request + pageCode = await request({ + url: '/huidiao/pdd/getPageCode/' + mallId, + method: 'get' + }); + + await PDD_OPEN_init({ + code: pageCode + }); + + pati = await window.PDD_OPEN_getPati(); + } catch (e) { + console.log(e); + } +} + +// 获取商品运费模板接口 +export async function getLogisticsTemplate(shopId, mallId) { + await getPageCodeAndPati(mallId); + return request({ + url: '/huidiao/pdd/getLogisticsTemplate/' + shopId, + method: 'get', + headers: { + 'X-PDD-Pati': pati, + 'X-PDD-PageCode': pageCode + } + }); +} + +// 前往孔夫子授权页面 +export function toKongfzGetCode(id) { + return request({ + url: '/api/kongfz/toKongfzGetCode?id=' + id, + method: 'get' + }); +} + +export function synchronizationGoods(shopId: number | string, shopType: number) { + return request({ + url: '/zhishu/shopGoods/synchronizationGoods', + method: 'get', + params: { + shopId, + shopType + } + }); +} + +export const artNoRuleSave = (data: saveArtNo) => { + return request({ + url: '/zhishu/shopGoods/saveShopGoodsInDb', + method: 'post', + data: data + }); +}; + +export const getShe = (id: string | number): AxiosPromise => { + return request({ + url: '/shelves/shelves/sheNamelist/' + id, + method: 'get' + }); +}; + +export const getFre = (id: string | number): AxiosPromise => { + return request({ + url: '/shelves/shelves/freNamelist/' + id, + method: 'get' + }); +}; + +//获取万里牛店铺列表 +export const getWlnShopList = (page: number, limit: number, shopId: number, shopNick: string): AxiosPromise => { + return request({ + url: '/zhishu/shop/getWlnShopList', + method: 'get', + params: { + // 关键修改:将参数放在params中 + page, + limit, + shopId, + shopNick + } + }); +}; + +//万里牛店铺授权 +export const authorizationWln = async (shopId: number, shopName: string, shopNick: string): AxiosPromise => { + return request({ + url: '/zhishu/shop/authorizationWln', + method: 'get', + params: { + shopId, + shopName, + shopNick + } + }); +}; + +/** + * 加密接口 + * @param data + */ +export const encrypUrlMenthod = async (data: EncrypData): AxiosPromise => { + return request({ + url: '/zhishu/shop/encryption', + method: 'post', + data: data + }); +}; + +/** + * 升级店铺 + */ +export const updateShopSkuSpec = async (shopId, type) => { + return request({ + url: '/zhishu/shop/updateShopSkuSpec?shopId=' + shopId + '&type=' + type, + method: 'get' + }); +}; + +// 绑定仓库接口 +export const bindDepotToShop = (data: { shopId: number; depotId: number }) => { + return request({ + url: '/zhishu/shop/bindDepot', + method: 'post', + data: data + }); +}; + +// 获取店铺绑定的仓库 +export const getShopDepot = (shopId: number) => { + return request({ + url: '/zhishu/shop/getShopDepot/' + shopId, + method: 'get' + }); +}; + +/** + * 选品中心开通 + * @param userId 用户ID + * @param type 开通类型 1-页面开通 2-高级搜索开通 + */ +export const dredgeCenterBook = (userId: number, type: number) => { + return request({ + url: '/zhishu/shop/dredgeCenterBook', + method: 'post', + params: { + userId, + type + } + }); +}; + +/** + * 查询正在执行任务的店铺 + * @returns + */ +export const getRunningShopList = (taskType) => { + return request({ + url: '/zhishu/shop/getRunningShopList?taskType='+taskType, + method: 'get' + }); +}; + +/** + * 获取任务池状态 + * @param taskType + * @returns + */ +export const getJavaTaskPoolStatus = () => { + return request({ + url: '/zhishu/shop/getJavaTaskPoolStatus', + method: 'get' + }); +} + +/** + * 获取今日商品状态 + */ +export const getTodayGoods = () => { + return request({ + url: '/zhishu/shop/todayGoods', + method: 'get' + }); +} + +/** + * 获取今日商品状态 + */ +export const getTodaySales = () => { + return request({ + url: '/zhishu/shop/todaySales', + method: 'get' + }); +} + +/** + * 获取闲鱼店铺类目 + */ +export const getXyCategoryList = (): AxiosPromise => { + return request({ + url: '/zhishu/shop/getXyCategoryList', + method: 'get' + }); +} diff --git a/src/api/zhishu/shop/types.ts b/src/api/zhishu/shop/types.ts new file mode 100644 index 0000000..803a74a --- /dev/null +++ b/src/api/zhishu/shop/types.ts @@ -0,0 +1,700 @@ +export interface ShopVO { + /** + * + */ + id: string | number; + + /** + * 应用店铺ID + */ + mallId: string | number; + + /** + * 店铺类型 1 拼多多 + */ + shopType: string; + + /** + * 分组 + */ + shopGroup: string; + + /** + * 店铺名称 + */ + shopName: string; + + /** + * 是否授权 0未授权 1已授权 2已过期 + */ + shopAuthorize: string; + + /** + * 到期时间 + */ + expirationTime: string; + + /** + * 店铺key + */ + shopKey: string; + + /** + * token + */ + token: string; + + /** + * 店铺状态(0正常 1停用) + */ + status: string; + + /** + * 第三方平台账号 + */ + account: string; + + /** + * 第三方平台密码 + */ + password: string; + + /** + * 自动发布 + */ + autoAdd: string; + + /** + * 是否同步订单(0关闭 1开启) + */ + isSynOrder: string; + + /** + * 授权码 + */ + code: string; + + /** + * erp到期时间 + */ + shopExpirationTime: string; + + /** + * erp是否到期 + */ + isExpiration: string; + + /** + * 订购时间 (月份) + */ + payMonth: string; +} + +export interface ShopForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 店铺类型 1 拼多多 + */ + shopType?: string; + + /** + * 分组 + */ + shopGroup?: string; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 是否授权 0未授权 1已授权 2已过期 + */ + shopAuthorize?: string; + + /** + * 到期时间 + */ + expirationTime?: string; + + /** + * 店铺key + */ + shopKey?: string; + + /** + * token + */ + token?: string; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + + /** + * 第三方平台账号 + */ + account?: string; + + /** + * 第三方平台密码 + */ + password?: string; + + /** + * 是否存在待同步商品文件 + */ + hasSyncFile?: string; + + /** + * 是否同步订单(0关闭 1开启) + */ + isSynOrder?: string; + + /** + * 授权码 + */ + code?: string; + + /** + * erp到期时间 + */ + shopExpirationTime: string; + + /** + * erp是否到期 + */ + isExpiration: string; + + /** + * 订购时间 (月份) + */ + payMonth?: string; +} + +export interface ShopQuery extends PageQuery { + /** + * 店铺类型 1 拼多多 + */ + shopType?: string; + + /** + * 分组 + */ + shopGroup?: string; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 是否授权 0未授权 1已授权 2已过期 + */ + shopAuthorize?: string; + + /** + * 到期时间 + */ + expirationTime?: string; + + /** + * 店铺key + */ + shopKey?: string; + + /** + * token + */ + token?: string; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + /** + * 第三方平台账号 + */ + account?: string; + + /** + * 第三方平台密码 + */ + password?: string; + /** + * 是否存在待同步商品文件 + */ + hasSyncFile?: string; + + /** + * 授权码 + */ + code?: string; + + /** + * erp到期时间 + */ + shopExpirationTime: string; + + /** + * erp是否到期 + */ + isExpiration: string; + + /** + * 订购时间 (月份) + */ + payMonth?: string; +} + +export interface ShopDetailVO { + /** + * 主键 + */ + id: string | number; + + /** + * 店铺id + */ + shopId: string | number; + + /** + * 物流运费模板id + */ + templateId: string | number; + + /** + * 高价 + */ + highPrice: number; + + /** + * 低价 + */ + lowPrice: number; + + /** + * 销售模板id + */ + saleTemplateId: string | number; + + /** + * 是否开启7天无理由 0关闭 1开启 + */ + + sevenDays: string; + + /** + * 是否开始二手 0关闭 1开启 + */ + isSecondHand: string; + + /** + * 轮播数量开启 0关闭 1开启 + */ + carouselNum: string; + + /** + * 是否开启详情图 0关闭 1开启 + */ + isDetailsImg: string; + + /** + * 是否开启目录详情 0关闭 1开启 + */ + isCatalogueDetails: string; + + /** + * 是否开启信息图片 0关闭 1开启 + */ + isInformationImg: string; + + /** + * 标题前缀 + */ + titlePrefix: string; + + /** + * 标题后缀 + */ + titleSuffix: string; + + /** + * 标题过滤 + */ + titleFilter: string; + + /** + * 货号前缀 + */ + itemNumberPrefix: string; + + /** + * 标题组成 + */ + titleConsistOf: string; + + /** + * 间隔字符 0无间隔 1空格 + */ + spaceCharacter: string; + + /** + * 是否开启自动截断 0关闭 1开启 + */ + autoTruncation: string; + + /** + * 我的设置 + */ + mySetUp: string; + + /** + * 系统设置 + */ + systemSetUp: string; + + /** + * 过滤套装 0否 1是 + */ + filterSuit: string; + + /** + * 删除保护 0关闭 1开启 + */ + isDelProtect: string; + + /** + * 下架保护 0关闭 1开启 + */ + isRemoveProtect: string; + + /** + * 图书定价 0关闭 1开启 + */ + bootPrice: string; + + /** + * 自有图片 0关闭 1开启 + */ + ownPictures: string; + + /** + * 商品描述 + */ + context: string; +} + +export interface ShopDetailForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 物流运费模板id + */ + templateId?: string | number; + + /** + * 高价 + */ + highPrice?: number; + + /** + * 低价 + */ + lowPrice?: number; + + /** + * 销售模板id + */ + saleTemplateId?: string | number; + + /** + * 是否开启7天无理由 0关闭 1开启 + */ + + sevenDays?: string; + + /** + * 是否开始二手 0关闭 1开启 + */ + isSecondHand?: string; + + /** + * 轮播数量开启 0关闭 1开启 + */ + carouselNum?: string; + + /** + * 是否开启详情图 0关闭 1开启 + */ + isDetailsImg?: string; + + /** + * 是否开启目录详情 0关闭 1开启 + */ + isCatalogueDetails?: string; + + /** + * 是否开启信息图片 0关闭 1开启 + */ + isInformationImg?: string; + + /** + * 标题前缀 + */ + titlePrefix?: string; + + /** + * 标题后缀 + */ + titleSuffix?: string; + + /** + * 标题过滤 + */ + titleFilter?: string; + + /** + * 货号前缀 + */ + itemNumberPrefix?: string; + + /** + * 标题组成 + */ + titleConsistOf?: string; + + /** + * 间隔字符 0无间隔 1空格 + */ + spaceCharacter?: string; + + /** + * 是否开启自动截断 0关闭 1开启 + */ + autoTruncation?: string; + + /** + * 我的设置 + */ + mySetUp?: string; + + /** + * 系统设置 + */ + systemSetUp?: string; + + /** + * 过滤套装 0否 1是 + */ + filterSuit?: string; + + /** + * 删除保护 0关闭 1开启 + */ + isDelProtect?: string; + + /** + * 下架保护 0关闭 1开启 + */ + isRemoveProtect?: string; + + /** + * 图书定价 0关闭 1开启 + */ + bootPrice?: string; + + /** + * 自有图片 0关闭 1开启 + */ + ownPictures?: string; + + /** + * 商品描述 + */ + context?: string; +} + +export interface ShopDetailQuery extends PageQuery { + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 物流运费模板id + */ + templateId?: string | number; + + /** + * 高价 + */ + highPrice?: number; + + /** + * 低价 + */ + lowPrice?: number; + + /** + * 销售模板id + */ + saleTemplateId?: string | number; + + /** + * 是否开启7天无理由 0关闭 1开启 + */ + + sevenDays?: string; + + /** + * 是否开始二手 0关闭 1开启 + */ + isSecondHand?: string; + + /** + * 轮播数量开启 0关闭 1开启 + */ + carouselNum?: string; + + /** + * 是否开启详情图 0关闭 1开启 + */ + isDetailsImg?: string; + + /** + * 是否开启目录详情 0关闭 1开启 + */ + isCatalogueDetails?: string; + + /** + * 是否开启信息图片 0关闭 1开启 + */ + isInformationImg?: string; + + /** + * 标题前缀 + */ + titlePrefix?: string; + + /** + * 标题后缀 + */ + titleSuffix?: string; + + /** + * 标题过滤 + */ + titleFilter?: string; + + /** + * 货号前缀 + */ + itemNumberPrefix?: string; + + /** + * 标题组成 + */ + titleConsistOf?: string; + + /** + * 间隔字符 0无间隔 1空格 + */ + spaceCharacter?: string; + + /** + * 是否开启自动截断 0关闭 1开启 + */ + autoTruncation?: string; + + /** + * 我的设置 + */ + mySetUp?: string; + + /** + * 系统设置 + */ + systemSetUp?: string; + + /** + * 过滤套装 0否 1是 + */ + filterSuit?: string; + + /** + * 删除保护 0关闭 1开启 + */ + isDelProtect?: string; + + /** + * 下架保护 0关闭 1开启 + */ + isRemoveProtect?: string; + + /** + * 图书定价 0关闭 1开启 + */ + bootPrice?: string; + + /** + * 自有图片 0关闭 1开启 + */ + ownPictures?: string; + + /** + * 商品描述 + */ + context?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + +export interface saveArtNo { + saveArtNoRule: number | string; + shopId: number | string; + freightIdList: number[]; + taskId: number; +} + +export interface WlnShopList { + // 万里牛店铺名称 + shopName: string; + // 万里牛系统ID + shopNick: string; +} + +/** + * 解密需要的数据 + */ +export interface EncrypData { + dataUrl?: string; //数据文件网络访问链接 + shopPrice?: number; //店铺优惠 + maxPrice?: number; //利润区间最大 + minPrice?: number; //利润区间最小 + shopId?: number; //店铺Id + isOnSale?: string; //上下架状态 + shopType?: number; //店铺类型 +} +export type ShopMap = Record; diff --git a/src/api/zhishu/shopDepotAotu/index.ts b/src/api/zhishu/shopDepotAotu/index.ts new file mode 100644 index 0000000..93f1a9d --- /dev/null +++ b/src/api/zhishu/shopDepotAotu/index.ts @@ -0,0 +1,16 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ShopDepotAotuVO, ShopDepotAotuQuery } from '@/api/zhishu/shopDepotAotu/types'; + +/** + * 查询店铺自动发布仓库关联列表 + * @param query + * @returns {*} + */ +export const listShopDepotAotu = (query?: ShopDepotAotuQuery): AxiosPromise => { + return request({ + url: '/zhishu/shopDepotAotu/list', + method: 'get', + params: query + }); +}; \ No newline at end of file diff --git a/src/api/zhishu/shopDepotAotu/types.ts b/src/api/zhishu/shopDepotAotu/types.ts new file mode 100644 index 0000000..9674036 --- /dev/null +++ b/src/api/zhishu/shopDepotAotu/types.ts @@ -0,0 +1,98 @@ +export interface ShopDepotAotuVO { + /** + * + */ + id: string | number; + + /** + * 店铺id + */ + shopId: string | number; + + /** + * 仓库id + */ + depotId: string | number; + + /** + * 状态(0正常 1停用) + */ + status: string; + + /** + * 店铺名称 + */ + shopName: string; + + /** + * 仓库名称(名称 + 单位) + */ + depotName: string; + +} + +export interface ShopDepotAotuForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 仓库id + */ + depotId?: string | number; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 仓库名称(名称 + 单位) + */ + depotName?: string; + +} + +export interface ShopDepotAotuQuery extends PageQuery { + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 仓库id + */ + depotId?: string | number; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 仓库名称 + */ + depotName?: string; + + /** + * 日期范围参数 + */ + params?: any; +} \ No newline at end of file diff --git a/src/api/zhishu/shopDetail/index.ts b/src/api/zhishu/shopDetail/index.ts new file mode 100644 index 0000000..2f90fb0 --- /dev/null +++ b/src/api/zhishu/shopDetail/index.ts @@ -0,0 +1,66 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ShopDetailVO, ShopDetailForm, ShopDetailQuery } from '@/api/zhishu/shopDetail/types'; + +/** + * 查询商品详情列表 + * @param query + * @returns {*} + */ + +export const listShopDetail = (query?: ShopDetailQuery): AxiosPromise => { + return request({ + url: '/zhishu/shopDetail/list', + method: 'get', + params: query + }); +}; + +/** + * 查询商品详情详细 + * @param id + */ +export const getShopDetail = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/shopDetail/' + id, + method: 'get' + }); +}; + +/** + * 新增商品详情 + * @param data + */ +export const addShopDetail = (data: ShopDetailForm) => { + return request({ + url: '/zhishu/shopDetail', + method: 'post', + data: data + }); +}; + +/** + * 修改商品详情 + * @param data + */ +export const updateShopDetail = (data: ShopDetailForm) => { + //换算重量和标准本数 + // data.bookWeight = parseFloat(data.bookWeight+"") * 100; + // data.standardNumber = parseFloat(data.standardNumber+"") * 100; + return request({ + url: '/zhishu/shopDetail', + method: 'put', + data: data + }); +}; + +/** + * 删除商品详情 + * @param id + */ +export const delShopDetail = (id: string | number | Array) => { + return request({ + url: '/zhishu/shopDetail/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/shopDetail/types.ts b/src/api/zhishu/shopDetail/types.ts new file mode 100644 index 0000000..4ab9a81 --- /dev/null +++ b/src/api/zhishu/shopDetail/types.ts @@ -0,0 +1,829 @@ +export interface ShopDetailVO { + /** + * 主键 + */ + id: string | number; + + /** + * 店铺id + */ + shopId: string | number; + + /** + * 物流运费模板id + */ + templateId: string | number; + + /** + * 高价 + */ + highPrice: number; + + /** + * 低价 + */ + lowPrice: number; + + /** + * 销售模板id + */ + saleTemplateId: string | number; + + /** + * 是否开启7天无理由 0关闭 1开启 + */ + + sevenDays: string; + + /** + * 是否开始二手 0关闭 1开启 + */ + isSecondHand: string; + + /** + * 轮播数量开启 0关闭 1开启 + */ + carouselNum: string; + + /** + * 是否开启详情图 0关闭 1开启 + */ + isDetailsImg: string; + + /** + * 是否开启目录详情 0关闭 1开启 + */ + isCatalogueDetails: string; + + /** + * 是否开启信息图片 0关闭 1开启 + */ + isInformationImg: string; + + /** + * 标题前缀 + */ + titlePrefix: string; + + /** + * 标题后缀 + */ + titleSuffix: string; + + /** + * 标题过滤 + */ + titleFilter: string; + + /** + * 货号前缀 + */ + itemNumberPrefix: string; + + /** + * 标题组成 + */ + titleConsistOf: string; + + /** + * 间隔字符 0无间隔 1空格 + */ + spaceCharacter: string; + + /** + * 是否开启自动截断 0关闭 1开启 + */ + autoTruncation: string; + + /** + * 我的设置 + */ + mySetUp: string; + + /** + * 系统设置 + */ + systemSetUp: string; + + /** + * 过滤套装 0否 1是 + */ + filterSuit: string; + + /** + * 删除保护 0关闭 1开启 + */ + isDelProtect: string; + + /** + * 下架保护 0关闭 1开启 + */ + isRemoveProtect: string; + + /** + * 图书定价 0关闭 1开启 + */ + bootPrice: string; + + /** + * 自有图片 0关闭 1开启 + */ + ownPictures: string; + + /** + * 默认库存 + */ + stockDeff: number; + + /** + * 两件折扣 + */ + twoDiscount: number; + + /** + * 是否预售 0非预售 1定时预售 2 时段预售 + */ + presale: string; + + /** + * 假一赔十 0 关闭 1开启 + */ + fake: string; + + /** + * 发货时间 0 24小时 1 48小时 + */ + deliveryTime: string; + + /** + * 白底图 0关闭 1开启 + */ + whitePicture: string; + + /** + * 水印位置 0全部 1第一张 + */ + watermarkPosition: string; + + /** + * 无图过滤 0关闭 1开启 + */ + filtering: string; + + /** + * 最低价定价 0关闭 1开启 + */ + lowerPrice: string; + + /** + * 最低定价折扣 + */ + lowerPriceDiscount: string; + + /** + * 拼单模板id + */ + spellTemplateId: string | number; + + /** + * 常驻地区id + */ + districtId: string | number; + + /** + * 默认品相 + */ + conditionDef: string | number; + + /** + * 品相描述 + */ + conditionDes: string; + + /** + * 推荐语 + */ + recommend: string; + + /** + * 是否包邮 + */ + isParcel: string; + + /** + * 图书模板 + */ + bookTemplate: string; + + /** + * 图书重量 + */ + bookWeight: string | number; + + /** + * 标准本数 + */ + standardNumber: string | number; + + /** + * 店铺类型 + */ + shopType: string; + + openRepeat:string; + + /** + * 是否自动上传 0 否 1 是 + */ + autoAdd:string; + + /** + * 是否开启咸鱼擦亮 + */ + openPolish: string; + + /** + * 商品描述 + */ + context: string; + + /** + * 擦亮方式 0擦亮原商品 1发布新商品 + */ + polishType?: string; + + /** + * 发布类型 0 图书类目 1 其他类目 + */ + publishType?: string; + + /** + * 其他类目id + */ + categoryId?: string | number; + + /** + * 频率 + */ + frequency: string |number; + + /** + * 自动发布仓库id列表 + */ + warehouseList: []; +} + +export interface ShopDetailForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 物流运费模板id + */ + templateId?: string | number; + + /** + * 高价 + */ + highPrice?: number; + + /** + * 低价 + */ + lowPrice?: number; + + /** + * 销售模板id + */ + saleTemplateId?: string | number; + + /** + * 是否开启7天无理由 0关闭 1开启 + */ + + sevenDays?: string; + + /** + * 是否开始二手 0关闭 1开启 + */ + isSecondHand?: string; + + /** + * 轮播数量开启 0关闭 1开启 + */ + carouselNum?: string; + + /** + * 是否开启详情图 0关闭 1开启 + */ + isDetailsImg?: string; + + /** + * 是否开启目录详情 0关闭 1开启 + */ + isCatalogueDetails?: string; + + /** + * 是否开启信息图片 0关闭 1开启 + */ + isInformationImg?: string; + + /** + * 标题前缀 + */ + titlePrefix?: string; + + /** + * 标题后缀 + */ + titleSuffix?: string; + + /** + * 标题过滤 + */ + titleFilter?: string; + + /** + * 货号前缀 + */ + itemNumberPrefix?: string; + + /** + * 标题组成 + */ + titleConsistOf?: string; + + /** + * 间隔字符 0无间隔 1空格 + */ + spaceCharacter?: string; + + /** + * 是否开启自动截断 0关闭 1开启 + */ + autoTruncation?: string; + + /** + * 我的设置 + */ + mySetUp?: string; + + /** + * 系统设置 + */ + systemSetUp?: string; + + /** + * 过滤套装 0否 1是 + */ + filterSuit?: string; + + /** + * 删除保护 0关闭 1开启 + */ + isDelProtect?: string; + + /** + * 下架保护 0关闭 1开启 + */ + isRemoveProtect?: string; + + /** + * 图书定价 0关闭 1开启 + */ + bootPrice?: string; + + /** + * 自有图片 0关闭 1开启 + */ + ownPictures?: string; + + /** + * 默认库存 + */ + stockDeff?: number; + + /** + * 两件折扣 + */ + twoDiscount?: number; + + /** + * 是否预售 0非预售 1定时预售 2 时段预售 + */ + presale?: string; + + /** + * 假一赔十 0 关闭 1开启 + */ + fake?: string; + + /** + * 发货时间 0 24小时 1 48小时 + */ + deliveryTime?: string; + + /** + * 白底图 0关闭 1开启 + */ + whitePicture?: string; + + /** + * 水印位置 0全部 1第一张 + */ + watermarkPosition?: string; + + /** + * 无图过滤 0关闭 1开启 + */ + filtering?: string; + + /** + * 最低价定价 0关闭 1开启 + */ + lowerPrice?: string; + + /** + * 最低定价折扣 + */ + lowerPriceDiscount?: string; + + /** + * 拼单模板id + */ + spellTemplateId?: string | number; + + /** + * 发布地区类型 + */ + districtType?: string | number; + + /** + * 常驻地区id + */ + districtId?: string | number; + + /** + * 默认品相 + */ + conditionDef?: string | number; + + /** + * 品相描述 + */ + conditionDes?: string; + + /** + * 推荐语 + */ + recommend?: string; + + /** + * 是否包邮 + */ + isParcel?: string; + + /** + * 图书模板 + */ + bookTemplate?: string; + + /** + * 图书重量 + */ + bookWeight?: string | number; + + /** + * 标准本数 + */ + standardNumber?: string | number; + + /** + * 店铺类型 + */ + shopType?: string; + + openRepeat?:string; + + /** + * 是否自动上传 0 否 1 是 + */ + autoAdd?:string; + + /** + * 是否开启咸鱼擦亮 + */ + openPolish?: string; + + /** + * 商品描述 + */ + context?: string; + + /** + * 擦亮方式 0擦亮原商品 1发布新商品 + */ + polishType?: string; + + /** + * 发布类型 0 图书类目 1 其他类目 + */ + publishType?: string; + + /** + * 其他类目id + */ + categoryId?: string | number; + + /** + * 频率 + */ + frequency?: string |number; + + /** + * 自动发布仓库id列表 + */ + warehouseList?: []; +} + +export interface ShopDetailQuery extends PageQuery { + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 物流运费模板id + */ + templateId?: string | number; + + /** + * 高价 + */ + highPrice?: number; + + /** + * 低价 + */ + lowPrice?: number; + + /** + * 销售模板id + */ + saleTemplateId?: string | number; + + /** + * 是否开启7天无理由 0关闭 1开启 + */ + + sevenDays?: string; + + /** + * 是否开始二手 0关闭 1开启 + */ + isSecondHand?: string; + + /** + * 轮播数量开启 0关闭 1开启 + */ + carouselNum?: string; + + /** + * 是否开启详情图 0关闭 1开启 + */ + isDetailsImg?: string; + + /** + * 是否开启目录详情 0关闭 1开启 + */ + isCatalogueDetails?: string; + + /** + * 是否开启信息图片 0关闭 1开启 + */ + isInformationImg?: string; + + /** + * 标题前缀 + */ + titlePrefix?: string; + + /** + * 标题后缀 + */ + titleSuffix?: string; + + /** + * 标题过滤 + */ + titleFilter?: string; + + /** + * 货号前缀 + */ + itemNumberPrefix?: string; + + /** + * 标题组成 + */ + titleConsistOf?: string; + + /** + * 间隔字符 0无间隔 1空格 + */ + spaceCharacter?: string; + + /** + * 是否开启自动截断 0关闭 1开启 + */ + autoTruncation?: string; + + /** + * 我的设置 + */ + mySetUp?: string; + + /** + * 系统设置 + */ + systemSetUp?: string; + + /** + * 过滤套装 0否 1是 + */ + filterSuit?: string; + + /** + * 删除保护 0关闭 1开启 + */ + isDelProtect?: string; + + /** + * 下架保护 0关闭 1开启 + */ + isRemoveProtect?: string; + + /** + * 图书定价 0关闭 1开启 + */ + bootPrice?: string; + + /** + * 自有图片 0关闭 1开启 + */ + ownPictures?: string; + + /** + * 默认库存 + */ + stockDeff?: number; + + /** + * 两件折扣 + */ + twoDiscount?: number; + + /** + * 是否预售 0非预售 1定时预售 2 时段预售 + */ + presale?: string; + + /** + * 假一赔十 0 关闭 1开启 + */ + fake?: string; + + /** + * 发货时间 0 24小时 1 48小时 + */ + deliveryTime?: string; + + /** + * 白底图 0关闭 1开启 + */ + whitePicture?: string; + + /** + * 水印位置 0全部 1第一张 + */ + watermarkPosition?: string; + + /** + * 无图过滤 0关闭 1开启 + */ + filtering?: string; + + /** + * 最低价定价 0关闭 1开启 + */ + lowerPrice?: string; + + /** + * 最低定价折扣 + */ + lowerPriceDiscount?: string; + + /** + * 拼单模板id + */ + spellTemplateId: string | number; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 常驻地区id + */ + districtId?: string | number; + + /** + * 默认品相 + */ + conditionDef?: string | number; + + /** + * 品相描述 + */ + conditionDes?: string; + + /** + * 推荐语 + */ + recommend?: string; + + /** + * 是否包邮 + */ + isParcel?: string; + + /** + * 图书模板 + */ + bookTemplate?: string; + + /** + * 图书重量 + */ + bookWeight?: string | number; + + /** + * 标准本数 + */ + standardNumber?: string | number; + + /** + * 店铺类型 + */ + shopType?: string; + + openRepeat?:string; + + /** + * 是否自动上传 0 否 1 是 + */ + autoAdd?: string; + + /** + * 是否开启咸鱼擦亮 + */ + openPolish?: string; + + /** + * 商品描述 + */ + context?: string; + + /** + * 擦亮方式 0擦亮原商品 1发布新商品 + */ + polishType?: string; + + /** + * 发布类型 0 图书类目 1 其他类目 + */ + publishType?: string; + + /** + * 其他类目id + */ + categoryId?: string | number; + + /** + * 频率 + */ + frequency?: string |number; + + /** + * 自动发布仓库id列表 + */ + warehouseList?: []; +} diff --git a/src/api/zhishu/shopGoods/index.ts b/src/api/zhishu/shopGoods/index.ts new file mode 100644 index 0000000..6d77190 --- /dev/null +++ b/src/api/zhishu/shopGoods/index.ts @@ -0,0 +1,150 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { + ShopGoodsVO, + ShopGoodsForm, + ShopGoodsQuery, + StockChangeLogVo, BatchUpdateCargoVo +} from '@/api/zhishu/shopGoods/types'; + +var pageCode = ''; +var pati = ''; +async function getPati(){ + await PDD_OPEN_init({ + code: '' + }); + pageCode = ''; + pati = await window.PDD_OPEN_getPati(); + return pati; +} + +/** + * 查询商品信息列表 + * @param query + * @returns {*} + */ + +export const listShopGoods = (query?: ShopGoodsQuery): AxiosPromise => { + return request({ + url: '/zhishu/shopGoods/list', + method: 'get', + params: query + }); +}; + +/** + * 查询商品信息详细 + * @param id + */ +export const getShopGoods = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/shopGoods/' + id, + method: 'get' + }); +}; + +/** + * 同步任务到自营书品 + * @param shopId 店铺ID + * @param depotId 货区ID + * @returns {AxiosPromise} 请求结果 + */ +export const syncRunningTaskToShopGoods = ( + shopId: string , + freightId: string, + id: string +): AxiosPromise => { + return request({ + url: '/zhishu/shopGoods/syncRunningTaskToShopGoods', + method: 'get', + params: { shopId,freightId,id } // 使用 params 自动编码参数 + }); +}; + +export const synchronousTask = (shopId) => { + return request({ + url: '/zhishu/shopGoods/synchronousTask', + method: 'post', + params: { + "shopId":shopId + } + }); +}; + +/** + * 新增商品信息 + * @param data + */ +export const addShopGoods = (data: ShopGoodsForm) => { + return request({ + url: '/zhishu/shopGoods', + method: 'post', + data: data + }); +}; + +/** + * 修改商品信息 + * @param data + */ +export const updateShopGoods = (data: ShopGoodsForm) => { + return request({ + url: '/zhishu/shopGoods', + method: 'put', + data: data + }); +}; + +/** + * 删除商品信息 + * @param id + * @param isProSynch + */ +export const delShopGoods = (id: string | number | Array,isProSynch : boolean) => { + return request({ + url: '/zhishu/shopGoods/' + id, + method: 'delete', + params:{ isProSynch } + }); +}; + +/** + * 发布商品 + */ +export const addGoods = async (data) => { + debugger; + // await getPati(); + return request({ + url: '/zhishu/shopGoods/goodsAdd', + method: 'post', + data: data, + headers:{ + 'X-PDD-Pati':pati, + 'X-PDD-PageCode':pageCode + } + }); +}; + +/** + * 查询商品信息详细 + * @param id + */ +export const getStockChangeLog = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/shopGoods/stockLog/' + id, + method: 'get' + }); +}; + + +/** + * 批量修改货区 + * @param data + */ +export const updateBatchModCarAre = (data: BatchUpdateCargoVo) => { + return request({ + url: '/zhishu/shopGoods/batchUpdateAre', + method: 'put', + data: data + }); +}; diff --git a/src/api/zhishu/shopGoods/types.ts b/src/api/zhishu/shopGoods/types.ts new file mode 100644 index 0000000..79d7fc2 --- /dev/null +++ b/src/api/zhishu/shopGoods/types.ts @@ -0,0 +1,709 @@ +export interface ShopGoodsVO { + /** + * id + */ + id: string | number; + + /** + * 商品名称 + */ + goodsName: string; + + /** + * 产品编码 + */ + productId: string; + + /** + * 仓库编号 + */ + depotId: string + + /** + * 商品名称 + */ + specifications: string; + + /** + * isbn + */ + isbn: string + + /** + * 货号 + */ + artNo: string; + + /** + * 期初库存 + */ + openingInventory: number; + + + + + + /** + * 标准售价 + */ + price: number; + + /** + * 品相 + */ + conditionCode: string; + + + /** + * 单位 + */ + unit: string; + + /** + * 备注 + */ + remark: string; + + + + /** + * 图片 + */ + bookPic:string; + + /** + * 仓库名称 + */ + depotName: string; + /** + * 商品定价 + */ + fixPrice: number; + + + + + + // 新增数据 + /** + * 包册数 + */ + booksNumber:number; + /** + * 页数 + */ + pages:number; + + /** + * 是否是套餐(0套餐 1非套餐) + */ + isPackage:number; + + /** + * 出版社名称 + */ + publicationName:string; + + /** + * 出版时间 + */ + publicationTime:string; + + /** + * 作者 + */ + author:string; + + /** + * 地区 + */ + region:string; + + /** + * 译者 + */ + translator:string; + + /** + * 编者 + */ + editor:string; + + /** + * 书籍开本 + */ + booklets:string; + + /** + * 字数 + */ + wordCount:number; + + /** + * 装帧类型 + */ + bindType:string; + + /** + * 包装方式(0礼盒装 1普通包装) + */ + packing:number; + + /** + * 模版名称 + */ + templateName:string; + + /** + * 原始货号 + */ + originalArtNo:string; + + /** + * 最小价格 + */ + minprice:number; + + /** + * 最大价格 + */ + maxprice:string; + + /** + * 最小库存 + */ + mininventory:number; + + /** + * 最大库存 + */ + maxinventory:number; + + /** + * 图片是否为空:1-是,0-否 + */ + IsBookPicNull:number; + + /** + * 运费地址 + */ + deliveryAddress:string; + + /** + * 模版id + */ + templateId:string; + + /** + * 运送方式 + */ + pricingMethod:string; + + /** + * 运送模版最小值 + */ + templateMinPrice:string; + + /** + * 入库时间 + */ + createTime:string; + + + /** + * 用户电话号码(打码) + */ + phoneNumberMark:string; + + /** + * 自营书品仓库名称 + */ + warehouseName:string; + + /** + * 仓库对应的用户id + */ + warehouseUserId:string; +} + +export interface ShopGoodsForm extends BaseEntity { + /** + * id + */ + id?: string | number; + + /** + * 商品编号 + */ + itemNumber?: string; + + /** + * 商品名称 + */ + goodsName?: string; + + /** + * 产品编码 + */ + productId?: string; + + /** + * isbn + */ + isbn?: string; + + /** + * 仓库编号 + */ + depotId?: string + + + /** + * 品相 + */ + conditionCode?: string + + /** + * 货号 + */ + artNo?: string; + + /** + * 库存 + */ + inventory?: number; + + /** + * 修改后库存 + */ + updateInventory?: number; + + /** + * 商品定价 + */ + fixPrice?: number; + + /** + * 货位编码 + */ + storageLocation?: string; + + + /** + * 标准售价 + */ + price?: number; + + /** + * 批发售价 + */ + wholesalePrice?: number; + + + /** + * 单位 + */ + unit?: string; + + /** + * 备注 + */ + remark?: string; + /** + * 图片 + */ + bookPic?:string; + + /** + * 包册数 + */ + booksNumber?:number; + /** + * 页数 + */ + pages?:number; + + /** + * 是否是套餐(0套餐 1非套餐) + */ + isPackage?:number; + + /** + * 出版社名称 + */ + publicationName?:string; + + /** + * 出版时间 + */ + publicationTime?:string; + + /** + * 作者 + */ + author?:string; + + /** + * 地区 + */ + region?:string; + + /** + * 译者 + */ + translator?:string; + + /** + * 编者 + */ + editor?:string; + + /** + * 书籍开本 + */ + booklets?:string; + + /** + * 字数 + */ + wordCount?:number; + + /** + * 装帧类型 + */ + bindType?:string; + + /** + * 包装方式(0礼盒装 1普通包装) + */ + packing?:number; + + /** + * 原始货号 + */ + originalArtNo?:undefined; + + /** + * 最小价格 + */ + minprice?:undefined; + + /** + * 最大价格 + */ + maxprice?:undefined; + + /** + * 最小库存 + */ + mininventory?:undefined; + + /** + * 最大库存 + */ + maxinventory?:undefined; + + /** + * 图片是否为空:1-是,0-否 + */ + IsBookPicNull?:undefined; + /** + * 运费地址 + */ + deliveryAddress?:string; + + /** + * 模版id + */ + templateId?:string; + + /** + * 运送方式 + */ + pricingMethod?:string; + + /** + * 运送模版最小值 + */ + templateMinPrice?:string; + + /** + * 是否查寻全部商品 + */ + isQueryAllGoods?:number; + + + /** + * 是否加入分销:1-否 2-是 + */ + isJoinDistribution?:number; + + /** + * 用户电话号码(打码) + */ + phoneNumberMark?:string; + + /** + * 自营书品仓库名称 + */ + warehouseName:string; + + /** + * 仓库对应的用户id + */ + warehouseUserId:string; +} + +export interface ShopGoodsQuery extends PageQuery { + + /** + * 商品编号 + */ + goodsNo?: string; + + /** + * 商品名称 + */ + goodsName?: string; + + /** + * 产品编码 + */ + productId?: string; + + /** + * 商品名称 + */ + specifications?: string; + + /** + * 货号 + */ + artNo?: string; + + + /** + * 货位编码 + */ + storageLocation?: string; + + /** + * 标准售价 + */ + standardPrice?: number; + + /** + * 单位 + */ + unit?: string; + + + /** + * 日期范围参数 + */ + params?: any; + /** + * 图片 + */ + bookPic?:string; + + // 新增数据 + /** + * 包册数 + */ + booksNumber?:number; + /** + * 页数 + */ + pages?:number; + + /** + * 是否是套餐(0套餐 1非套餐) + */ + isPackage?:number; + + /** + * 出版社名称 + */ + publicationName?:string; + + /** + * 出版时间 + */ + publicationTime?:string; + + /** + * 作者 + */ + author?:string; + + /** + * 地区 + */ + region?:string; + + /** + * 译者 + */ + translator?:string; + + /** + * 编者 + */ + editor?:string; + + /** + * 书籍开本 + */ + booklets?:string; + + /** + * 字数 + */ + wordCount?:number; + + /** + * 装帧类型 + */ + bindType?:string; + + /** + * 包装方式(0礼盒装 1普通包装) + */ + packing?:number; + /** + * 原始货号 + */ + originalArtNo?:undefined; + + /** + * 最小价格 + */ + minprice?:undefined; + + /** + * 最大价格 + */ + maxprice?:undefined; + + /** + * 最小库存 + */ + mininventory?:undefined; + + /** + * 最大库存 + */ + maxinventory?:undefined; + + /** + * 图片是否为空:1-是,0-否 + */ + IsBookPicNull?:undefined; + + /** + * 运费地址 + */ + deliveryAddress?:string; + + /** + * 模版id + */ + templateId?:string; + + /** + * 运送方式 + */ + pricingMethod?:string; + + /** + * 运送模版最小值 + */ + templateMinPrice?:string; + + /** + * 是否查寻全部商品 + */ + isQueryAllGoods?:number; + + /** + * 是否加入分销:1-否 2-是 + */ + isJoinDistribution?:number; + + /** + * 仓库Id + */ + depotId?:number; + + /** + * 地址 + */ + address?:string; + + /** + * 货区id列表 + */ + cargoAreaIds?:number[]; + + /** + * 是否有ISBN + */ + isExistIsbn:number; + + /** + * 开始时间(入库时间范围查询) + */ + startTime?: string; + + /** + * 结束时间(入库时间范围查询) + */ + endTime?: string; + + /** + * 自营书品仓库名称 + */ + warehouseName?: string; + + /** + * 仓库对应的用户id + */ + warehouseUserId?: string; +} + + +export interface StockChangeLogVo{ + /** + * 库存操作Id + */ + id ?:number; + /** + * 初始库存 + */ + beforeInv?:number; + /** + * 操作类型 + */ + type?:number; + /** + * 修改后库存 + */ + afterInv?:number; + /** + * 创建人 + */ + createBy?:string; + /** + * 创建时间 + */ + createTime?:string; + +} + +export interface BatchUpdateCargoVo{ + ids?:number|string; + areas?:number|string; + isOnline?:boolean; + +} diff --git a/src/api/zhishu/shopGoodsPublished/index.ts b/src/api/zhishu/shopGoodsPublished/index.ts new file mode 100644 index 0000000..4296451 --- /dev/null +++ b/src/api/zhishu/shopGoodsPublished/index.ts @@ -0,0 +1,93 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ShopGoodsPublishedVO, ShopGoodsPublishedForm, ShopGoodsPublishedQuery } from '@/api/zhishu/shopGoodsPublished/types'; + +/** + * 查询记录发布数据列表 + * @param query + * @returns {*} + */ + +export const listShopGoodsPublished = (query?: ShopGoodsPublishedQuery): AxiosPromise => { + return request({ + url: '/zhishu/shopGoodsPublished/list', + method: 'get', + params: query + }); +}; + +/** + * 查询记录发布数据详细 + * @param id + */ +export const getShopGoodsPublished = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/shopGoodsPublished/' + id, + method: 'get' + }); +}; + +/** + * 新增记录发布数据 + * @param data + */ +export const addShopGoodsPublished = (data: ShopGoodsPublishedForm) => { + return request({ + url: '/zhishu/shopGoodsPublished', + method: 'post', + data: data + }); +}; + +/** + * 已发布商品校准 + * @param shopId 店铺ID + */ +export const verifyShopGoodsPublished = (shopId) => { + const formData = new FormData(); + formData.append('shopId', shopId); + + return request({ + url: '/zhishu/shopGoodsPublished/verifyShopGoodsPublished', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +/** + * 修改记录发布数据 + * @param data + */ +export const updateShopGoodsPublished = (data: ShopGoodsPublishedForm) => { + return request({ + url: '/zhishu/shopGoodsPublished', + method: 'put', + data: data + }); +}; + +/** + * 删除记录发布数据 + * @param id + */ +export const delShopGoodsPublished = (id: string | number | Array) => { + return request({ + url: '/zhishu/shopGoodsPublished/' + id, + method: 'delete' + }); +}; + + +/** + * 一键删除记录发布数据 + * @param id + */ +export const delShopGoodsAllPublished = (shopId) => { + return request({ + url: '/zhishu/shopGoodsPublished/removeAll?shopId=' + shopId, + method: 'delete' + }); +}; \ No newline at end of file diff --git a/src/api/zhishu/shopGoodsPublished/types.ts b/src/api/zhishu/shopGoodsPublished/types.ts new file mode 100644 index 0000000..170c851 --- /dev/null +++ b/src/api/zhishu/shopGoodsPublished/types.ts @@ -0,0 +1,202 @@ +export interface ShopGoodsPublishedVO { + /** + * 主键 + */ + id: string | number; + + /** + * 图书主键 + */ + shopGoodsId: string | number; + + goodsName : string; + + shopName : string; + + /** + * 发布的店铺ids + */ + shopId: string | number; + + /** + * 平台商品id + */ + platformId: string | number; + + /** + * 状态(0正常 1停用) + */ + status: string; + + /** + * 商品编码 + */ + itemNumber:string; + /** + * 商品图片 + */ + bookPic:string; + /** + * isbn + */ + isbn:string; + /** + * 品相 + */ + conditionCode:string; + /** + * 商品售价 + */ + price:string; + /** + * 发布时间 + */ + createTime:string; + /** + * 线上商品数量 + */ + inventory:number; + /** + * 线上商品 + */ + onlineProducts:string; + /** + * 供应商 + */ + supplier:string; + + /** + * 创建人 + */ + createBy:String; + /** + * 店铺类型 + */ + shopType:number; + /** + * 三方店铺Id + */ + mallId:number; + + // goodsName:string; + + // createTime: string; + + /** + * 货号 + */ + artNo:string; +} + +export interface ShopGoodsPublishedForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 图书主键 + */ + shopGoodsId?: string | number; + + /** + * 发布的店铺ids + */ + shopId?: string | number; + + goodsName : string; + + shopName : string; + + /** + * 平台商品id + */ + platformId?: string | number; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 商品编码 + */ + itemNumber?:string; + + /** + * 书图片 + */ + bookPic?:string; + + /** + * isbn + */ + isbn?:string; + + /** + * 品相 + */ + conditionCode?:string; + + /** + * 标准售价 + */ + price?:string; + + /** + * 发布时间 + */ + createTime?:string; + + /** + * 货区Id + */ + depotId?:string; + + /** + * 货号 + */ + artNo?:string; +} + +export interface ShopGoodsPublishedQuery extends PageQuery { + + /** + * 图书主键 + */ + shopGoodsId?: string | number; + + /** + * 发布的店铺id + */ + shopId?: string | number; + + goodsName : string; + + shopName : string; + + /** + * 平台商品id + */ + platformId?: string | number; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + createTime?: string; + + /** + * 货号 + */ + artNo?:string; +} + + + diff --git a/src/api/zhishu/shopGoodsRejection/index.ts b/src/api/zhishu/shopGoodsRejection/index.ts new file mode 100644 index 0000000..54d0c41 --- /dev/null +++ b/src/api/zhishu/shopGoodsRejection/index.ts @@ -0,0 +1,71 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; + + +// 获取驳回记录列表 +export function getRejectionList(params) { + return request({ + url: '/zhishu/shopgoodsrejection/list', + method: 'get', + params + }) +} + +// 获取驳回记录详情 +export function getRejectionDetail(id) { + return request({ + url: `/zhishu/shopgoodsrejection/${id}`, + method: 'get' + }) +} + +// 新增驳回记录 +export function addRejection(data) { + return request({ + url: '/zhishu/shopgoodsrejection/add', + method: 'post', + data + }) +} + +// 更新驳回记录 +export function updateRejection(id, data) { + return request({ + url: `/zhishu/shopgoodsrejection/${id}`, + method: 'put', + data + }) +} + +// 删除驳回记录 +export function deleteRejection(id) { + return request({ + url: `/zhishu/shopgoodsrejection/${id}`, + method: 'delete' + }) +} + +// 批量删除驳回记录 +export function batchDeleteRejection(ids) { + return request({ + url: '/zhishu/shopgoodsrejection/batch', + method: 'delete', + data: ids + }) +} + +// 根据店铺ID查询 +export function getByShopId(shopId) { + return request({ + url: `/zhishu/shopgoodsrejection/shop/${shopId}`, + method: 'get' + }) +} + +// 根据平台商品ID查询 +export function getByPlatformId(platformId) { + return request({ + url: `/zhishu/shopgoodsrejection/platform/${platformId}`, + method: 'get' + }) +} diff --git a/src/api/zhishu/shopImg/index.ts b/src/api/zhishu/shopImg/index.ts new file mode 100644 index 0000000..382b648 --- /dev/null +++ b/src/api/zhishu/shopImg/index.ts @@ -0,0 +1,74 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ShopImgVO, ShopImgForm, ShopImgQuery } from '@/api/zhishu/shopImg/types'; + +/** + * 查询店铺图片列表 + * @param query + * @returns {*} + */ + +export const listShopImg = (query?: ShopImgQuery): AxiosPromise => { + return request({ + url: '/zhishu/shopImg/list', + method: 'get', + params: query + }); +}; + +/** + * 查询店铺图片详细 + * @param id + */ +export const getShopImg = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/shopImg/' + id, + method: 'get' + }); +}; + +/** + * 新增店铺图片 + * @param data + */ +export const addShopImg = (data: ShopImgForm) => { + return request({ + url: '/zhishu/shopImg', + method: 'post', + data: data + }); +}; + +/** + * 修改店铺图片 + * @param data + */ +export const updateShopImg = (data: ShopImgForm) => { + return request({ + url: '/zhishu/shopImg', + method: 'put', + data: data + }); +}; + +/** + * 删除店铺图片 + * @param id + */ +export const delShopImg = (id: string | number | Array) => { + return request({ + url: '/zhishu/shopImg/' + id, + method: 'delete' + }); +}; + + +/** + * 根据店铺id获取店铺图片 + */ +export const listShopImgByPid = (pid: string | number) =>{ + return request({ + url: '/zhishu/shopImg/listByPid/' + pid, + method: 'get' + }); +} diff --git a/src/api/zhishu/shopImg/types.ts b/src/api/zhishu/shopImg/types.ts new file mode 100644 index 0000000..1c77d99 --- /dev/null +++ b/src/api/zhishu/shopImg/types.ts @@ -0,0 +1,116 @@ +export interface ShopImgVO { + /** + * 主键 + */ + id: string | number; + + /** + * 父id + */ + pid: string | number; + + /** + * 相对路径 + */ + relativePath: string; + + /** + * 绝对路径 + */ + absolutePath: string; + + /** + * 类型 1封面水印 2商详水印 3 商详头图 4 商详尾图 5 轮播尾图 + */ + type: string; + + /** + * 图片顺序 + */ + imgOrder: number; + + /** + * 状态(0正常 1停用) + */ + status: string; + +} + +export interface ShopImgForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 父id + */ + pid?: string | number; + + /** + * 相对路径 + */ + relativePath?: string; + + /** + * 绝对路径 + */ + absolutePath?: string; + + /** + * 类型 1封面水印 2商详水印 3 商详头图 4 商详尾图 5 轮播尾图 + */ + type?: string; + + /** + * 图片顺序 + */ + imgOrder?: number; + + /** + * 状态(0正常 1停用) + */ + status?: string; + +} + +export interface ShopImgQuery extends PageQuery { + + /** + * 父id + */ + pid?: string | number; + + /** + * 相对路径 + */ + relativePath?: string; + + /** + * 绝对路径 + */ + absolutePath?: string; + + /** + * 类型 1封面水印 2商详水印 3 商详头图 4 商详尾图 5 轮播尾图 + */ + type?: string; + + /** + * 图片顺序 + */ + imgOrder?: number; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/zhishu/shopOrder/index.ts b/src/api/zhishu/shopOrder/index.ts new file mode 100644 index 0000000..dc3a712 --- /dev/null +++ b/src/api/zhishu/shopOrder/index.ts @@ -0,0 +1,149 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { + ShopOrderVO, + ShopOrderForm, + ShopOrderQuery, + ShippingMethod, + ShopsShipments, ShopListIds +} from '@/api/zhishu/shopOrder/types'; +import { ShopForm } from '@/api/zhishu/shop/types'; + +/** + * 查询订单列表 + * @param query + * @returns {*} + */ + +export const listShopOrder = (query?: ShopOrderQuery): AxiosPromise => { + return request({ + url: '/zhishu/shopOrder/list', + method: 'get', + params: query + }); +}; + +/** + * 查询订单详细 + * @param id + */ +export const getShopOrder = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/shopOrder/' + id, + method: 'get' + }); +}; + +/** + * 新增订单 + * @param data + */ +export const addShopOrder = (data: ShopOrderForm) => { + return request({ + url: '/zhishu/shopOrder', + method: 'post', + data: data + }); +}; + +/** + * 修改订单 + * @param data + */ +export const updateShopOrder = (data: ShopOrderForm) => { + return request({ + url: '/zhishu/shopOrder', + method: 'put', + data: data + }); +}; + +/** + * 删除订单 + * @param id + */ +export const delShopOrder = (id: string | number | Array) => { + return request({ + url: '/zhishu/shopOrder/' + id, + method: 'delete' + }); +}; + +/** + * 查询订单 和同步数据订单 + * @param id + */ +export const getPddShopOrder = (id: string | number | Array) => { + return request({ + url: '/zhishu/shopOrder/' + id, + method: 'delete' + }); +}; + +/** + * 获取配送方式列表 + * @param shopId + * @param orderSourceType + */ +export const getShopShi = (shopId: number, orderSourceType: number): AxiosPromise => { + return request({ + url: '/zhishu/shopOrder/delivery/methodList', + method: 'get', + params: { + shopId, + orderSourceType + } + }); +}; + +/** + * 订单发货 + * @param data + */ +export const ShopShipments = (data: ShopsShipments) => { + return request({ + url: '/zhishu/shopOrder/delivery', + method: 'post', + data: data + }); +}; + +/** + * 下发任务给仓库 + */ +export const checkInfo = (id) => { + return request({ + url: "/zhishu/shopOrder/checkInfo?orderId="+id, + method: 'post' + }); +} + +/** + * 下发任务给仓库 + */ +export const checkInfoids = (id: string | number | Array) => { + return request({ + url: "/zhishu/shopOrder/checkInfolist?orderIds="+id, + method: 'post' + }); +} + +export const syncKfzHistoryOrder=(days:number,data:ShopListIds)=>{ + return request({ + url: '/zhishu/shopOrder/syncKfzHistoryOrder?days='+days, + method: 'post', + data: data + }); +}; + +/** + * 更新店铺订单同步状态 + * @param data 包含shopId和isSynOrder的对象 + */ +export const updateIsSynOrder = (data: { shopId: string | number; isSynOrder: number }) => { + return request({ + url: '/zhishu/shopOrder/updateIsSynOrder', + method: 'post', + data: data + }); +}; diff --git a/src/api/zhishu/shopOrder/types.ts b/src/api/zhishu/shopOrder/types.ts new file mode 100644 index 0000000..0be5140 --- /dev/null +++ b/src/api/zhishu/shopOrder/types.ts @@ -0,0 +1,1088 @@ +export interface ShopOrderVO { + /** + * + */ + id: string | number; + + /** + * 店铺id + */ + shopId: string | number; + + /** + * 店铺名称 + */ + shopName: string; + + /** + * 地址 + */ + address: string; + + /** + * 详细地址 + */ + addressMask: string; + + /** + * 售后状态 0:无售后 2:买家申请退款,待商家处理 3:退货退款,待商家处理 4:商家同意退款,退款中 5:平台同意退款,退款中 6:驳回退款,待买家处理 7:已同意退货退款,待用户发货 8:平台处理中 9:平台拒绝退款,退款关闭 10:退款成功 11:买家撤销 12:买家逾期未处理,退款失败 13:买家逾期,超过有效期 14:换货补寄待商家处理 15:换货补寄待用户处理 16:换货补寄成功 17:换货补寄失败 18:换货补寄待用户确认完成 21:待商家同意维修 22:待用户确认发货 24:维修关闭 25:维修成功 27:待用户确认收货 31:已同意拒收退款,待用户拒收 32:补寄待商家发货 33:同意召回后退款,待商家召回 + */ + afterSalesStatus: number; + + /** + * 买家留言信息 + */ + buyerMemo: string; + + /** + * 成交状态:0:未成交、1:已成交、2:已取消 + */ + confirmStatus: number; + + /** + * 成交时间 + */ + confirmTime: string; + + /** + * 订单创建时间 + */ + createdTime: string; + + /** + * 是否当日发货,1-是,0-否 + */ + deliveryOneDay: string; + + /** + * 折扣金额,单位:元,折扣金额=平台优惠+商家优惠+团长免单优惠金额 + */ + discountAmount: string; + + /** + * 多多支付立减金额,单位:元 + */ + duoDuoPayReduction: number; + + /** + * 是否多多批发 + */ + duoduoWholesale: number; + + /** + * 商品金额 + */ + goodsAmount: number; + + /** + * 仓库编码 + */ + depotCode: string; + + /** + * 仓库id + */ + depotId: string | number; + + /** + * 支付申报订单号 + */ + depotName: string; + + /** + * 仓库类型,1:自有仓 2:订阅仓 两者都不是则传空 + */ + depotType: number; + + /** + * 货品id + */ + wareId: string | number; + + /** + * 货品名称 + */ + wareName: string; + + /** + * 货品编码 + */ + wareSn: string; + + /** + * 货品类型(0:普通货品:1:组合货品) + */ + wareType: string; + + /** + * 订单编号 + */ + orderSn: string; + + /** + * 订单状态 + */ + orderStatus: number; + + /** + * 支付金额 + */ + payAmount: number; + + /** + * 支付单号 + */ + payNo: number; + + /** + * 支付时间 + */ + payTime: string; + + /** + * 支付方式 + */ + payType: string; + + /** + * 平台优惠金额 + */ + platformDiscount: number; + + /** + * 邮费 + */ + postage: number; + + /** + * 预售时间 + */ + preSaleTime: string; + + /** + * 承诺送达时间 + */ + promiseDeliveryTime: string; + + /** + * 省份 + */ + province: string; + + /** + * 省份编码 + */ + provinceId: string | number; + + /** + * 确认收货时间 + */ + receiveTime: string; + /** + * 市 + */ + city:string; + + /** + * 市编码 + */ + cityId:string; + + /** + * 收件人地址 + */ + receiverAddress: string; + + /** + * 收件人地址 + */ + receiverAddressMask: string; + + /** + * 收件人姓名 + */ + receiverName: string; + + /** + * 收件人姓名 + */ + receiverNameMask: string; + + /** + * 确认收货时间 + */ + receiverPhone: string; + + /** + * 收件人手机号(打码) + */ + receiverPhoneMask: string; + + /** + * 售后状态 + */ + refundStatus: number; + + /** + * 订单备注 + */ + remark: string; + + /** + * 1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag: string; + + /** + * 订单备注标记名称 + */ + remarkTagName: string; + + /** + * 退货包运费,1:是,0:否 + */ + returnFreightPayer: number; + + /** + * 订单审核状态(0-正常订单, 1-审核中订单) + */ + riskControlStatus: number; + + /** + * 是否门店自提 + */ + selfContained: number; + + /** + * 商家优惠金额 + */ + sellerDiscount: number; + + /** + * 缺货处理状态 -1:无缺货处理 0: 缺货待处理 1缺货已处理 + */ + stockOutHandleStatus: number; + + /** + * 全国联保,1:是,0:否 + */ + supportNationwideWarranty: string | number; + + /** + * 区,乡镇 + */ + town: string; + + /** + * 区县编码 + */ + townId: string | number; + + /** + * 快递单号 + */ + trackingNumber: string; + + /** + * 以旧换新国家补贴金额,单位:元 + */ + tradeInNationalSubsidyAmount: string | number; + + /** + * 订单类型 0-普通订单 ,1- 定金订单 + */ + tradeType: number; + + /** + * 订单的更新时间 + */ + updatedAt: string; + + /** + * 催发货时间 + */ + urgeShippingTime: string; + + /** + * 预约配送日期 + */ + yypsDate: string; + + /** + * 预约配送时段 + */ + yypsTime: string; + + /** + * 合单ID2 + */ + openAddressId2: string | number; + + /** + * 店铺状态(0正常 1停用) + */ + status: string; + + /** + * 订单异常类型状态 + */ + orderExceptionTypeList:string[]; + + /** + * 订单状态 + */ + orderSourceType:number; + /** + * 商品信息 + */ + orderItemList:OrderItem; + /** + * 货号 + */ + artNo:string; + +} + +export interface ShopOrderForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 地址 + */ + address?: string; + + /** + * 详细地址 + */ + addressMask?: string; + + /** + * 售后状态 0:无售后 2:买家申请退款,待商家处理 3:退货退款,待商家处理 4:商家同意退款,退款中 5:平台同意退款,退款中 6:驳回退款,待买家处理 7:已同意退货退款,待用户发货 8:平台处理中 9:平台拒绝退款,退款关闭 10:退款成功 11:买家撤销 12:买家逾期未处理,退款失败 13:买家逾期,超过有效期 14:换货补寄待商家处理 15:换货补寄待用户处理 16:换货补寄成功 17:换货补寄失败 18:换货补寄待用户确认完成 21:待商家同意维修 22:待用户确认发货 24:维修关闭 25:维修成功 27:待用户确认收货 31:已同意拒收退款,待用户拒收 32:补寄待商家发货 33:同意召回后退款,待商家召回 + */ + afterSalesStatus?: number; + + /** + * 买家留言信息 + */ + buyerMemo?: string; + + /** + * 成交状态:0:未成交、1:已成交、2:已取消 + */ + confirmStatus?: number; + + /** + * 成交时间 + */ + confirmTime?: string; + + /** + * 订单创建时间 + */ + createdTime?: string; + + /** + * 是否当日发货,1-是,0-否 + */ + deliveryOneDay?: string; + + /** + * 折扣金额,单位:元,折扣金额=平台优惠+商家优惠+团长免单优惠金额 + */ + discountAmount?: string; + + /** + * 多多支付立减金额,单位:元 + */ + duoDuoPayReduction?: number; + + /** + * 是否多多批发 + */ + duoduoWholesale?: number; + + /** + * 商品金额 + */ + goodsAmount?: number; + + /** + * 仓库编码 + */ + depotCode?: string; + + /** + * 仓库id + */ + depotId?: string | number; + + /** + * 支付申报订单号 + */ + depotName?: string; + + /** + * 仓库类型,1:自有仓 2:订阅仓 两者都不是则传空 + */ + depotType?: number; + + /** + * 货品id + */ + wareId?: string | number; + + /** + * 货品名称 + */ + wareName?: string; + + /** + * 货品编码 + */ + wareSn?: string; + + /** + * 货品类型(0:普通货品:1:组合货品) + */ + wareType?: string; + + /** + * 订单编号 + */ + orderSn?: string; + + /** + * 订单状态 + */ + orderStatus?: number; + + /** + * 支付金额 + */ + payAmount?: number; + + /** + * 支付单号 + */ + payNo?: number; + + /** + * 支付时间 + */ + payTime?: string; + + /** + * 支付方式 + */ + payType?: string; + + /** + * 平台优惠金额 + */ + platformDiscount?: number; + + /** + * 邮费 + */ + postage?: number; + + /** + * 预售时间 + */ + preSaleTime?: string; + + /** + * 承诺送达时间 + */ + promiseDeliveryTime?: string; + + /** + * 省份 + */ + province?: string; + + /** + * 省份编码 + */ + provinceId?: string | number; + + /** + * 确认收货时间 + */ + receiveTime?: string; + + /** + * 收件人地址 + */ + receiverAddress?: string; + + /** + * 收件人地址 + */ + receiverAddressMask?: string; + + /** + * 收件人姓名 + */ + receiverName?: string; + + /** + * 收件人姓名 + */ + receiverNameMask?: string; + + /** + * 确认收货时间 + */ + receiverPhone?: string; + + /** + * 收件人手机号(打码) + */ + receiverPhoneMask?: string; + + /** + * 售后状态 + */ + refundStatus?: number; + + /** + * 订单备注 + */ + remark?: string; + + /** + * 1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag?: string; + + /** + * 订单备注标记名称 + */ + remarkTagName?: string; + + /** + * 退货包运费,1:是,0:否 + */ + returnFreightPayer?: number; + + /** + * 订单审核状态(0-正常订单, 1-审核中订单) + */ + riskControlStatus?: number; + + /** + * 是否门店自提 + */ + selfContained?: number; + + /** + * 商家优惠金额 + */ + sellerDiscount?: number; + + /** + * 缺货处理状态 -1:无缺货处理 0: 缺货待处理 1缺货已处理 + */ + stockOutHandleStatus?: number; + + /** + * 全国联保,1:是,0:否 + */ + supportNationwideWarranty?: string | number; + + /** + * 区,乡镇 + */ + town?: string; + + /** + * 区县编码 + */ + townId?: string | number; + + /** + * 快递单号 + */ + trackingNumber?: string; + + /** + * 以旧换新国家补贴金额,单位:元 + */ + tradeInNationalSubsidyAmount?: string | number; + + /** + * 订单类型 0-普通订单 ,1- 定金订单 + */ + tradeType?: number; + + /** + * 订单的更新时间 + */ + updatedAt?: string; + + /** + * 催发货时间 + */ + urgeShippingTime?: string; + + /** + * 预约配送日期 + */ + yypsDate?: string; + + /** + * 预约配送时段 + */ + yypsTime?: string; + + /** + * 合单ID2 + */ + openAddressId2?: string | number; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + + /** + * 订单异常类型状态 + */ + orderExceptionTypeList?:string[]; + + /** + * 订单状态 + */ + orderSourceType?:number; + + /** + * 商品详细信息 + */ + orderItemList:OrderItem; + + /** + * 货号 + */ + artNo:string; +} + +export interface ShopOrderQuery extends PageQuery { + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 地址 + */ + address?: string; + + /** + * 详细地址 + */ + addressMask?: string; + + /** + * 售后状态 0:无售后 2:买家申请退款,待商家处理 3:退货退款,待商家处理 4:商家同意退款,退款中 5:平台同意退款,退款中 6:驳回退款,待买家处理 7:已同意退货退款,待用户发货 8:平台处理中 9:平台拒绝退款,退款关闭 10:退款成功 11:买家撤销 12:买家逾期未处理,退款失败 13:买家逾期,超过有效期 14:换货补寄待商家处理 15:换货补寄待用户处理 16:换货补寄成功 17:换货补寄失败 18:换货补寄待用户确认完成 21:待商家同意维修 22:待用户确认发货 24:维修关闭 25:维修成功 27:待用户确认收货 31:已同意拒收退款,待用户拒收 32:补寄待商家发货 33:同意召回后退款,待商家召回 + */ + afterSalesStatus?: number; + + /** + * 买家留言信息 + */ + buyerMemo?: string; + + /** + * 成交状态:0:未成交、1:已成交、2:已取消 + */ + confirmStatus?: number; + + /** + * 成交时间 + */ + confirmTime?: string; + + /** + * 订单创建时间 + */ + createdTime?: string; + + /** + * 是否当日发货,1-是,0-否 + */ + deliveryOneDay?: string; + + /** + * 折扣金额,单位:元,折扣金额=平台优惠+商家优惠+团长免单优惠金额 + */ + discountAmount?: string; + + /** + * 多多支付立减金额,单位:元 + */ + duoDuoPayReduction?: number; + + /** + * 是否多多批发 + */ + duoduoWholesale?: number; + + /** + * 商品金额 + */ + goodsAmount?: number; + + /** + * 仓库编码 + */ + depotCode?: string; + + /** + * 仓库id + */ + depotId?: string | number; + + /** + * 支付申报订单号 + */ + depotName?: string; + + /** + * 仓库类型,1:自有仓 2:订阅仓 两者都不是则传空 + */ + depotType?: number; + + /** + * 货品id + */ + wareId?: string | number; + + /** + * 货品名称 + */ + wareName?: string; + + /** + * 货品编码 + */ + wareSn?: string; + + /** + * 货品类型(0:普通货品:1:组合货品) + */ + wareType?: string; + + /** + * 订单编号 + */ + orderSn?: string; + + /** + * 订单状态 + */ + orderStatus?: number; + + /** + * 支付金额 + */ + payAmount?: number; + + /** + * 支付单号 + */ + payNo?: number; + + /** + * 支付时间 + */ + payTime?: string; + + /** + * 支付方式 + */ + payType?: string; + + /** + * 平台优惠金额 + */ + platformDiscount?: number; + + /** + * 邮费 + */ + postage?: number; + + /** + * 预售时间 + */ + preSaleTime?: string; + + /** + * 承诺送达时间 + */ + promiseDeliveryTime?: string; + + /** + * 省份 + */ + province?: string; + + /** + * 省份编码 + */ + provinceId?: string | number; + + /** + * 确认收货时间 + */ + receiveTime?: string; + + /** + * 收件人地址 + */ + receiverAddress?: string; + + /** + * 收件人地址 + */ + receiverAddressMask?: string; + + /** + * 收件人姓名 + */ + receiverName?: string; + + /** + * 收件人姓名 + */ + receiverNameMask?: string; + + /** + * 确认收货时间 + */ + receiverPhone?: string; + + /** + * 收件人手机号(打码) + */ + receiverPhoneMask?: string; + + /** + * 售后状态 + */ + refundStatus?: number; + + /** + * 1-红色,2-黄色,3-绿色,4-蓝色,5-紫色 + */ + remarkTag?: string; + + /** + * 订单备注标记名称 + */ + remarkTagName?: string; + + /** + * 退货包运费,1:是,0:否 + */ + returnFreightPayer?: number; + + /** + * 订单审核状态(0-正常订单, 1-审核中订单) + */ + riskControlStatus?: number; + + /** + * 是否门店自提 + */ + selfContained?: number; + + /** + * 商家优惠金额 + */ + sellerDiscount?: number; + + /** + * 缺货处理状态 -1:无缺货处理 0: 缺货待处理 1缺货已处理 + */ + stockOutHandleStatus?: number; + + /** + * 全国联保,1:是,0:否 + */ + supportNationwideWarranty?: string | number; + + /** + * 区,乡镇 + */ + town?: string; + + /** + * 区县编码 + */ + townId?: string | number; + + /** + * 快递单号 + */ + trackingNumber?: string; + + /** + * 以旧换新国家补贴金额,单位:元 + */ + tradeInNationalSubsidyAmount?: string | number; + + /** + * 订单类型 0-普通订单 ,1- 定金订单 + */ + tradeType?: number; + + /** + * 订单的更新时间 + */ + updatedAt?: string; + + /** + * 催发货时间 + */ + urgeShippingTime?: string; + + /** + * 预约配送日期 + */ + yypsDate?: string; + + /** + * 预约配送时段 + */ + yypsTime?: string; + + /** + * 合单ID2 + */ + openAddressId2?: string | number; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 开始时间 + */ + startTime?:string; + + + /** + * 结束时间 + */ + endTime?:string; + /** + * 结束时间 + */ + order_status?:string; + /** + * 结束时间 + */ + refund_status?:string; + + /** + * 时间集合 + */ + dateTime?:string; + // + confirmTimeList: undefined, + // startConfirmTime: undefined, + // endConfirmTime: undefined, + + /** + * 订单异常类型 + */ + orderExceptionTypeList?:string, + /** + * 订单来源 + */ + orderSourceType?:number, + + /** + * 查询订单创建时间起始时间 + */ + createdTimeStart:undefined, + + /** + * 查询订单创建时间截至时间 + */ + createdTimeEnd:undefined, + +} + +// 商品信息详细信息 +export interface OrderItem{ + /** + * 商品名称 + */ + goodsName:string, + /** + * 商品图片 + */ + goodsImg:string, + + /** + * 商品价格(元) + */ + goodsPrice:string, + /** + * 商品数量 + */ + + goodsCount:string, + /** + * 货号 + */ + artNo:string, +} + +// 定义单个配送方式类型 +export interface ShippingMethod { + methodId: string; + methodName: string; +} + +export interface ShopsShipments{ + orderSourceType?:number, + shopId?: number, + orderSn?: string, + methodId?: string, + trackingNumber?: string, + userDefined?:string, + moreShipmentNum?:string +}; + +export interface ShopListIds{ + shopIdList?:number[] +} diff --git a/src/api/zhishu/shopOrderDetail/index.ts b/src/api/zhishu/shopOrderDetail/index.ts new file mode 100644 index 0000000..6ddbc41 --- /dev/null +++ b/src/api/zhishu/shopOrderDetail/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ShopOrderDetailVO, ShopOrderDetailForm, ShopOrderDetailQuery } from '@/api/zhishu/shopOrderDetail/types'; + +/** + * 查询订单详情列表 + * @param query + * @returns {*} + */ + +export const listShopOrderDetail = (query?: ShopOrderDetailQuery): AxiosPromise => { + return request({ + url: '/zhishu/shopOrderDetail/list', + method: 'get', + params: query + }); +}; + +/** + * 查询订单详情详细 + * @param id + */ +export const getShopOrderDetail = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/shopOrderDetail/' + id, + method: 'get' + }); +}; + +/** + * 新增订单详情 + * @param data + */ +export const addShopOrderDetail = (data: ShopOrderDetailForm) => { + return request({ + url: '/zhishu/shopOrderDetail', + method: 'post', + data: data + }); +}; + +/** + * 修改订单详情 + * @param data + */ +export const updateShopOrderDetail = (data: ShopOrderDetailForm) => { + return request({ + url: '/zhishu/shopOrderDetail', + method: 'put', + data: data + }); +}; + +/** + * 删除订单详情 + * @param id + */ +export const delShopOrderDetail = (id: string | number | Array) => { + return request({ + url: '/zhishu/shopOrderDetail/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/shopOrderDetail/types.ts b/src/api/zhishu/shopOrderDetail/types.ts new file mode 100644 index 0000000..5d61a3b --- /dev/null +++ b/src/api/zhishu/shopOrderDetail/types.ts @@ -0,0 +1,221 @@ +export interface ShopOrderDetailVO { + /** + * + */ + id: string | number; + + /** + * 店铺id + */ + shopId: string | number; + + /** + * 店铺名称 + */ + shopName: string; + + /** + * 订单id + */ + orderId: string | number; + + /** + * 商品数量 + */ + goodsCount: number; + + /** + * 商品编码 + */ + goodsId: string | number; + + /** + * 商品图片 + */ + goodsImg: string; + + /** + * 商品名称 + */ + goodsName: string; + + /** + * 商品单件 单价:元 + */ + goodsPrice: string; + + /** + * 商品规格 + */ + goodsSpec: string; + + /** + * 商品维度外部编码,注意:编辑商品后必须等待商品审核通过后方可生效,订单中商品信息为交易快照的商品信息 + */ + outerGoodsId: string | number; + + /** + * sku维度商家外部编码,注意:编辑商品后必须等待商品审核通过后方可生效,订单中商品信息为交易快照的商品信息 + */ + outerId: string | number; + + /** + * 商品sku编码 + */ + skuId: string | number; + + /** + * 店铺状态(0正常 1停用) + */ + status: string; + +} + +export interface ShopOrderDetailForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 订单id + */ + orderId?: string | number; + + /** + * 商品数量 + */ + goodsCount?: number; + + /** + * 商品编码 + */ + goodsId?: string | number; + + /** + * 商品图片 + */ + goodsImg?: string; + + /** + * 商品名称 + */ + goodsName?: string; + + /** + * 商品单件 单价:元 + */ + goodsPrice?: string; + + /** + * 商品规格 + */ + goodsSpec?: string; + + /** + * 商品维度外部编码,注意:编辑商品后必须等待商品审核通过后方可生效,订单中商品信息为交易快照的商品信息 + */ + outerGoodsId?: string | number; + + /** + * sku维度商家外部编码,注意:编辑商品后必须等待商品审核通过后方可生效,订单中商品信息为交易快照的商品信息 + */ + outerId?: string | number; + + /** + * 商品sku编码 + */ + skuId?: string | number; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + +} + +export interface ShopOrderDetailQuery extends PageQuery { + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 订单id + */ + orderId?: string | number; + + /** + * 商品数量 + */ + goodsCount?: number; + + /** + * 商品编码 + */ + goodsId?: string | number; + + /** + * 商品图片 + */ + goodsImg?: string; + + /** + * 商品名称 + */ + goodsName?: string; + + /** + * 商品单件 单价:元 + */ + goodsPrice?: string; + + /** + * 商品规格 + */ + goodsSpec?: string; + + /** + * 商品维度外部编码,注意:编辑商品后必须等待商品审核通过后方可生效,订单中商品信息为交易快照的商品信息 + */ + outerGoodsId?: string | number; + + /** + * sku维度商家外部编码,注意:编辑商品后必须等待商品审核通过后方可生效,订单中商品信息为交易快照的商品信息 + */ + outerId?: string | number; + + /** + * 商品sku编码 + */ + skuId?: string | number; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/zhishu/singlePrint/index.ts b/src/api/zhishu/singlePrint/index.ts new file mode 100644 index 0000000..340b5dc --- /dev/null +++ b/src/api/zhishu/singlePrint/index.ts @@ -0,0 +1,126 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { SinglePrintVO, SinglePrintForm, SinglePrintQuery } from './types'; + +/** + * 查询单票打印列表(分页) + * @param query + * @returns {*} + */ +export const listSinglePrint = (query?: SinglePrintQuery): AxiosPromise> => { + return request({ + url: '/zhishu/singlePrint/list', + method: 'get', + params: query + }); +}; + +/** + * 查询单票打印列表(不分页) + * @param query + * @returns {*} + */ +export const listSinglePrintNoPage = (query?: SinglePrintQuery): AxiosPromise => { + return request({ + url: '/zhishu/singlePrint/listNoPage', + method: 'get', + params: query + }); +}; + +/** + * 查询单票打印详细 + * @param id + */ +export const getSinglePrint = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/singlePrint/' + id, + method: 'get' + }); +}; + +/** + * 根据快递单号查询单票打印详细 + * @param mailNo + */ +export const getSinglePrintByMailNo = (mailNo: string): AxiosPromise => { + return request({ + url: '/zhishu/singlePrint/getByMailNo/' + mailNo, + method: 'get' + }); +}; + +/** + * 面单打印 + * @param id + * @returns + */ +export const printOne = (id) => { + return request({ + url: '/zhishu/singlePrint/printOne?id=' + id, + method: 'get' + }); +}; + +/** + * 拼多多云打印机打印 + * @param data + * @returns + */ +export const pddCloudPrint = (data) => { + return request({ + url: '/zhishu/singlePrint/pddCloudPrint', + method: 'post', + data: data + }); +} + +/** + * 面单取消 + * @param id + * @returns + */ +export const cancelBmOrder = (id) => { + return request({ + url: '/zhishu/singlePrint/cancelBmOrder?id=' + id, + method: 'get' + }); +}; + + +/** + * + * @param data 单条打印 + * @returns + */ +export const addSinglePrint = (data) => { + return request({ + url: '/zhishu/singlePrint/add', + method: 'post', + data: data + }); +}; + +/** + * 删除单票打印 + * @param id + */ +export const delSinglePrint = (id: string | number | Array) => { + return request({ + url: '/zhishu/singlePrint/' + id, + method: 'delete' + }); +}; + + +/** + * 根据快递单号删除单票打印 + * @param mailNo + */ +export const delSinglePrintByMailNo = (mailNo: string) => { + return request({ + url: '/zhishu/singlePrint/deleteByMailNo/' + mailNo, + method: 'delete' + }); +}; + diff --git a/src/api/zhishu/singlePrint/types.ts b/src/api/zhishu/singlePrint/types.ts new file mode 100644 index 0000000..3732348 --- /dev/null +++ b/src/api/zhishu/singlePrint/types.ts @@ -0,0 +1,246 @@ +export interface SinglePrintVO { + /** + * 主键ID + */ + id: string | number; + + /** + * 快递单号 + */ + mailNo: string; + + /** + * 发件人名称 + */ + senderName: string; + + /** + * 发件人联系方式 + */ + senderPhone: string; + + /** + * 发货地详细地址 + */ + senderAddress: string; + + /** + * 收件人名称 + */ + receiverName: string; + + /** + * 收件人联系方式 + */ + receiverPhone: string; + + /** + * 收件人详细地址 + */ + receiverAddress: string; + + /** + * 物品名称 + */ + itemName: string; + + /** + * 物品数量 + */ + itemNum: number; + + /** + * 物品备注 + */ + itemRemark: string; + + /** + * 打单账号id + */ + fastMailId: string | number; + + /** + * 打单账号信息 + */ + fastMailText: string; + + /** + * 创建人id + */ + createBy: string | number; + + /** + * 创建时间时间戳 + */ + createAt: string | number; + + /** + * 备注 + */ + remark: string; + + receiverProvince?: string; + receiverCity?: string; + receiverDistrict?: string + + status: string; +} + +export interface SinglePrintForm extends BaseEntity { + /** + * 主键ID + */ + id?: string | number; + + /** + * 快递单号 + */ + mailNo?: string; + + /** + * 发件人名称 + */ + senderName?: string; + + /** + * 发件人联系方式 + */ + senderPhone?: string; + + /** + * 发货地详细地址 + */ + senderAddress?: string; + + /** + * 收件人名称 + */ + receiverName?: string; + + /** + * 收件人联系方式 + */ + receiverPhone?: string; + + /** + * 收件人详细地址 + */ + receiverAddress?: string; + + /** + * 物品名称 + */ + itemName?: string; + + /** + * 物品数量 + */ + itemNum?: number; + + /** + * 物品备注 + */ + itemRemark?: string; + + /** + * 打单账号id + */ + fastMailId?: string | number; + + /** + * 打单账号信息 + */ + fastMailText?: string; + + /** + * 创建人id + */ + createBy?: string | number; + + /** + * 创建时间时间戳 + */ + createAt?: string | number; + + /** + * 备注 + */ + remark?: string; + + receiverProvince?: string; + receiverCity?: string; + receiverDistrict?: string; + + status?: string; +} + +export interface SinglePrintQuery extends PageQuery { + /** + * 主键ID + */ + id?: string | number; + + /** + * 快递单号 + */ + mailNo?: string; + + /** + * 发件人名称 + */ + senderName?: string; + + /** + * 发件人联系方式 + */ + senderPhone?: string; + + /** + * 收件人名称 + */ + receiverName?: string; + + /** + * 收件人联系方式 + */ + receiverPhone?: string; + + /** + * 物品名称 + */ + itemName?: string; + + /** + * 打单账号id + */ + fastMailId?: string | number; + + /** + * 创建人id + */ + createBy?: string | number; + + /** + * 创建时间时间戳 + */ + createAt?: string | number; + + /** + * 创建开始时间 + */ + createAtBegin?: string | number; + + /** + * 创建结束时间 + */ + createAtEnd?: string | number; + + /** + * 日期范围参数 + */ + params?: any; + + + status?: string; + +} \ No newline at end of file diff --git a/src/api/zhishu/spec/index.ts b/src/api/zhishu/spec/index.ts new file mode 100644 index 0000000..95eae70 --- /dev/null +++ b/src/api/zhishu/spec/index.ts @@ -0,0 +1,70 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { SpecVO, SpecForm, SpecQuery } from '@/api/zhishu/spec/types'; + +/** + * 查询自定义规格设置列表 + * @param query + * @returns {*} + */ + +export const listSpec = (query?: SpecQuery): AxiosPromise => { + return request({ + url: '/zhishu/spec/list', + method: 'get', + params: query + }); +}; + +/** + * 查询自定义规格设置详细 + * @param id + */ +export const getSpec = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/spec/' + id, + method: 'get' + }); +}; + +export const getSpecByShopId = (shopId: string | number): AxiosPromise => { + return request({ + url: '/zhishu/spec/getInfoByShopId/' + shopId, + method: 'get' + }); +}; + +/** + * 新增自定义规格设置 + * @param data + */ +export const addSpec = (data: SpecForm) => { + return request({ + url: '/zhishu/spec', + method: 'post', + data: data + }); +}; + +/** + * 修改自定义规格设置 + * @param data + */ +export const updateSpec = (data: SpecForm) => { + return request({ + url: '/zhishu/spec', + method: 'put', + data: data + }); +}; + +/** + * 删除自定义规格设置 + * @param id + */ +export const delSpec = (id: string | number | Array) => { + return request({ + url: '/zhishu/spec/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/spec/types.ts b/src/api/zhishu/spec/types.ts new file mode 100644 index 0000000..c80a4c5 --- /dev/null +++ b/src/api/zhishu/spec/types.ts @@ -0,0 +1,206 @@ +export interface SpecVO { + /** + * 主键 + */ + id: string | number; + + /** + * 店铺id + */ + shopId: string | number; + + /** + * 规格类型id + */ + specTypeId: string | number; + + /** + * 规格类型名称 + */ + specTypeName: string; + + /** + * 规格组成 0 自定义 1 ISBN 2 书名 3货号 + */ + specCompose: string; + + /** + * 自定义规格名称 + */ + specName: string; + + /** + * 自定义规格前缀 + */ + specPrefix: string; + + /** + * 自定义规格后缀 + */ + specSuffix: string; + + /** + * 规格编码组成 0 自定义 1 ISBN 2 书名 3货号 + */ + specCodeCompose: string; + + /** + * 自定义规格编码前缀 + */ + specCodePrefix: string; + + /** + * 自定义规格编码后缀 + */ + specCodeSuffix: string; + + /** + * SKU水印图片路径 + */ + specSyUrl: string; + + /** + * 状态(0正常 1停用) + */ + status: string; + +} + +export interface SpecForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 规格类型id + */ + specTypeId?: string | number; + + /** + * 规格类型名称 + */ + specTypeName?: string; + + /** + * 规格组成 0 自定义 1 ISBN 2 书名 3货号 + */ + specCompose?: string; + + /** + * 自定义规格名称 + */ + specName?: string; + + /** + * 自定义规格前缀 + */ + specPrefix?: string; + + /** + * 自定义规格后缀 + */ + specSuffix?: string; + + /** + * 规格编码组成 0 自定义 1 ISBN 2 书名 3货号 + */ + specCodeCompose?: string; + + /** + * 自定义规格编码前缀 + */ + specCodePrefix?: string; + + /** + * 自定义规格编码后缀 + */ + specCodeSuffix?: string; + + /** + * SKU水印图片路径 + */ + specSyUrl?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + +} + +export interface SpecQuery extends PageQuery { + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 规格类型id + */ + specTypeId?: string | number; + + /** + * 规格类型名称 + */ + specTypeName?: string; + + /** + * 规格组成 0 自定义 1 ISBN 2 书名 3货号 + */ + specCompose?: string; + + /** + * 自定义规格名称 + */ + specName?: string; + + /** + * 自定义规格前缀 + */ + specPrefix?: string; + + /** + * 自定义规格后缀 + */ + specSuffix?: string; + + /** + * 规格编码组成 0 自定义 1 ISBN 2 书名 3货号 + */ + specCodeCompose?: string; + + /** + * 自定义规格编码前缀 + */ + specCodePrefix?: string; + + /** + * 自定义规格编码后缀 + */ + specCodeSuffix?: string; + + /** + * SKU水印图片路径 + */ + specSyUrl?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/zhishu/statistic/index.ts b/src/api/zhishu/statistic/index.ts new file mode 100644 index 0000000..d6efafc --- /dev/null +++ b/src/api/zhishu/statistic/index.ts @@ -0,0 +1,11 @@ +import { AxiosPromise} from 'axios'; +import { statistic } from '@/api/zhishu/statistic/type'; +import request from '@/utils/request'; + + +export const listNum = ( ): AxiosPromise => { + return request({ + url: '/zhishu/statistic/statistic', + method: 'get', + }); +}; diff --git a/src/api/zhishu/statistic/type.ts b/src/api/zhishu/statistic/type.ts new file mode 100644 index 0000000..4f7fcca --- /dev/null +++ b/src/api/zhishu/statistic/type.ts @@ -0,0 +1,30 @@ +export interface statistic{ + /** + *库房数量 + */ + warehousesNum: number; + + /** + * 货架数量 + */ + shelvesNum: number; + /** + * 仓库名称 + */ + warehousesName: string; + /** + * 入库量 + */ + inQuantity: number; + + /** + * 出库量 + */ + outQuantity: number; + /** + * 书籍种类 + */ + bookCategory: string; +} + + diff --git a/src/api/zhishu/subAccount/index.ts b/src/api/zhishu/subAccount/index.ts new file mode 100644 index 0000000..3ad3e59 --- /dev/null +++ b/src/api/zhishu/subAccount/index.ts @@ -0,0 +1,108 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import exp from 'constants'; + + + +/** + * 查询子账号列表 + * @param i + * @returns + */ +export const getSubAccountList = (pageNum,pageSize) => { + return request({ + url: '/zhishu/subAccount/getSubAccountList?pageNum='+pageNum+'&pageSize='+pageSize, + method: 'get' + }); +}; + + +/** + * 查询账号等级 + * @param i + * @returns + */ +export const getLevelConfig = () => { + return request({ + url: '/zhishu/subAccount/getLevelConfig', + method: 'get' + }); +}; + +/** + * 新增店铺主表 + * @param data + */ +export const addSubAccountOne = (data) => { + return request({ + url: '/zhishu/subAccount/add', + method: 'post', + data: data + }); +}; + + +/** + * 设置代理等级 + * @param data + */ +export const setLevel = (data) => { + return request({ + url: '/zhishu/subAccount/setLevel', + method: 'post', + data: data + }); +} + +/** + * 查询子账号设置 + * @param i + * @returns + */ +export const getPdaConfig = (empId) => { + return request({ + url: '/zhishu/subAccount/getPdaConfig?empId='+empId, + method: 'get' + }); +}; + + + +/** + * 设置子账号配置信息 + * @param data + */ +export const setPdaConfig = (data) => { + return request({ + url: '/zhishu/subAccount/setPdaConfig', + method: 'post', + data: data + }); +} + + +/** + * 重置密码 + * @param data + */ +export const updatePasswrod = (data) => { + return request({ + url: '/zhishu/subAccount/updatePasswrod', + method: 'post', + data: data + }); +} + + +/** + * 更新到期时间 + * @param data + */ +export const updateExpireTime = (data) => { + return request({ + url: '/zhishu/subAccount/updateExpireTime', + method: 'post', + data: data + }); +} + diff --git a/src/api/zhishu/sync/index.ts b/src/api/zhishu/sync/index.ts new file mode 100644 index 0000000..b7a2e44 --- /dev/null +++ b/src/api/zhishu/sync/index.ts @@ -0,0 +1,19 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { SinglePrintVO, SinglePrintForm, SinglePrintQuery } from './types'; + + + + +/** + * 同步货区 + * @param data + * @returns + */ +export const syncLocations = (data) => { + return request({ + url: '/zhishu/syncLog/syncLocations', + method: 'post', + data: data + }); +}; diff --git a/src/api/zhishu/synchronizationShopLog/index.ts b/src/api/zhishu/synchronizationShopLog/index.ts new file mode 100644 index 0000000..4fa21ac --- /dev/null +++ b/src/api/zhishu/synchronizationShopLog/index.ts @@ -0,0 +1,55 @@ +// index.ts + +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { SynchronizationShopLogVO, SynchronizationShopLogQuery } from './types'; + +/** + * 查询同步店铺商品库存日志列表(分页) + * @param query + * @returns {*} + */ +export const listSynchronizationShopLog = (query?: SynchronizationShopLogQuery): AxiosPromise> => { + return request({ + url: '/zhishu/synchronizationShopLog/list', + method: 'get', + params: query + }); +}; + +/** + * 获取单个同步任务日志 + * @param params + * @returns + */ +export const getLogList = (params) => { + return request({ + url: '/zhishu/synchronizationShopLog/getLogList', + method: 'get', + params: params + }); +} + +/** + * 获取同步店铺商品库存日志详细信息 + * @param id + */ +export const getSynchronizationShopLog = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/synchronizationShopLog/' + id, + method: 'get' + }); +}; + +/** + * 导出同步店铺商品库存日志 + * @param query + */ +export const exportSynchronizationShopLog = (query?: SynchronizationShopLogQuery): AxiosPromise => { + return request({ + url: '/zhishu/synchronizationShopLog/export', + method: 'post', + data: query, + responseType: 'blob' + }); +}; \ No newline at end of file diff --git a/src/api/zhishu/synchronizationShopLog/types.ts b/src/api/zhishu/synchronizationShopLog/types.ts new file mode 100644 index 0000000..e0654c7 --- /dev/null +++ b/src/api/zhishu/synchronizationShopLog/types.ts @@ -0,0 +1,231 @@ +// types.ts + +/** + * 同步店铺商品库存日志查询参数 + */ +export interface SynchronizationShopLogQuery extends PageQuery { + /** + * 主键ID + */ + id?: string | number; + + /** + * 商品id + */ + goodsId?: string | number; + + /** + * 商品的创建人 + */ + goodsCreateBy?: string | number; + + /** + * erp订单id + */ + erpOrderId?: string | number; + + /** + * 订单号 + */ + orderSn?: string; + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 店铺的创建人 + */ + shopCreateBy?: string | number; + + /** + * 三方平台id + */ + platformId?: string | number; + + /** + * 状态码 200 成功 500 失败 + */ + code?: string; + + /** + * 创建开始时间 + */ + createAtBegin?: string | number; + + /** + * 创建结束时间 + */ + createAtEnd?: string | number; + + /** + * 日期范围参数 + */ + params?: any; +} + +/** + * 同步店铺商品库存日志视图对象 + */ +export interface SynchronizationShopLogVO { + /** + * 主键ID + */ + id: string | number; + + /** + * 商品id + */ + goodsId: string | number; + + /** + * 商品的创建人 + */ + goodsCreateBy: string | number; + + /** + * erp订单id + */ + erpOrderId: string | number; + + /** + * 订单号 + */ + orderSn: string; + + /** + * 店铺id + */ + shopId: string | number; + + /** + * 店铺名称 + */ + shopName: string; + + /** + * 店铺的创建人 + */ + shopCreateBy: string | number; + + /** + * 更新后库存 + */ + inventory: number; + + /** + * 更新前库存 + */ + inventoryOld: number; + + /** + * 三方平台id + */ + platformId: string | number; + + /** + * 状态码 200 成功 500 失败 + */ + code: string; + + /** + * 日志信息 + */ + msg: string; + + /** + * 创建时间 + */ + createAt: string | number; + + /** + * 创建人 + */ + createBy: string | number; + + /** + * 修改人 + */ + updateBy: string | number; + + /** + * 修改时间 + */ + updateAt: string | number; +} + +/** + * 同步店铺商品库存日志业务对象(新增/修改) + */ +export interface SynchronizationShopLogForm extends BaseEntity { + /** + * 主键ID + */ + id?: string | number; + + /** + * 商品id + */ + goodsId?: string | number; + + /** + * 商品的创建人 + */ + goodsCreateBy?: string | number; + + /** + * erp订单id + */ + erpOrderId?: string | number; + + /** + * 订单号 + */ + orderSn?: string; + + /** + * 店铺id + */ + shopId?: string | number; + + /** + * 店铺名称 + */ + shopName?: string; + + /** + * 店铺的创建人 + */ + shopCreateBy?: string | number; + + /** + * 更新后库存 + */ + inventory?: number; + + /** + * 更新前库存 + */ + inventoryOld?: number; + + /** + * 三方平台id + */ + platformId?: string | number; + + /** + * 状态码 200 成功 500 失败 + */ + code?: string; + + /** + * 日志信息 + */ + msg?: string; +} \ No newline at end of file diff --git a/src/api/zhishu/task/index.ts b/src/api/zhishu/task/index.ts new file mode 100644 index 0000000..cd05566 --- /dev/null +++ b/src/api/zhishu/task/index.ts @@ -0,0 +1,364 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { TaskVO, TaskForm, TaskQuery, ShopVO, ShopDetailVO } from '@/api/zhishu/task/types'; +import exp from 'constants'; + +/** + * 查询任务列表列表 + * @param query + * @returns {*} + */ + +export const listTask = (query?: TaskQuery): AxiosPromise => { + return request({ + url: '/zhishu/task/list', + method: 'get', + params: query + }); +}; + +export const logsTask = (id) => { + return request({ + url: '/zhishu/task/logsList', + method: 'get', + params: { + 'id': id + } + }); +}; + +export const logsMsg = (id) => { + return request({ + url: '/zhishu/task/logsMsg', + method: 'get', + params: { + 'id': id + } + }); +}; + +export const checkTaskStatus = (id) => { + return request({ + url: '/zhishu/task/checkTaskStatus', + method: 'get', + params: { + 'id': id + } + }); +}; + +export const logsDetailTask = (data) => { + return request({ + url: '/zhishu/task/logsDetailList/' + data.taskId + '/' + data.shopId, + method: 'get' + }); +}; + +export const downloadLog = (fileName) => { + return request({ + url: '/zhishu/task/downloadLogs/' + fileName, + method: 'get' + }); +}; + +//校验文件是否上传 +export const checkFile = () => { + return request({ + url: '/zhishu/task/checkFile', + method: 'get' + }); +}; +//删除缓存文件 +export const delFile = () => { + return request({ + url: '/zhishu/task/delFile', + method: 'get' + }); +}; + +/** + * 暂停/恢复/中止接口 + */ +export const editRunningTaskStatus = (taskId, status) => { + return request({ + url: '/zhishu/task/editRunningTask', + method: 'post', + data: { + 'taskId': taskId, + 'status': status + } + }); +}; + +/** + * 暂停线程 + */ +export const pauseThread = (threadId, id) => { + return request({ + url: '/zhishu/task/pauseThread/' + threadId + '/' + id, + method: 'get' + }); +}; + +/** + * 恢复线程 + */ +export const continueThread = (threadId, id) => { + return request({ + url: '/zhishu/task/continueThread/' + threadId + '/' + id, + method: 'get' + }); +}; + +/** + * 查询任务列表详细 + * @param id + */ +export const getTask = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/task/' + id, + method: 'get' + }); +}; + +/** + * 新增任务列表 + * @param data + */ +export const addTask = (data) => { + return request({ + url: '/zhishu/task', + method: 'post', + data: data + }); +}; + +/** + * 同步仓库 + */ +export const tbStock = (data) => { + return request({ + url: '/zhishu/task/tbStock', + method: 'post', + data: data + }); +}; + +/** + * 修改任务列表 + * @param data + */ +export const updateTask = (data: TaskForm) => { + return request({ + url: '/zhishu/task', + method: 'put', + data: data + }); +}; + +/** + * 删除任务列表 + * @param id + */ +export const delTask = (id: string | number | Array) => { + return request({ + url: '/zhishu/task/' + id, + method: 'delete' + }); +}; + +/** + * 删除任务列表 + * @param rows 选中的行数据数组 + */ +export const delPddTask = (rows: Array) => { + return request({ + url: '/zhishu/task/delPdds', + method: 'delete', + data: rows + }); +}; + +/** + * 停止任务 + */ +export const stopTask = (taskId) => { + return request({ + url: '/zhishu/task/stopTask', + params: { + 'taskId': taskId + }, + method: 'post' + }); +}; + +/** + * 查询任务列表详细 + * @param id + */ +export const getShopGoodsTask = (shopId) => { + return request({ + url: '/zhishu/task/selectShopTaskByGetShopGoods?shopId=' + shopId, + method: 'get' + }); +}; + +/** + * 查询正在执行中的任务总数 + */ +export const getTaskCountByTaskType = (taskType) => { + return request({ + url: '/zhishu/task/getTaskCountByTaskTypeAll?taskType=' + taskType, + method: 'get' + }); +}; + +/** + * 查询重复数据 + * @param id + */ +export const getRepeatData = (shopId, pageNum, pageSize) => { + return request({ + url: '/zhishu/task/getRepeatData?shopId=' + shopId + '&pageNum=' + pageNum + '&pageSize=' + pageSize, + method: 'get' + }); +}; + +/** + * 校验任务是否存在 (传入类型) + */ +export const getTaskStatus = (shopId, taskType) => { + return request({ + url: '/zhishu/task/selectTaskStatusByTaskType?shopId=' + shopId + '&taskType=' + taskType, + method: 'get' + }); +}; + +/** + * 获取pdd店铺商品数据总数 + */ +export const getShopTaskAllNum = (shopId, isOnSale, isbn, priceDown, priceUp, startDate, endDate,goodsName,stockDown,stockUp,trilateralId,goodsCode,skuCode) => { + return request({ + url: + '/zhishu/task/getShopTaskAllNum?shopId=' +shopId + + '&isOnSale=' + isOnSale + + '&isbn=' + isbn + + '&priceDown=' + priceDown + + '&priceUp=' + priceUp + + '&startDate=' + startDate + + '&endDate=' + endDate + +"&goodsName="+goodsName + +"&stockDown="+stockDown + +"&stockUp="+stockUp + +"&trilateralId="+trilateralId + +"&goodsCode="+goodsCode + +"&skuCode="+skuCode, + method: 'get' + }); +}; + +/** + * 修改店铺优先级 + */ +export const editTaskPriority = (taskId) => { + return request({ + url: '/zhishu/task/editTaskPriority', + params: { + 'taskId': taskId + }, + method: 'post' + }); +}; + +/** + * 暂停任务 + * @param taskId + * @returns + */ +export const taskPause = (taskId) => { + return request({ + url: '/zhishu/task/taskPause', + params: { + 'taskId': taskId + }, + method: 'post' + }); +}; + +/** + * 恢复任务 + * @param taskId + * @returns + */ +export const taskRecover = (taskId) => { + return request({ + url: '/zhishu/task/taskRecover', + params: { + 'taskId': taskId + }, + method: 'post' + }); +}; + +/** + * 批量获取店铺信息 + * @param ids 店铺ID数组 + * @returns + */ +export const getShopsBatch = (ids: Array): AxiosPromise => { + return request({ + url: '/zhishu/shop/batch', + method: 'post', + data: { ids } + }); +}; +/** + * 批量获取店铺详情信息 + * @param ids 店铺ID数组 + * @returns + */ +export const getShopDetailsBatch = (ids: Array): AxiosPromise => { + return request({ + url: '/zhishu/shop/detail/batch', + method: 'post', + data: { ids } + }); +}; + +/** + * ES1 + */ +export const terminPddTask = (redisKey) => { + return request({ + url: '/pdd/getPublishMsg', + params: { + 'redisKey': redisKey + }, + method: 'post' + }); +}; + +/** + * ES1 + */ +export const getTaskCount = (redisKey) => { + return request({ + url: '/pdd/stopTask', + params: { + 'redisKey': redisKey + }, + method: 'post' + }); +}; + +/** + * pdd续拉 + * @param shopId 店铺ID + * @returns + */ +export function continueGetGoodsTask(taskId,shopId) { + return request({ + url: '/huidiao/pdd/continueGetGoodsTask?taskId='+taskId+"&shopId="+shopId, + method: 'get' + }); +} diff --git a/src/api/zhishu/task/types.ts b/src/api/zhishu/task/types.ts new file mode 100644 index 0000000..87c3bfc --- /dev/null +++ b/src/api/zhishu/task/types.ts @@ -0,0 +1,202 @@ +import { string } from "vue-types"; + +export interface TaskVO extends BaseEntity { + /** + * + */ + id: string | number; + + /** + * 任务类型 1 发布商品 + */ + taskType: string; + + /** + * 店铺id 字符串 + */ + shopIds: string | number; + + shopNames: string; + + /** + * 文件名称 + */ + fileName: string; + + /** + * 执行数据条数 + */ + dataNum: number; + + /** + * 任务状态 + */ + taskStatus: string; + + /** + * 状态(0正常 1停用) + */ + status: string; + + /** + * 线程id + */ + threadId: string | number; + + /** + * 是否存在待同步商品文件 + */ + hasSyncFile:boolean; +} + +export interface TaskForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 任务类型 1 发布商品 + */ + taskType?: string; + + /** + * 店铺id 字符串 + */ + shopIds?: string | number; + + shopNames?: string; + + /** + * 文件名称 + */ + fileName?: string; + + /** + * 执行数据条数 + */ + dataNum?: number; + + /** + * 任务状态 + */ + taskStatus?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 线程id + */ + threadId: string | number; + + /** + * 是否存在待同步商品文件 + */ + hasSyncFile:boolean; + +} + +export interface TaskQuery extends PageQuery { + + /** + * 任务类型 1 发布商品 + */ + taskType?: string; + + /** + * 店铺id 字符串 + */ + shopIds?: string | number; + + shopNames?: string; + + /** + * 文件名称 + */ + fileName?: string; + + /** + * 执行数据条数 + */ + dataNum?: number; + + /** + * 任务状态 + */ + taskStatus?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 线程id + */ + threadId: string | number; +} + + + +/** + * 发布任务Vo + */ +export interface ReleaseTaskVO{ + + id?: number; + /** + * 任务类型 + */ + taskType?: string; + /** + * 更新方式 + */ + way?: string; + + /** + * 上架状态 + */ + listStatus?: string; + + /** + * 图书类目 + */ + bookCategory?: string; + + /** + * 指定类目 + */ + appointCategory?: string; + + /** + * 店铺选择 + */ + shopIds?: string; +} + + +/** + * 在ShopVO接口中添加expiration和name字段 + */ +export interface ShopVO extends BaseEntity { + id: string | number; + shopName: string; + expiration: string; // 添加过期时间字段 +} + +/** + * 在ShopDetailVO接口中添加saleTemplateId字段 + */ +export interface ShopDetailVO extends BaseEntity { + id: string | number + saleTemplateId: string | number; // 添加价格模板ID字段 + // 其他原有字段... +} \ No newline at end of file diff --git a/src/api/zhishu/userAccount/index.ts b/src/api/zhishu/userAccount/index.ts new file mode 100644 index 0000000..16a1e29 --- /dev/null +++ b/src/api/zhishu/userAccount/index.ts @@ -0,0 +1,71 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { UserAccountVO, UserAccountForm, UserAccountQuery } from '@/api/zhishu/userAccount/types'; + +/** + * 查询账号管理列表 + * @param query + * @returns {*} + */ + +export const listUserAccount = (query?: UserAccountQuery): AxiosPromise => { + return request({ + url: '/zhishu/userAccount/list', + method: 'get', + params: query + }); +}; + +export const listUserAccountNoPage = (query?: UserAccountQuery): AxiosPromise => { + return request({ + url: '/zhishu/userAccount/listNoPage', + method: 'get', + params: query + }); +}; + +/** + * 查询账号管理详细 + * @param id + */ +export const getUserAccount = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/userAccount/' + id, + method: 'get' + }); +}; + +/** + * 新增账号管理 + * @param data + */ +export const addUserAccount = (data: UserAccountForm) => { + return request({ + url: '/zhishu/userAccount', + method: 'post', + data: data + }); +}; + +/** + * 修改账号管理 + * @param data + */ +export const updateUserAccount = (data: UserAccountForm) => { + return request({ + url: '/zhishu/userAccount', + method: 'put', + data: data + }); +}; + +/** + * 删除账号管理 + * @param id + */ +export const delUserAccount = (id: string | number | Array) => { + return request({ + url: '/zhishu/userAccount/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/userAccount/types.ts b/src/api/zhishu/userAccount/types.ts new file mode 100644 index 0000000..1547e6a --- /dev/null +++ b/src/api/zhishu/userAccount/types.ts @@ -0,0 +1,116 @@ +export interface UserAccountVO { + /** + * + */ + id: string | number; + + /** + * 出入帐账户类型 0 出账 1 入账 + */ + type: string; + + /** + * 账号类型 + */ + accountType: string; + + /** + * 账号名称 + */ + accountName: string; + + /** + * 账号 + */ + account: string; + + /** + * 是否默认账号 0 否 1 是 + */ + isDefault: string; + + /** + * 店铺状态(0正常 1停用) + */ + status: string; + +} + +export interface UserAccountForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 出入帐账户类型 0 出账 1 入账 + */ + type?: string; + + /** + * 账号类型 + */ + accountType?: string; + + /** + * 账号名称 + */ + accountName?: string; + + /** + * 账号 + */ + account?: string; + + /** + * 是否默认账号 0 否 1 是 + */ + isDefault?: string; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + +} + +export interface UserAccountQuery extends PageQuery { + + /** + * 出入帐账户类型 0 出账 1 入账 + */ + type?: string; + + /** + * 账号类型 + */ + accountType?: string; + + /** + * 账号名称 + */ + accountName?: string; + + /** + * 账号 + */ + account?: string; + + /** + * 是否默认账号 0 否 1 是 + */ + isDefault?: string; + + /** + * 店铺状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/zhishu/userAudit/index.ts b/src/api/zhishu/userAudit/index.ts new file mode 100644 index 0000000..a0b8036 --- /dev/null +++ b/src/api/zhishu/userAudit/index.ts @@ -0,0 +1,78 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { UserAuditVO, UserAuditForm, UserAuditQuery } from '@/api/zhishu/userAudit/types'; +import { AuditVO } from '@/api/zhishu/audit/types'; + +/** + * 查询列表列表 + * @param query + * @returns {*} + */ + +export const listUserAudit = (query?: UserAuditQuery): AxiosPromise => { + return request({ + url: '/zhishu/userAudit/list', + method: 'get', + params: query + }); +}; + +/** + * 查询列表详细 + * @param id + */ +export const getUserAudit = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/userAudit/' + id, + method: 'get' + }); +}; + +/** + * 新增列表 + * @param data + */ +export const addUserAudit = (data: UserAuditForm) => { + return request({ + url: '/zhishu/userAudit', + method: 'post', + data: data + }); +}; + +/** + * 修改列表 + * @param data + */ +export const updateUserAudit = (data: UserAuditForm) => { + return request({ + url: '/zhishu/userAudit', + method: 'put', + data: data + }); +}; + +/** + * 删除列表 + * @param id + */ +export const delUserAudit = (id: string | number | Array) => { + return request({ + url: '/zhishu/userAudit/' + id, + method: 'delete' + }); +}; + +export const getUAudit = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/userAudit/' + id, + method: 'get' + }); +}; + +export const getAuditLog = (): AxiosPromise => { + return request({ + url: '/zhishu/userAudit/log', + method: 'get' + }); +}; diff --git a/src/api/zhishu/userAudit/types.ts b/src/api/zhishu/userAudit/types.ts new file mode 100644 index 0000000..36cd68f --- /dev/null +++ b/src/api/zhishu/userAudit/types.ts @@ -0,0 +1,300 @@ +export interface UserAuditVO { + /** + * 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; + /** + * 身份证 + */ + cardIdentity:string, + + /** + * 营业执照名称 + */ + + licenseName:string, + + + /** + * 营业执照注册号 + */ + licenseNumber:string, + + + /** + * 营业执照 + */ + license : string; + + /** + * 备注 + */ + remark : string; + + /** + * 用户昵称 + */ + userName : string; + /** + * 地址 + */ + adress:string; + + /** + * 经营许可证 + */ + businessLicense:string; + + /** + * 营业执照过期时间 + */ + licenseTime:string; + + + /** + * 经营许可证过期时间 + */ + businessLicenseTime:string; + +} + +export interface UserAuditForm 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; + /** + * 身份证 + */ + cardIdentity?:string, + + /** + * 营业执照名称 + */ + + licenseName?:string, + + + /** + * 营业执照注册号 + */ + licenseNumber?:string, + + /** + * 地址 + */ + adress?:string, + + /** + * 经营许可证 + */ + businessLicense?:string, + + /** + * 营业执照过期时间 + */ + licenseTime?:string, + + + /** + * 经营许可证过期时间 + */ + businessLicenseTime?:string, + + + /** + * 营业执照 + */ + license?: string; + + /** + * 备注 + */ + remark?: string; + +} + +export interface UserAuditQuery 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; + + /** + * 身份证 + */ + cardIdentity?:string, + + /** + * 营业执照名称 + */ + + licenseName?:string, + + + /** + * 营业执照注册号 + */ + licenseNumber?:string, + + /** + * 地址 + */ + adress?:string, + + /** + * 经营许可证 + */ + businessLicense?:string, + + /** + * 营业执照过期时间 + */ + licenseTime?:string, + + + /** + * 经营许可证过期时间 + */ + businessLicenseTime?:string, + + + + /** + * 营业执照 + */ + license?: string; + + /** + * 备注 + */ + remark?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + diff --git a/src/api/zhishu/userRecharge/index.ts b/src/api/zhishu/userRecharge/index.ts new file mode 100644 index 0000000..ce5dfc1 --- /dev/null +++ b/src/api/zhishu/userRecharge/index.ts @@ -0,0 +1,143 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { UserRechargeVO, UserRechargeForm, UserRechargeQuery } from '@/api/zhishu/userRecharge/types'; + +/** + * 查询用户充值列表 + * @param query + * @returns {*} + */ + +export const listUserRecharge = (query?: UserRechargeQuery): AxiosPromise => { + return request({ + url: '/zhishu/userRecharge/list', + method: 'get', + params: query + }); +}; + +/** + * 查询用户充值详细 + * @param id + */ +export const getUserRecharge = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/userRecharge/' + id, + method: 'get' + }); +}; + +/** + * 新增用户充值 + * @param data + */ +export const addUserRecharge = (data: UserRechargeForm) => { + return request({ + url: '/zhishu/userRecharge', + method: 'post', + data: data + }); +}; + +export const userRecharge = (data: UserRechargeForm) => { + return request({ + url: '/zhishu/userRecharge/userRecharge', + method: 'post', + data: data + }); +}; + +/** + * 余额支付 + * @param data + * @returns + */ +export const balancePayment = (data) => { + return request({ + url: '/zhishu/userRecharge/balancePayment', + method: 'post', + data: data + }); +}; + + +export const review = (data) => { + return request({ + url: '/zhishu/userRecharge/review', + method: 'post', + data: data + }); +} + +/** + * 无手续费支付 + * @param data + * @returns + */ +export const userRechargeNoCommission = (data: UserRechargeForm) => { + debugger; + return request({ + url: '/zhishu/userRecharge/userRechargeNoCommission', + method: 'post', + data: data + }); +}; + +/** + * 钱包充值成功 + * @param data + * @returns + */ +export const addUserBalance = (data: UserRechargeForm) => { + debugger; + return request({ + url: '/zhishu/userRecharge/addUserBalance', + method: 'post', + data: data + }); +}; + +// 根据参数键名查询参数值 +export function getConfigKey(configKey: string) { + return request({ + url: '/zhishu/userRecharge/configKey/' + configKey, + method: 'get' + }); +} + +export const checkTask = (id) => { + return request({ + url: '/zhishu/userRecharge/checkTask/'+id, + method: 'get' + }); +}; + +export const editRechargeToError = (id) => { + return request({ + url: '/zhishu/userRecharge/editRechargeToError/'+id, + method: 'get' + }); +}; + +/** + * 修改用户充值 + * @param data + */ +export const updateUserRecharge = (data: UserRechargeForm) => { + return request({ + url: '/zhishu/userRecharge', + method: 'put', + data: data + }); +}; + +/** + * 删除用户充值 + * @param id + */ +export const delUserRecharge = (id: string | number | Array) => { + return request({ + url: '/zhishu/userRecharge/' + id, + method: 'delete' + }); +}; diff --git a/src/api/zhishu/userRecharge/types.ts b/src/api/zhishu/userRecharge/types.ts new file mode 100644 index 0000000..eb26dc6 --- /dev/null +++ b/src/api/zhishu/userRecharge/types.ts @@ -0,0 +1,255 @@ +export interface UserRechargeVO { + /** + * 主键 + */ + id: string | number; + + /** + * 用户id + */ + userId: string | number; + + /** + * 充值类型 1 微信支付 2 支付宝支付 ... + */ + rechargType: string; + + /** + * 充值金额 单位分 + */ + rechargPrice: number; + + /** + * 支付成功时间 + */ + successTime: string; + + createTime: string; + + /** + * 支付成功后回调方法中数据字符串 + */ + allDataStr: string; + + /** + * 状态(0正常 1停用) + */ + status: string; + + /** + * 手续费 + */ + commission: number; + + /** + * 出账账户 + */ + billingAccount: string; + + /** + * 入账账户 + */ + depositAccount: string; + + /** + * 交易号 + */ + transactionId: string; + + /** + * 备注 + */ + remark: string; + + /** + * 付款凭证 + */ + voucherImg: string; + + /** + * 卡密 + */ + cardKey: string; + + /** + * 日志备注 + */ + logTxt: string; + + originalPrice: number; + + updatePrice: number; +} + +export interface UserRechargeForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + wxId?: string; + + /** + * 用户id + */ + userId?: string | number; + + /** + * 充值类型 1 微信支付 2 支付宝支付 ... + */ + rechargType?: string; + + /** + * 充值金额 单位分 + */ + rechargPrice?: number; + + /** + * 支付成功时间 + */ + successTime?: string; + + createTime?: string; + + /** + * 支付成功后回调方法中数据字符串 + */ + allDataStr?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 手续费 + */ + commission?: number; + + /** + * 出账账户 + */ + billingAccount?: string; + + /** + * 入账账户 + */ + depositAccount?: string; + + /** + * 交易号 + */ + transactionId?: string; + + /** + * 备注 + */ + remark?: string; + + /** + * 付款凭证 + */ + voucherImg?: string; + + /** + * 卡密 + */ + cardKey?: string; + + /** + * 日志备注 + */ + logTxt?: string; + + + originalPrice?: number; + + updatePrice?: number; +} + +export interface UserRechargeQuery extends PageQuery { + + /** + * 用户id + */ + userId?: string | number; + + /** + * 充值类型 1 微信支付 2 支付宝支付 ... + */ + rechargType?: string; + + /** + * 充值金额 单位分 + */ + rechargPrice?: number; + + /** + * 支付成功时间 + */ + successTime?: string; + + createTime?: string; + + /** + * 支付成功后回调方法中数据字符串 + */ + allDataStr?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + /** + * 手续费 + */ + commission?: number; + + /** + * 出账账户 + */ + billingAccount?: string; + + /** + * 入账账户 + */ + depositAccount?: string; + + /** + * 交易号 + */ + transactionId?: string; + + /** + * 备注 + */ + remark?: string; + + /** + * 付款凭证 + */ + voucherImg?: string; + + /** + * 卡密 + */ + cardKey?: string; + + /** + * 日志备注 + */ + logTxt?: string; + + originalPrice?: number; + + updatePrice?: number; +} + + + diff --git a/src/api/zhishu/violation/index.ts b/src/api/zhishu/violation/index.ts new file mode 100644 index 0000000..e576a34 --- /dev/null +++ b/src/api/zhishu/violation/index.ts @@ -0,0 +1,80 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ViolationVO, ViolationForm, ViolationQuery } from '@/api/zhishu/violation/types'; + +/** + * 查询违规列表 + * @param query + * @returns {*} + */ + +export const listViolation = (query?: ViolationQuery): AxiosPromise => { + return request({ + url: '/zhishu/violation/list', + method: 'get', + params: query + }); +}; + +/** + * 查询违规详细 + * @param id + */ +export const getViolation = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/violation/' + id, + method: 'get' + }); +}; + +/** + * 新增违规 + * @param data + */ +export const addViolation = (data: ViolationForm) => { + return request({ + url: '/zhishu/violation', + method: 'post', + data: data + }); +}; + +/** + * 修改违规 + * @param data + */ +export const updateViolation = (data: ViolationForm) => { + return request({ + url: '/zhishu/violation', + method: 'put', + data: data + }); +}; + +/** + * 删除违规 + * @param id + */ +export const delViolation = (id: string | number | Array) => { + return request({ + url: '/zhishu/violation/' + id, + method: 'delete' + }); +}; + +/** + * 修改任务审核状态 + * @param id + * @param type + * @returns + */ +export const editType = (ids,type) => { + return request({ + url: '/zhishu/violation/editType', + method: 'post', + data:{ + "ids":ids, + "type":type + } + }); +} diff --git a/src/api/zhishu/violation/types.ts b/src/api/zhishu/violation/types.ts new file mode 100644 index 0000000..376574a --- /dev/null +++ b/src/api/zhishu/violation/types.ts @@ -0,0 +1,117 @@ +export interface ViolationVO { + /** + * 主键 + */ + id: string | number; + + /** + * 类型 0 isbn 1 书名 2 作者 3 出版社 + */ + type: string; + + /** + * 内容 + */ + content: string; + + /** + * 发起人 + */ + userid: string | number; + + /** + * 是否审核 0 未审核 1 已审核 + */ + review: string; + + /** + * 状态(0正常 1停用) + */ + status: string; + + remark: string; + + name: string; + + sort: string; +} + +export interface ViolationForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 类型 0 isbn 1 书名 2 作者 3 出版社 + */ + type?: string; + + /** + * 内容 + */ + content?: string; + + /** + * 发起人 + */ + userid?: string | number; + + /** + * 是否审核 0 未审核 1 已审核 + */ + review?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + remark?: string; + + name?: string; + + sort?: string; +} + +export interface ViolationQuery extends PageQuery { + + /** + * 类型 0 isbn 1 书名 2 作者 3 出版社 + */ + type?: string; + + /** + * 内容 + */ + content?: string; + + /** + * 发起人 + */ + userid?: string | number; + + /** + * 是否审核 0 未审核 1 已审核 + */ + review?: string; + + /** + * 状态(0正常 1停用) + */ + status?: string; + + /** + * 日期范围参数 + */ + params?: any; + + remark?: string; + + name?: string; + + sort?: string; +} + + + diff --git a/src/api/zhishu/warehouseSettings/index.ts b/src/api/zhishu/warehouseSettings/index.ts new file mode 100644 index 0000000..cfedab9 --- /dev/null +++ b/src/api/zhishu/warehouseSettings/index.ts @@ -0,0 +1,87 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { WarehouseSettingsVO, WarehouseSettingsForm, WarehouseSettingsQuery } from '@/api/zhishu/warehouseSettings/types'; + +/** + * 查询设置列表 + * @param query + * @returns {*} + */ + +export const listWarehouseSettings = (query?: WarehouseSettingsQuery): AxiosPromise => { + return request({ + url: '/zhishu/warehouseSettings/list', + method: 'get', + params: query + }); +}; + +/** + * 查询设置详细 + * @param id + */ +export const getWarehouseSettings = (id: string | number): AxiosPromise => { + return request({ + url: '/zhishu/warehouseSettings/' + id, + method: 'get' + }); +}; + +/** + * 新增设置 + * @param data + */ +export const addWarehouseSettings = (data: WarehouseSettingsForm) => { + return request({ + url: '/zhishu/warehouseSettings', + method: 'post', + data: data + }); +}; + +/** + * 修改设置 + * @param data + */ +export const updateWarehouseSettings = (data: WarehouseSettingsForm) => { + return request({ + url: '/zhishu/warehouseSettings', + method: 'put', + data: data + }); +}; + +/** + * 修改设置状态 + * @param data + * @returns + */ +export const updateWarehouseSettingsStatus = (data: WarehouseSettingsForm) => { + return request({ + url: '/zhishu/warehouseSettings/editStatus', + method: 'put', + data: data + }); +}; + + +/** + * 删除设置 + * @param id + */ +export const delWarehouseSettings = (id: string | number | Array) => { + return request({ + url: '/zhishu/warehouseSettings/' + id, + method: 'delete' + }); +}; + +/** + * 获取匹配规则设置 + */ +export const getWarehouseSettingsAttribute = () => { + return request({ + url: '/zhishu/warehouseSettingAttribute/getList', + method: 'get' + }); +}; diff --git a/src/api/zhishu/warehouseSettings/types.ts b/src/api/zhishu/warehouseSettings/types.ts new file mode 100644 index 0000000..964597e --- /dev/null +++ b/src/api/zhishu/warehouseSettings/types.ts @@ -0,0 +1,242 @@ +import { UntilBaseInstance } from "@vueuse/core"; + +export interface WarehouseSettingsVO { + /** + * + */ + id: string | number; + + /** + * 设置模板名称 + */ + settingName: string; + + /** + * 库存同步形式 0 下单减库存 1 支付减库存 + */ + stockSynchronizeType: number; + + /** + * 是否自动下发 0 否 1 是 + */ + autoIssue: number; + + /** + * 是否开启亏损保护 + */ + lossProtection: number; + + /** + * 利润下限 + */ + profitFloor: number; + + /** + * 是否启用 0 否 1 是 + */ + status: number; + + /** + * 是否删除 0 否 1 是 + */ + delFlag: number; + + /** + * 退款后是否自动回退库存 0否 1是 + */ + stockRollback: number; + + /** + * 创建人id + */ + createBy: number; + + /** + * 创建时间时间戳 + */ + createAt: number; + + /** + * 修改人id + */ + updateBy: number; + + /** + * 修改时间时间戳 + */ + updateAt: number; + + /** + * 应用店铺ids + */ + shopIds: string; + + /** + * 规则列表字符串 + */ + userSettingsAttributeListStr: string; +} + +export interface WarehouseSettingsForm extends BaseEntity { + /** + * + */ + id?: string | number; + + /** + * 设置模板名称 + */ + settingName?: string; + + /** + * 库存同步形式 0 下单减库存 1 支付减库存 + */ + stockSynchronizeType?: number; + + /** + * 是否自动下发 0 否 1 是 + */ + autoIssue?: number; + + /** + * 是否开启亏损保护 + */ + lossProtection?: number; + + /** + * 利润下限 + */ + profitFloor?: number; + + /** + * 是否启用 0 否 1 是 + */ + status?: number; + + /** + * 是否删除 0 否 1 是 + */ + delFlag?: number; + + /** + * 退款后是否自动回退库存 0否 1是 + */ + stockRollback?: number; + + /** + * 创建人id + */ + createBy?: number; + + /** + * 创建时间时间戳 + */ + createAt?: number; + + /** + * 修改人id + */ + updateBy?: number; + + /** + * 修改时间时间戳 + */ + updateAt?: number; + + /** + * 应用店铺ids + */ + shopIds?: string; + + /** + * 规则列表字符串 + */ + userSettingsAttributeListStr?: string; + + ruleList?: { + id?: number; + attributeId?: number; + attributeValue?: string; + }[]; +} + +export interface WarehouseSettingsQuery extends PageQuery { + + /** + * 设置模板名称 + */ + settingName?: string; + + /** + * 库存同步形式 0 下单减库存 1 支付减库存 + */ + stockSynchronizeType?: number; + + /** + * 是否自动下发 0 否 1 是 + */ + autoIssue?: number; + + /** + * 是否开启亏损保护 + */ + lossProtection?: number; + + /** + * 利润下限 + */ + profitFloor?: number; + + /** + * 是否启用 0 否 1 是 + */ + status?: number; + + /** + * 是否删除 0 否 1 是 + */ + delFlag?: number; + + /** + * 退款后是否自动回退库存 0否 1是 + */ + stockRollback?: number; + + /** + * 创建人id + */ + createBy?: number; + + /** + * 创建时间时间戳 + */ + createAt?: number; + + /** + * 修改人id + */ + updateBy?: number; + + /** + * 修改时间时间戳 + */ + updateAt?: number; + + /** + * 应用店铺ids + */ + shopIds?: string; + + /** + * 规则列表字符串 + */ + userSettingsAttributeListStr?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/zhishu/wave/index.ts b/src/api/zhishu/wave/index.ts new file mode 100644 index 0000000..447f228 --- /dev/null +++ b/src/api/zhishu/wave/index.ts @@ -0,0 +1,21 @@ +import request from '@/utils/request'; + +/** + * 查询员工ID + */ +export const getStaffId = () => { + return request({ + url: '/wave/api/getStaffId', + method: 'get' + }); +}; + +/** + * 查询员工姓名 + */ +export const getStaffName = (staffId) => { + return request({ + url: `/wave/api/getStaffName/${staffId}`, + method: 'get' + }); +}; diff --git a/src/api/zhishu/xy/index.ts b/src/api/zhishu/xy/index.ts new file mode 100644 index 0000000..7d17cbb --- /dev/null +++ b/src/api/zhishu/xy/index.ts @@ -0,0 +1,49 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { ShelvesVO } from '@/api/zhishu/shelves/types'; +import { FreightVO } from '@/api/zhishu/freight/types'; +import { XyBindPageResult, XyBindQuery, XyBindVo } from '@/api/zhishu/xy/types'; +import { ShopVO } from '@/api/zhishu/shop/types'; + +export const tokenSq = (code,shopName,token,shopKey) => { + return request({ + url: '/xy/api/tokenSq/'+code+'/'+shopName+'/'+token+'/'+shopKey, + method: 'get' + }); +}; + +export const listXyBind = (query: XyBindQuery): AxiosPromise => { + return request({ + url: '/xy/api/list', + method: 'get', + params: query + }); +}; + +export const updateXyBind = (token, appName) => { + return request({ + url: '/xy/api/updateXyBind/'+token+'/'+appName, + method: 'get' + }); +}; + +export const insertXyBlind = (appName, mallId, token) => { + return request({ + url: '/xy/api/insertBlind/'+appName+'/'+mallId+'/'+token, + method: 'get' + }); +}; + +export const deleteXyBind = (token) => { + return request({ + url: '/xy/api/deleteXyBind/'+token, + method: 'get' + }); +}; + +export const syncShop = (appName, mallId, token) => { + return request({ + url: '/xy/api/syncShop/'+appName+'/'+mallId+'/'+token , + method: 'get' + }); +}; diff --git a/src/api/zhishu/xy/types.ts b/src/api/zhishu/xy/types.ts new file mode 100644 index 0000000..3931364 --- /dev/null +++ b/src/api/zhishu/xy/types.ts @@ -0,0 +1,44 @@ +/* 绑定信息VO */ +export interface XyBindVo { + /** ID */ + id: number; + /** 闲管家名称 */ + appName?: string; + /** 闲管家应用id */ + mallId?: number; + /** 闲管家应用密钥 */ + token?: string; + /** 创建者 */ + createBy?: string; + /** 创建时间 */ + createTime?: string; + /** 更新者 */ + updateBy?: string; + /** 更新时间 */ + updateTime?: string; +} + +/* 绑定信息BO */ +export interface XyBindForm { + /** 闲管家名称 */ + appName?: string; + /** 闲管家应用id */ + mallId?: number; + /** 闲管家应用密钥 */ + token?: string; + shopKey?: string; +} + +/* 分页查询参数 */ +export interface XyBindQuery extends PageQuery { + /** 创建者 */ + createBy: string; +} + +/* 分页响应 */ +export interface XyBindPageResult { + /** 数据列表 */ + rows: XyBindVo[]; + /** 总记录数 */ + total: number; +} diff --git a/src/api/zhishu/xyCategory/types.ts b/src/api/zhishu/xyCategory/types.ts new file mode 100644 index 0000000..1d0c76d --- /dev/null +++ b/src/api/zhishu/xyCategory/types.ts @@ -0,0 +1,14 @@ +export interface XyCategoryVo { + /** + * 行业 + */ + industry?: string | number; + /** + * 类目 + */ + category?: string; + /** + * id + */ + id?: string | number; +} diff --git a/src/assets/401_images/401.gif b/src/assets/401_images/401.gif new file mode 100644 index 0000000..cd6e0d9 Binary files /dev/null and b/src/assets/401_images/401.gif differ diff --git a/src/assets/404_images/404.png b/src/assets/404_images/404.png new file mode 100644 index 0000000..3d8e230 Binary files /dev/null and b/src/assets/404_images/404.png differ diff --git a/src/assets/404_images/404_cloud.png b/src/assets/404_images/404_cloud.png new file mode 100644 index 0000000..c6281d0 Binary files /dev/null and b/src/assets/404_images/404_cloud.png differ diff --git a/src/assets/icons/svg/404.svg b/src/assets/icons/svg/404.svg new file mode 100644 index 0000000..6df5019 --- /dev/null +++ b/src/assets/icons/svg/404.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/bug.svg b/src/assets/icons/svg/bug.svg new file mode 100644 index 0000000..05a150d --- /dev/null +++ b/src/assets/icons/svg/bug.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/build.svg b/src/assets/icons/svg/build.svg new file mode 100644 index 0000000..97c4688 --- /dev/null +++ b/src/assets/icons/svg/build.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/button.svg b/src/assets/icons/svg/button.svg new file mode 100644 index 0000000..904fddc --- /dev/null +++ b/src/assets/icons/svg/button.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/caret-back.svg b/src/assets/icons/svg/caret-back.svg new file mode 100644 index 0000000..9bae722 --- /dev/null +++ b/src/assets/icons/svg/caret-back.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/caret-forward.svg b/src/assets/icons/svg/caret-forward.svg new file mode 100644 index 0000000..1ec3f7d --- /dev/null +++ b/src/assets/icons/svg/caret-forward.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/cascader.svg b/src/assets/icons/svg/cascader.svg new file mode 100644 index 0000000..e256024 --- /dev/null +++ b/src/assets/icons/svg/cascader.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/category.svg b/src/assets/icons/svg/category.svg new file mode 100644 index 0000000..df92526 --- /dev/null +++ b/src/assets/icons/svg/category.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/chart.svg b/src/assets/icons/svg/chart.svg new file mode 100644 index 0000000..27728fb --- /dev/null +++ b/src/assets/icons/svg/chart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/checkbox.svg b/src/assets/icons/svg/checkbox.svg new file mode 100644 index 0000000..013fd3a --- /dev/null +++ b/src/assets/icons/svg/checkbox.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/clipboard.svg b/src/assets/icons/svg/clipboard.svg new file mode 100644 index 0000000..90923ff --- /dev/null +++ b/src/assets/icons/svg/clipboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/code.svg b/src/assets/icons/svg/code.svg new file mode 100644 index 0000000..5f9c5ab --- /dev/null +++ b/src/assets/icons/svg/code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/color.svg b/src/assets/icons/svg/color.svg new file mode 100644 index 0000000..44a81aa --- /dev/null +++ b/src/assets/icons/svg/color.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/company.svg b/src/assets/icons/svg/company.svg new file mode 100644 index 0000000..fcf1394 --- /dev/null +++ b/src/assets/icons/svg/company.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/component.svg b/src/assets/icons/svg/component.svg new file mode 100644 index 0000000..29c3458 --- /dev/null +++ b/src/assets/icons/svg/component.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/dashboard.svg b/src/assets/icons/svg/dashboard.svg new file mode 100644 index 0000000..5317d37 --- /dev/null +++ b/src/assets/icons/svg/dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/date-range.svg b/src/assets/icons/svg/date-range.svg new file mode 100644 index 0000000..fda571e --- /dev/null +++ b/src/assets/icons/svg/date-range.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/date.svg b/src/assets/icons/svg/date.svg new file mode 100644 index 0000000..52dc73e --- /dev/null +++ b/src/assets/icons/svg/date.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/dict.svg b/src/assets/icons/svg/dict.svg new file mode 100644 index 0000000..4849377 --- /dev/null +++ b/src/assets/icons/svg/dict.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/documentation.svg b/src/assets/icons/svg/documentation.svg new file mode 100644 index 0000000..7043122 --- /dev/null +++ b/src/assets/icons/svg/documentation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/download.svg b/src/assets/icons/svg/download.svg new file mode 100644 index 0000000..c896951 --- /dev/null +++ b/src/assets/icons/svg/download.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/drag.svg b/src/assets/icons/svg/drag.svg new file mode 100644 index 0000000..4185d3c --- /dev/null +++ b/src/assets/icons/svg/drag.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/druid.svg b/src/assets/icons/svg/druid.svg new file mode 100644 index 0000000..a2b4b4e --- /dev/null +++ b/src/assets/icons/svg/druid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/edit.svg b/src/assets/icons/svg/edit.svg new file mode 100644 index 0000000..d26101f --- /dev/null +++ b/src/assets/icons/svg/edit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/education.svg b/src/assets/icons/svg/education.svg new file mode 100644 index 0000000..7bfb01d --- /dev/null +++ b/src/assets/icons/svg/education.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/email.svg b/src/assets/icons/svg/email.svg new file mode 100644 index 0000000..74d25e2 --- /dev/null +++ b/src/assets/icons/svg/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/example.svg b/src/assets/icons/svg/example.svg new file mode 100644 index 0000000..46f42b5 --- /dev/null +++ b/src/assets/icons/svg/example.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/excel.svg b/src/assets/icons/svg/excel.svg new file mode 100644 index 0000000..74d97b8 --- /dev/null +++ b/src/assets/icons/svg/excel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/exit-fullscreen.svg b/src/assets/icons/svg/exit-fullscreen.svg new file mode 100644 index 0000000..485c128 --- /dev/null +++ b/src/assets/icons/svg/exit-fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/eye-open.svg b/src/assets/icons/svg/eye-open.svg new file mode 100644 index 0000000..88dcc98 --- /dev/null +++ b/src/assets/icons/svg/eye-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/eye.svg b/src/assets/icons/svg/eye.svg new file mode 100644 index 0000000..16ed2d8 --- /dev/null +++ b/src/assets/icons/svg/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/finish.svg b/src/assets/icons/svg/finish.svg new file mode 100644 index 0000000..4685c23 --- /dev/null +++ b/src/assets/icons/svg/finish.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/form.svg b/src/assets/icons/svg/form.svg new file mode 100644 index 0000000..dcbaa18 --- /dev/null +++ b/src/assets/icons/svg/form.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/fullscreen.svg b/src/assets/icons/svg/fullscreen.svg new file mode 100644 index 0000000..0e86b6f --- /dev/null +++ b/src/assets/icons/svg/fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/gitee.svg b/src/assets/icons/svg/gitee.svg new file mode 100644 index 0000000..6324608 --- /dev/null +++ b/src/assets/icons/svg/gitee.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/svg/github.svg b/src/assets/icons/svg/github.svg new file mode 100644 index 0000000..db0a0d4 --- /dev/null +++ b/src/assets/icons/svg/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/guide.svg b/src/assets/icons/svg/guide.svg new file mode 100644 index 0000000..b271001 --- /dev/null +++ b/src/assets/icons/svg/guide.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/icon.svg b/src/assets/icons/svg/icon.svg new file mode 100644 index 0000000..1f1d22b --- /dev/null +++ b/src/assets/icons/svg/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/input.svg b/src/assets/icons/svg/input.svg new file mode 100644 index 0000000..ab91381 --- /dev/null +++ b/src/assets/icons/svg/input.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/international.svg b/src/assets/icons/svg/international.svg new file mode 100644 index 0000000..e9b56ee --- /dev/null +++ b/src/assets/icons/svg/international.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/job.svg b/src/assets/icons/svg/job.svg new file mode 100644 index 0000000..2a93a25 --- /dev/null +++ b/src/assets/icons/svg/job.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/language.svg b/src/assets/icons/svg/language.svg new file mode 100644 index 0000000..0082b57 --- /dev/null +++ b/src/assets/icons/svg/language.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/link.svg b/src/assets/icons/svg/link.svg new file mode 100644 index 0000000..48197ba --- /dev/null +++ b/src/assets/icons/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/list.svg b/src/assets/icons/svg/list.svg new file mode 100644 index 0000000..20259ed --- /dev/null +++ b/src/assets/icons/svg/list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/lock.svg b/src/assets/icons/svg/lock.svg new file mode 100644 index 0000000..74fee54 --- /dev/null +++ b/src/assets/icons/svg/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/log.svg b/src/assets/icons/svg/log.svg new file mode 100644 index 0000000..d879d33 --- /dev/null +++ b/src/assets/icons/svg/log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/logininfor.svg b/src/assets/icons/svg/logininfor.svg new file mode 100644 index 0000000..267f844 --- /dev/null +++ b/src/assets/icons/svg/logininfor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/maxkey.svg b/src/assets/icons/svg/maxkey.svg new file mode 100644 index 0000000..f8f8a7d --- /dev/null +++ b/src/assets/icons/svg/maxkey.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/icons/svg/message.svg b/src/assets/icons/svg/message.svg new file mode 100644 index 0000000..14ca817 --- /dev/null +++ b/src/assets/icons/svg/message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/model.svg b/src/assets/icons/svg/model.svg new file mode 100644 index 0000000..0c57d70 --- /dev/null +++ b/src/assets/icons/svg/model.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/money.svg b/src/assets/icons/svg/money.svg new file mode 100644 index 0000000..c1580de --- /dev/null +++ b/src/assets/icons/svg/money.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/monitor.svg b/src/assets/icons/svg/monitor.svg new file mode 100644 index 0000000..bc308cb --- /dev/null +++ b/src/assets/icons/svg/monitor.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/my-copy.svg b/src/assets/icons/svg/my-copy.svg new file mode 100644 index 0000000..49f69fa --- /dev/null +++ b/src/assets/icons/svg/my-copy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/my-task.svg b/src/assets/icons/svg/my-task.svg new file mode 100644 index 0000000..1f1ea44 --- /dev/null +++ b/src/assets/icons/svg/my-task.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/nested.svg b/src/assets/icons/svg/nested.svg new file mode 100644 index 0000000..06713a8 --- /dev/null +++ b/src/assets/icons/svg/nested.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/number.svg b/src/assets/icons/svg/number.svg new file mode 100644 index 0000000..ad5ce9a --- /dev/null +++ b/src/assets/icons/svg/number.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/online.svg b/src/assets/icons/svg/online.svg new file mode 100644 index 0000000..330a202 --- /dev/null +++ b/src/assets/icons/svg/online.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/password.svg b/src/assets/icons/svg/password.svg new file mode 100644 index 0000000..6c64def --- /dev/null +++ b/src/assets/icons/svg/password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/pdd.svg b/src/assets/icons/svg/pdd.svg new file mode 100644 index 0000000..6c57308 --- /dev/null +++ b/src/assets/icons/svg/pdd.svg @@ -0,0 +1 @@ + diff --git a/src/assets/icons/svg/pdf.svg b/src/assets/icons/svg/pdf.svg new file mode 100644 index 0000000..957aa0c --- /dev/null +++ b/src/assets/icons/svg/pdf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/people.svg b/src/assets/icons/svg/people.svg new file mode 100644 index 0000000..2bd54ae --- /dev/null +++ b/src/assets/icons/svg/people.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/peoples.svg b/src/assets/icons/svg/peoples.svg new file mode 100644 index 0000000..aab852e --- /dev/null +++ b/src/assets/icons/svg/peoples.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/phone.svg b/src/assets/icons/svg/phone.svg new file mode 100644 index 0000000..ab8e8c4 --- /dev/null +++ b/src/assets/icons/svg/phone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/post.svg b/src/assets/icons/svg/post.svg new file mode 100644 index 0000000..2922c61 --- /dev/null +++ b/src/assets/icons/svg/post.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/process-definition.svg b/src/assets/icons/svg/process-definition.svg new file mode 100644 index 0000000..202d200 --- /dev/null +++ b/src/assets/icons/svg/process-definition.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/qq.svg b/src/assets/icons/svg/qq.svg new file mode 100644 index 0000000..ee13d4e --- /dev/null +++ b/src/assets/icons/svg/qq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/question.svg b/src/assets/icons/svg/question.svg new file mode 100644 index 0000000..cf75bd4 --- /dev/null +++ b/src/assets/icons/svg/question.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/radio.svg b/src/assets/icons/svg/radio.svg new file mode 100644 index 0000000..0cde345 --- /dev/null +++ b/src/assets/icons/svg/radio.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/rate.svg b/src/assets/icons/svg/rate.svg new file mode 100644 index 0000000..aa3b14d --- /dev/null +++ b/src/assets/icons/svg/rate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/redis-list.svg b/src/assets/icons/svg/redis-list.svg new file mode 100644 index 0000000..98a15b2 --- /dev/null +++ b/src/assets/icons/svg/redis-list.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/redis.svg b/src/assets/icons/svg/redis.svg new file mode 100644 index 0000000..2f1d62d --- /dev/null +++ b/src/assets/icons/svg/redis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/row.svg b/src/assets/icons/svg/row.svg new file mode 100644 index 0000000..0780992 --- /dev/null +++ b/src/assets/icons/svg/row.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/search.svg b/src/assets/icons/svg/search.svg new file mode 100644 index 0000000..84233dd --- /dev/null +++ b/src/assets/icons/svg/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/select.svg b/src/assets/icons/svg/select.svg new file mode 100644 index 0000000..d628382 --- /dev/null +++ b/src/assets/icons/svg/select.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/server.svg b/src/assets/icons/svg/server.svg new file mode 100644 index 0000000..eb287e3 --- /dev/null +++ b/src/assets/icons/svg/server.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/shopping.svg b/src/assets/icons/svg/shopping.svg new file mode 100644 index 0000000..87513e7 --- /dev/null +++ b/src/assets/icons/svg/shopping.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/size.svg b/src/assets/icons/svg/size.svg new file mode 100644 index 0000000..ddb25b8 --- /dev/null +++ b/src/assets/icons/svg/size.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/skill.svg b/src/assets/icons/svg/skill.svg new file mode 100644 index 0000000..a3b7312 --- /dev/null +++ b/src/assets/icons/svg/skill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/slider.svg b/src/assets/icons/svg/slider.svg new file mode 100644 index 0000000..fbe4f39 --- /dev/null +++ b/src/assets/icons/svg/slider.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/star.svg b/src/assets/icons/svg/star.svg new file mode 100644 index 0000000..6cf86e6 --- /dev/null +++ b/src/assets/icons/svg/star.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/swagger.svg b/src/assets/icons/svg/swagger.svg new file mode 100644 index 0000000..05d4e7b --- /dev/null +++ b/src/assets/icons/svg/swagger.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/switch.svg b/src/assets/icons/svg/switch.svg new file mode 100644 index 0000000..0ba61e3 --- /dev/null +++ b/src/assets/icons/svg/switch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/system.svg b/src/assets/icons/svg/system.svg new file mode 100644 index 0000000..5992593 --- /dev/null +++ b/src/assets/icons/svg/system.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/tab.svg b/src/assets/icons/svg/tab.svg new file mode 100644 index 0000000..b4b48e4 --- /dev/null +++ b/src/assets/icons/svg/tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/table.svg b/src/assets/icons/svg/table.svg new file mode 100644 index 0000000..0e3dc9d --- /dev/null +++ b/src/assets/icons/svg/table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/textarea.svg b/src/assets/icons/svg/textarea.svg new file mode 100644 index 0000000..2709f29 --- /dev/null +++ b/src/assets/icons/svg/textarea.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/theme.svg b/src/assets/icons/svg/theme.svg new file mode 100644 index 0000000..5982a2f --- /dev/null +++ b/src/assets/icons/svg/theme.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/time-range.svg b/src/assets/icons/svg/time-range.svg new file mode 100644 index 0000000..13c1202 --- /dev/null +++ b/src/assets/icons/svg/time-range.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/time.svg b/src/assets/icons/svg/time.svg new file mode 100644 index 0000000..b376e32 --- /dev/null +++ b/src/assets/icons/svg/time.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/tool.svg b/src/assets/icons/svg/tool.svg new file mode 100644 index 0000000..48e0e35 --- /dev/null +++ b/src/assets/icons/svg/tool.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/topiam.svg b/src/assets/icons/svg/topiam.svg new file mode 100644 index 0000000..e7ea057 --- /dev/null +++ b/src/assets/icons/svg/topiam.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/icons/svg/tree-table.svg b/src/assets/icons/svg/tree-table.svg new file mode 100644 index 0000000..8aafdb8 --- /dev/null +++ b/src/assets/icons/svg/tree-table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/tree.svg b/src/assets/icons/svg/tree.svg new file mode 100644 index 0000000..dd4b7dd --- /dev/null +++ b/src/assets/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/upload.svg b/src/assets/icons/svg/upload.svg new file mode 100644 index 0000000..bae49c0 --- /dev/null +++ b/src/assets/icons/svg/upload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/user.svg b/src/assets/icons/svg/user.svg new file mode 100644 index 0000000..0ba0716 --- /dev/null +++ b/src/assets/icons/svg/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/validCode.svg b/src/assets/icons/svg/validCode.svg new file mode 100644 index 0000000..cfb1021 --- /dev/null +++ b/src/assets/icons/svg/validCode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/waiting.svg b/src/assets/icons/svg/waiting.svg new file mode 100644 index 0000000..2c2042d --- /dev/null +++ b/src/assets/icons/svg/waiting.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/wechat.svg b/src/assets/icons/svg/wechat.svg new file mode 100644 index 0000000..c586e55 --- /dev/null +++ b/src/assets/icons/svg/wechat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/workflow.svg b/src/assets/icons/svg/workflow.svg new file mode 100644 index 0000000..2f7423a --- /dev/null +++ b/src/assets/icons/svg/workflow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/zip.svg b/src/assets/icons/svg/zip.svg new file mode 100644 index 0000000..f806fc4 --- /dev/null +++ b/src/assets/icons/svg/zip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/images/dark.svg b/src/assets/images/dark.svg new file mode 100644 index 0000000..f646bd7 --- /dev/null +++ b/src/assets/images/dark.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/images/freight-template.svg b/src/assets/images/freight-template.svg new file mode 100644 index 0000000..c1d0c7e --- /dev/null +++ b/src/assets/images/freight-template.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/assets/images/light.svg b/src/assets/images/light.svg new file mode 100644 index 0000000..ab7cc08 --- /dev/null +++ b/src/assets/images/light.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/images/login-background.jpg b/src/assets/images/login-background.jpg new file mode 100644 index 0000000..fa6408b Binary files /dev/null and b/src/assets/images/login-background.jpg differ diff --git a/src/assets/images/profile-log.jpg b/src/assets/images/profile-log.jpg new file mode 100644 index 0000000..f4fde57 Binary files /dev/null and b/src/assets/images/profile-log.jpg differ diff --git a/src/assets/images/profile.jpg b/src/assets/images/profile.jpg new file mode 100644 index 0000000..2f889e6 Binary files /dev/null and b/src/assets/images/profile.jpg differ diff --git a/src/assets/images/shop-types/kfz.png b/src/assets/images/shop-types/kfz.png new file mode 100644 index 0000000..1efe276 Binary files /dev/null and b/src/assets/images/shop-types/kfz.png differ diff --git a/src/assets/images/shop-types/pdd.png b/src/assets/images/shop-types/pdd.png new file mode 100644 index 0000000..85d47f9 Binary files /dev/null and b/src/assets/images/shop-types/pdd.png differ diff --git a/src/assets/images/shop-types/xy.png b/src/assets/images/shop-types/xy.png new file mode 100644 index 0000000..a14bee8 Binary files /dev/null and b/src/assets/images/shop-types/xy.png differ diff --git a/src/assets/images/white.png b/src/assets/images/white.png new file mode 100644 index 0000000..21160db Binary files /dev/null and b/src/assets/images/white.png differ diff --git a/src/assets/images/yunda.png b/src/assets/images/yunda.png new file mode 100644 index 0000000..fc53856 Binary files /dev/null and b/src/assets/images/yunda.png differ diff --git a/src/assets/logo/logo.png b/src/assets/logo/logo.png new file mode 100644 index 0000000..3f919d8 Binary files /dev/null and b/src/assets/logo/logo.png differ diff --git a/src/assets/styles/btn.scss b/src/assets/styles/btn.scss new file mode 100644 index 0000000..a1ccd01 --- /dev/null +++ b/src/assets/styles/btn.scss @@ -0,0 +1,99 @@ +@import './variables.module.scss'; + +@mixin colorBtn($color) { + background: $color; + + &:hover { + color: $color; + + &:before, + &:after { + background: $color; + } + } +} + +.blue-btn { + @include colorBtn($blue); +} + +.light-blue-btn { + @include colorBtn($light-blue); +} + +.red-btn { + @include colorBtn($red); +} + +.pink-btn { + @include colorBtn($pink); +} + +.green-btn { + @include colorBtn($green); +} + +.tiffany-btn { + @include colorBtn($tiffany); +} + +.yellow-btn { + @include colorBtn($yellow); +} + +.pan-btn { + font-size: 14px; + color: #fff; + padding: 14px 36px; + border-radius: 8px; + border: none; + outline: none; + transition: 600ms ease all; + position: relative; + display: inline-block; + + &:hover { + background: #fff; + + &:before, + &:after { + width: 100%; + transition: 600ms ease all; + } + } + + &:before, + &:after { + content: ''; + position: absolute; + top: 0; + right: 0; + height: 2px; + width: 0; + transition: 400ms ease all; + } + + &::after { + right: inherit; + top: inherit; + left: 0; + bottom: 0; + } +} + +.custom-button { + display: inline-block; + line-height: 1; + white-space: nowrap; + cursor: pointer; + background: #fff; + color: #fff; + -webkit-appearance: none; + text-align: center; + box-sizing: border-box; + outline: 0; + margin: 0; + padding: 10px 15px; + font-size: 14px; + border-radius: 4px; +} diff --git a/src/assets/styles/element-ui.scss b/src/assets/styles/element-ui.scss new file mode 100644 index 0000000..e38c703 --- /dev/null +++ b/src/assets/styles/element-ui.scss @@ -0,0 +1,153 @@ +.el-collapse { + .collapse__title { + font-weight: 600; + padding: 0 8px; + font-size: 1.2em; + line-height: 1.1em; + } + .el-collapse-item__content { + padding: 0 8px; + } +} + +.el-divider--horizontal { + margin-bottom: 10px; + margin-top: 10px; +} + +.el-breadcrumb__inner, +.el-breadcrumb__inner a { + font-weight: 400 !important; +} + +.el-upload { + input[type='file'] { + display: none !important; + } +} + +.el-upload__input { + display: none; +} + +.cell { + .el-tag { + margin-right: 0px; + } +} + +.small-padding { + .cell { + padding-left: 5px; + padding-right: 5px; + } +} + +.fixed-width { + .el-button--mini { + padding: 7px 10px; + width: 60px; + } +} + +.status-col { + .cell { + padding: 0 10px; + text-align: center; + + .el-tag { + margin-right: 0px; + } + } +} + +/*-------------Dialog-------------**/ +.el-overlay { + overflow: hidden; + + .el-overlay-dialog { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + + .el-dialog { + margin: 0 auto !important; + + .el-dialog__body { + padding: 15px !important; + } + .el-dialog__header { + padding: 16px 16px 8px 16px; + box-sizing: border-box; + border-bottom: 1px solid var(--brder-color); + margin-right: 0; + } + } + } +} + +.el-dialog__body { + max-height: calc(90vh - 111px) !important; + overflow-y: auto; + overflow-x: hidden; +} + +// refine element ui upload +.upload-container { + .el-upload { + width: 100%; + + .el-upload-dragger { + width: 100%; + height: 200px; + } + } +} + +// dropdown +.el-dropdown-menu { + a { + display: block; + } +} + +// fix date-picker ui bug in filter-item +.el-range-editor.el-input__inner { + display: inline-flex !important; +} + +// to fix el-date-picker css style +.el-range-separator { + box-sizing: content-box; +} + +.el-menu--collapse > div > .el-submenu > .el-submenu__title .el-submenu__icon-arrow { + display: none; +} + +.el-dropdown .el-dropdown-link { + color: var(--el-color-primary) !important; +} + +/* 当 el-form 的 inline 属性为 true 时 */ +/* 设置 label 的宽度默认为 68px */ +.el-form--inline .el-form-item__label { + width: 68px; +} + +/* 设置 el-select 的宽度默认为 240px */ +.el-form--inline .el-select { + width: 240px; +} + +/* 设置 el-input 的宽度默认为 240px */ +.el-form--inline .el-input { + width: 240px; +} + +/* 设置 el-message-box 消息弹框内容强制换行 */ +.el-message-box .el-message-box__message { + word-break: break-word; +} diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss new file mode 100644 index 0000000..aa3f165 --- /dev/null +++ b/src/assets/styles/index.scss @@ -0,0 +1,225 @@ +@import './variables.module.scss'; +@import './mixin.scss'; +@import './transition.scss'; +@import './element-ui.scss'; +@import './sidebar.scss'; +@import './btn.scss'; +@import './ruoyi.scss'; +@import 'animate.css'; +@import 'element-plus/dist/index.css'; + +body { + height: 100%; + margin: 0; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: + Helvetica Neue, + Helvetica, + PingFang SC, + Hiragino Sans GB, + Microsoft YaHei, + Arial, + sans-serif; +} + +.el-upload-list--picture-card .el-upload-list__item { + width: 80px !important; + height: 80px !important; +} + +.el-upload--picture-card { + width: 80px !important; + height: 80px !important; +} + +label { + font-weight: 700; +} + +html { + height: 100%; + box-sizing: border-box; +} + +html.dark .svg-icon, +html.dark svg { + fill: var(--el-text-color-regular); +} + +#app { + height: 100%; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +.no-padding { + padding: 0px !important; +} + +.padding-content { + padding: 4px 0; +} + +a:focus, +a:active { + outline: none; +} + +a, +a:focus, +a:hover { + cursor: pointer; + color: inherit; + text-decoration: none; +} + +div:focus { + outline: none; +} + +.fr { + float: right; +} + +.fl { + float: left; +} + +.pr-5 { + padding-right: 5px; +} + +.pl-5 { + padding-left: 5px; +} + +.block { + display: block; +} + +.pointer { + cursor: pointer; +} + +.inlineBlock { + display: block; +} + +.clearfix { + &:after { + visibility: hidden; + display: block; + font-size: 0; + content: ' '; + clear: both; + height: 0; + } +} + +aside { + background: #eef1f6; + padding: 8px 24px; + margin-bottom: 20px; + border-radius: 2px; + display: block; + line-height: 32px; + font-size: 16px; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; + color: #2c3e50; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + a { + color: #337ab7; + cursor: pointer; + + &:hover { + color: rgb(32, 160, 255); + } + } +} + +//main-container全局样式 +.app-container { + padding: 20px; +} + +// search面板样式 +.panel, +.search { + margin-bottom: 0.75rem; + border-radius: 0.25rem; + border: 1px solid var(--el-border-color-light); + background-color: var(--el-bg-color-overlay); + padding: 0.75rem; + transition: all ease 0.3s; + + &:hover { + box-shadow: 0 2px 12px #0000001a; + transition: all ease 0.3s; + } +} + +.components-container { + margin: 30px 50px; + position: relative; +} + +.pagination-container { + margin-top: 30px; +} + +.text-center { + text-align: center; +} + +.sub-navbar { + height: 50px; + line-height: 50px; + position: relative; + width: 100%; + text-align: right; + padding-right: 20px; + transition: 600ms ease position; + background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%); + + .subtitle { + font-size: 20px; + color: #fff; + } + + &.draft { + background: #d0d0d0; + } + + &.deleted { + background: #d0d0d0; + } +} + +.link-type, +.link-type:focus { + color: #337ab7; + cursor: pointer; + + &:hover { + color: rgb(32, 160, 255); + } +} + +.filter-container { + padding-bottom: 10px; + + .filter-item { + display: inline-block; + vertical-align: middle; + margin-bottom: 10px; + } +} \ No newline at end of file diff --git a/src/assets/styles/mixin.scss b/src/assets/styles/mixin.scss new file mode 100644 index 0000000..5250e71 --- /dev/null +++ b/src/assets/styles/mixin.scss @@ -0,0 +1,60 @@ +@mixin clearfix { + &:after { + content: ''; + display: table; + clear: both; + } +} + +@mixin scrollBar { + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } +} + +@mixin relative { + position: relative; + width: 100%; + height: 100%; +} + +@mixin pct($pct) { + width: #{$pct}; + position: relative; + margin: 0 auto; +} + +@mixin triangle($width, $height, $color, $direction) { + $width: $width/2; + $color-border-style: $height solid $color; + $transparent-border-style: $width solid transparent; + height: 0; + width: 0; + + @if $direction==up { + border-bottom: $color-border-style; + border-left: $transparent-border-style; + border-right: $transparent-border-style; + } @else if $direction==right { + border-left: $color-border-style; + border-top: $transparent-border-style; + border-bottom: $transparent-border-style; + } @else if $direction==down { + border-top: $color-border-style; + border-left: $transparent-border-style; + border-right: $transparent-border-style; + } @else if $direction==left { + border-right: $color-border-style; + border-top: $transparent-border-style; + border-bottom: $transparent-border-style; + } +} diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss new file mode 100644 index 0000000..d2ecb24 --- /dev/null +++ b/src/assets/styles/ruoyi.scss @@ -0,0 +1,290 @@ +/** + * 通用css样式布局处理 + * Copyright (c) 2019 ruoyi + */ + +/** 基础通用 **/ +.pt5 { + padding-top: 5px; +} +.pr5 { + padding-right: 5px; +} +.pb5 { + padding-bottom: 5px; +} +.mt5 { + margin-top: 5px; +} +.mr5 { + margin-right: 5px; +} +.mb5 { + margin-bottom: 5px; +} +.mb8 { + margin-bottom: 8px; +} +.ml5 { + margin-left: 5px; +} +.mt10 { + margin-top: 10px; +} +.mr10 { + margin-right: 10px; +} +.mb10 { + margin-bottom: 10px; +} +.ml10 { + margin-left: 10px; +} +.mt20 { + margin-top: 20px; +} +.mr20 { + margin-right: 20px; +} +.mb20 { + margin-bottom: 20px; +} +.ml20 { + margin-left: 20px; +} + +.h1, +.h2, +.h3, +.h4, +.h5, +.h6, +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} + +.el-form .el-form-item__label { + font-weight: 700; +} +.el-dialog:not(.is-fullscreen) { + margin-top: 6vh !important; +} + +.el-dialog.scrollbar .el-dialog__body { + overflow: auto; + overflow-x: hidden; + max-height: 70vh; + padding: 10px 20px 0; +} + +.el-table { + .el-table__header-wrapper, + .el-table__fixed-header-wrapper { + th { + word-break: break-word; + background-color: $table-header-bg !important; + color: $table-header-text-color; + height: 40px !important; + font-size: 13px; + } + } + .el-table__body-wrapper { + .el-button [class*='el-icon-'] + span { + margin-left: 1px; + } + } +} + +/** 表单布局 **/ +.form-header { + font-size: 15px; + color: #6379bb; + border-bottom: 1px solid #ddd; + margin: 8px 10px 25px 10px; + padding-bottom: 5px; +} + +/** 表格布局 **/ +.pagination-container { + // position: relative; + height: 25px; + margin-bottom: 10px; + margin-top: 15px; + padding: 10px 20px !important; +} + +/* tree border */ +.tree-border { + margin-top: 5px; + border: 1px solid #e5e6e7; + background: #ffffff none; + border-radius: 4px; + width: 100%; +} + +.pagination-container .el-pagination { + //right: 0; + //position: absolute; +} + +@media (max-width: 768px) { + .pagination-container .el-pagination > .el-pagination__jump { + display: none !important; + } + .pagination-container .el-pagination > .el-pagination__sizes { + display: none !important; + } +} + +.el-table .fixed-width .el-button--small { + padding-left: 0; + padding-right: 0; + width: inherit; +} + +/** 表格更多操作下拉样式 */ +.el-table .el-dropdown-link { + cursor: pointer; + color: #409eff; + margin-left: 10px; +} + +.el-table .el-dropdown, +.el-icon-arrow-down { + font-size: 12px; +} + +.el-tree-node__content > .el-checkbox { + margin-right: 8px; +} + +.list-group-striped > .list-group-item { + border-left: 0; + border-right: 0; + border-radius: 0; + padding-left: 0; + padding-right: 0; +} + +.list-group { + padding-left: 0px; + list-style: none; +} + +.list-group-item { + border-bottom: 1px solid #e7eaec; + border-top: 1px solid #e7eaec; + margin-bottom: -1px; + padding: 11px 0px; + font-size: 13px; +} + +.pull-right { + float: right !important; +} + +.el-card__header { + padding: 14px 15px 7px !important; + min-height: 40px; +} + +.el-card__body { + padding: 15px 20px 20px 20px !important; +} + +.card-box { + padding-right: 15px; + padding-left: 15px; + margin-bottom: 10px; +} + +/* button color */ +.el-button--cyan.is-active, +.el-button--cyan:active { + background: #20b2aa; + border-color: #20b2aa; + color: #ffffff; +} + +.el-button--cyan:focus, +.el-button--cyan:hover { + background: #48d1cc; + border-color: #48d1cc; + color: #ffffff; +} + +.el-button--cyan { + background-color: #20b2aa; + border-color: #20b2aa; + color: #ffffff; +} + +/* text color */ +.text-navy { + color: #1ab394; +} + +.text-primary { + color: inherit; +} + +.text-success { + color: #1c84c6; +} + +.text-info { + color: #23c6c8; +} + +.text-warning { + color: #f8ac59; +} + +.text-danger { + color: #ed5565; +} + +.text-muted { + color: #888888; +} + +/* image */ +.img-circle { + border-radius: 50%; +} + +.img-lg { + width: 120px; + height: 120px; +} + +.avatar-upload-preview { + position: absolute; + top: 50%; + transform: translate(50%, -50%); + width: 200px; + height: 200px; + border-radius: 50%; + box-shadow: 0 0 4px #ccc; + overflow: hidden; +} + +/* 拖拽列样式 */ +.sortable-ghost { + opacity: 0.8; + color: #fff !important; + background: #42b983 !important; +} + +/* 表格右侧工具栏样式 */ +.top-right-btn { + margin-left: auto; +} diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss new file mode 100644 index 0000000..d85da55 --- /dev/null +++ b/src/assets/styles/sidebar.scss @@ -0,0 +1,232 @@ +#app { + .main-container { + height: 100%; + transition: margin-left 0.28s; + margin-left: $base-sidebar-width; + position: relative; + } + + .sidebarHide { + margin-left: 0 !important; + } + + .sidebar-container { + -webkit-transition: width 0.28s; + transition: width 0.28s; + width: $base-sidebar-width !important; + background-color: $base-menu-background; + height: 100%; + position: fixed; + font-size: 0; + top: 0; + bottom: 0; + left: 0; + z-index: 1001; + overflow: hidden; + -webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); + box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); + + // reset element-ui css + .horizontal-collapse-transition { + transition: + 0s width ease-in-out, + 0s padding-left ease-in-out, + 0s padding-right ease-in-out; + } + + .scrollbar-wrapper { + overflow-x: hidden !important; + } + + .el-scrollbar__bar.is-vertical { + right: 0; + } + + .el-scrollbar { + height: 100%; + } + + &.has-logo { + .el-scrollbar { + height: calc(100% - 50px); + } + } + + .is-horizontal { + display: none; + } + + a { + display: inline-block; + width: 100%; + overflow: hidden; + } + + .svg-icon { + margin-right: 16px; + } + + .el-menu { + border: none; + height: 100%; + width: 100% !important; + } + + .el-menu-item, + .menu-title { + overflow: hidden !important; + text-overflow: ellipsis !important; + white-space: nowrap !important; + } + + .el-menu-item .el-menu-tooltip__trigger { + display: inline-block !important; + } + + // menu hover + .theme-dark .sub-menu-title-noDropdown, + .theme-dark .el-sub-menu__title { + &:hover { + background-color: $base-sub-menu-title-hover !important; + } + } + .sub-menu-title-noDropdown, + .el-sub-menu__title { + &:hover { + background-color: rgba(0, 0, 0, 0.05) !important; + } + } + + & .theme-dark .is-active > .el-sub-menu__title { + color: $base-menu-color-active !important; + } + + & .nest-menu .el-sub-menu > .el-sub-menu__title, + & .el-sub-menu .el-menu-item { + min-width: $base-sidebar-width !important; + &:hover { + background-color: rgba(0, 0, 0, 0.1) !important; + } + } + + & .theme-dark .nest-menu .el-sub-menu > .el-sub-menu__title, + & .theme-dark .el-sub-menu .el-menu-item { + background-color: $base-sub-menu-background !important; + + &:hover { + background-color: $base-sub-menu-hover !important; + } + } + + & .theme-dark .nest-menu .el-sub-menu > .el-sub-menu__title, + & .theme-dark .el-menu-item { + &:hover { + // you can use $sub-menuHover + background-color: $base-menu-hover !important; + } + } + & .nest-menu .el-sub-menu > .el-sub-menu__title, + & .el-menu-item { + &:hover { + // you can use $sub-menuHover + background-color: rgba(0, 0, 0, 0.04) !important; + } + } + } + + .hideSidebar { + .sidebar-container { + width: 54px !important; + } + + .main-container { + margin-left: 54px; + } + + .sub-menu-title-noDropdown { + padding: 0 !important; + position: relative; + + .el-tooltip { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + } + } + + .el-sub-menu { + overflow: hidden; + + & > .el-sub-menu__title { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + } + } + + .el-menu--collapse { + .el-sub-menu { + & > .el-sub-menu__title { + & > span { + height: 0; + width: 0; + overflow: hidden; + visibility: hidden; + display: inline-block; + } + & > i { + height: 0; + width: 0; + overflow: hidden; + visibility: hidden; + display: inline-block; + } + } + } + } + } + + .el-menu--collapse .el-menu .el-sub-menu { + min-width: $base-sidebar-width !important; + } + + // mobile responsive + .mobile { + .main-container { + margin-left: 0px; + } + + .sidebar-container { + transition: transform 0.28s; + width: $base-sidebar-width !important; + } + + &.hideSidebar { + .sidebar-container { + pointer-events: none; + transition-duration: 0.3s; + transform: translate3d(-$base-sidebar-width, 0, 0); + } + } + } + + .withoutAnimation { + .main-container, + .sidebar-container { + transition: none; + } + } +} + +// when menu collapsed +.el-menu--vertical { + & > .el-menu { + .svg-icon { + margin-right: 16px; + } + } +} diff --git a/src/assets/styles/transition.scss b/src/assets/styles/transition.scss new file mode 100644 index 0000000..468ad3c --- /dev/null +++ b/src/assets/styles/transition.scss @@ -0,0 +1,49 @@ +// global transition css + +/* fade */ +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.28s; +} + +.fade-enter, +.fade-leave-active { + opacity: 0; +} + +/* fade-transform */ +.fade-transform--move, +.fade-transform-leave-active, +.fade-transform-enter-active { + transition: all 0.5s; +} + +.fade-transform-enter { + opacity: 0; + transform: translateX(-30px); +} + +.fade-transform-leave-to { + opacity: 0; + transform: translateX(30px); +} + +/* breadcrumb transition */ +.breadcrumb-enter-active, +.breadcrumb-leave-active { + transition: all 0.5s; +} + +.breadcrumb-enter, +.breadcrumb-leave-active { + opacity: 0; + transform: translateX(20px); +} + +.breadcrumb-move { + transition: all 0.5s; +} + +.breadcrumb-leave-active { + position: absolute; +} diff --git a/src/assets/styles/variables.module.scss b/src/assets/styles/variables.module.scss new file mode 100644 index 0000000..3aa871b --- /dev/null +++ b/src/assets/styles/variables.module.scss @@ -0,0 +1,135 @@ +// 全局SCSS变量 +:root { + --menuBg: #304156; + --menuColor: #bfcbd9; + --menuActiveText: #f4f4f5; + --menuHover: #263445; + + --subMenuBg: #1f2d3d; + --subMenuActiveText: #f4f4f5; + --subMenuHover: #001528; + --subMenuTitleHover: #293444; + + --fixedHeaderBg: #ffffff; + --tableHeaderBg: #f8f8f9; + --tableHeaderTextColor: #515a6e; + + // ele + --brder-color: #e8e8e8; + + // 添加 tag 相关变量 + --tags-view-active-bg: var(--el-color-primary); + --tags-view-active-border-color: var(--el-color-primary); +} + +html.dark { + --menuBg: #1d1e1f; + --menuColor: #bfcbd9; + --menuActiveText: #f4f4f5; + --menuHover: #171819; + + --subMenuBg: #1d1e1f; + --subMenuActiveText: #1d1e1f; + --subMenuHover: #171819; + --subMenuTitleHover: #171819; + + --fixedHeaderBg: #171819; + --tableHeaderBg: var(--el-bg-color); + --tableHeaderTextColor: var(--el-text-color); + + // 覆盖ele 高亮当前行的标准暗色 + .el-tree-node__content { + --el-color-primary-light-9: #262727; + } + + .el-button--primary { + --el-button-bg-color: var(--el-color-primary-dark-6); + --el-button-border-color: var(--el-color-primary-light-2); + } + + .el-switch { + --el-switch-on-color: var(--el-color-primary-dark-6); + --el-switch-border-color: var(--el-color-primary-light-2); + } + + .el-tag--primary { + --el-tag-bg-color: var(--el-color-primary-dark-6); + --el-tag-border-color: var(--el-color-primary-light-2); + } + + // 在深色模式下使用更深的颜色 + --tags-view-active-bg: var(--el-color-primary-dark-6); + --tags-view-active-border-color: var(--el-color-primary-light-2); + // vxe-table 主题 + --vxe-font-color: #98989e; + --vxe-primary-color: #2c7ecf; + --vxe-icon-background-color: #98989e; + --vxe-table-font-color: #98989e; + --vxe-table-resizable-color: #95969a; + --vxe-table-header-background-color: #28282a; + --vxe-table-body-background-color: #151518; + --vxe-table-background-color: #4a5663; + --vxe-table-border-width: 1px; + --vxe-table-border-color: #37373a; + --vxe-toolbar-background-color: #37373a; + + // ele + --brder-color: #37373a; +} + +// base color +$blue: #324157; +$light-blue: #3a71a8; +$red: #c03639; +$pink: #e65d6e; +$green: #30b08f; +$tiffany: #4ab7bd; +$yellow: #fec171; +$panGreen: #30b08f; + +// 默认菜单主题风格 +$base-menu-color: var(--menuColor); +$base-menu-hover: var(--menuHover); +$base-menu-color-active: var(--menuActiveText); +$base-menu-background: var(--menuBg); +$base-logo-title-color: #ffffff; + +$base-menu-light-color: rgba(0, 0, 0, 0.7); +$base-menu-light-background: #ffffff; +$base-logo-light-title-color: #001529; + +$base-sub-menu-background: var(--subMenuBg); +$base-sub-menu-hover: var(--subMenuHover); +$base-sub-menu-title-hover: var(--subMenuTitleHover); +// 表单头背景色和标题颜色 +$fixed-header-bg: var(--fixedHeaderBg); +$table-header-bg: var(--tableHeaderBg); +$table-header-text-color: var(--tableHeaderTextColor); + +$--color-primary: #409eff; +$--color-success: #67c23a; +$--color-warning: #e6a23c; +$--color-danger: #f56c6c; +$--color-info: #909399; + +$base-sidebar-width: 200px; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + menuColor: $base-menu-color; + menuLightColor: $base-menu-light-color; + menuColorActive: $base-menu-color-active; + menuBackground: $base-menu-background; + menuLightBackground: $base-menu-light-background; + subMenuBackground: $base-sub-menu-background; + subMenuHover: $base-sub-menu-hover; + sideBarWidth: $base-sidebar-width; + logoTitleColor: $base-logo-title-color; + logoLightTitleColor: $base-logo-light-title-color; + primaryColor: $--color-primary; + successColor: $--color-success; + dangerColor: $--color-danger; + infoColor: $--color-info; + warningColor: $--color-warning; +} \ No newline at end of file diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue new file mode 100644 index 0000000..a8b2f68 --- /dev/null +++ b/src/components/Breadcrumb/index.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/components/BuildCode/index.vue b/src/components/BuildCode/index.vue new file mode 100644 index 0000000..0b8e3f4 --- /dev/null +++ b/src/components/BuildCode/index.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/components/BuildCode/render.vue b/src/components/BuildCode/render.vue new file mode 100644 index 0000000..aeb9312 --- /dev/null +++ b/src/components/BuildCode/render.vue @@ -0,0 +1,57 @@ + + + + diff --git a/src/components/DictTag/index.vue b/src/components/DictTag/index.vue new file mode 100644 index 0000000..ad326c2 --- /dev/null +++ b/src/components/DictTag/index.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue new file mode 100644 index 0000000..ba70fbb --- /dev/null +++ b/src/components/Editor/index.vue @@ -0,0 +1,244 @@ + + + + + diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue new file mode 100644 index 0000000..b22d09a --- /dev/null +++ b/src/components/FileUpload/index.vue @@ -0,0 +1,234 @@ + + + + + diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue new file mode 100644 index 0000000..f9f5e62 --- /dev/null +++ b/src/components/Hamburger/index.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue new file mode 100644 index 0000000..a785958 --- /dev/null +++ b/src/components/HeaderSearch/index.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/src/components/IconSelect/index.vue b/src/components/IconSelect/index.vue new file mode 100644 index 0000000..3bfde4d --- /dev/null +++ b/src/components/IconSelect/index.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/src/components/IconSelect/requireIcons.ts b/src/components/IconSelect/requireIcons.ts new file mode 100644 index 0000000..9f06d69 --- /dev/null +++ b/src/components/IconSelect/requireIcons.ts @@ -0,0 +1,7 @@ +const icons: string[] = []; +const modules = import.meta.glob('./../../assets/icons/svg/*.svg'); +for (const path in modules) { + const p = path.split('assets/icons/svg/')[1].split('.svg')[0]; + icons.push(p); +} +export default icons; diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue new file mode 100644 index 0000000..98e6479 --- /dev/null +++ b/src/components/ImagePreview/index.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue new file mode 100644 index 0000000..0778121 --- /dev/null +++ b/src/components/ImageUpload/index.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/src/components/LangSelect/index.vue b/src/components/LangSelect/index.vue new file mode 100644 index 0000000..b5fafd3 --- /dev/null +++ b/src/components/LangSelect/index.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue new file mode 100644 index 0000000..ac02193 --- /dev/null +++ b/src/components/Pagination/index.vue @@ -0,0 +1,88 @@ + + + + + + + diff --git a/src/components/ParentView/index.vue b/src/components/ParentView/index.vue new file mode 100644 index 0000000..98240ae --- /dev/null +++ b/src/components/ParentView/index.vue @@ -0,0 +1,3 @@ + diff --git a/src/components/Process/approvalRecord.vue b/src/components/Process/approvalRecord.vue new file mode 100644 index 0000000..a4bd607 --- /dev/null +++ b/src/components/Process/approvalRecord.vue @@ -0,0 +1,280 @@ + + + diff --git a/src/components/Process/processMeddle.vue b/src/components/Process/processMeddle.vue new file mode 100644 index 0000000..7224755 --- /dev/null +++ b/src/components/Process/processMeddle.vue @@ -0,0 +1,207 @@ + + diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue new file mode 100644 index 0000000..1c985de --- /dev/null +++ b/src/components/Process/submitVerify.vue @@ -0,0 +1,421 @@ + + + diff --git a/src/components/RightToolbar/index.vue b/src/components/RightToolbar/index.vue new file mode 100644 index 0000000..e8c9d65 --- /dev/null +++ b/src/components/RightToolbar/index.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/src/components/RoleSelect/index.vue b/src/components/RoleSelect/index.vue new file mode 100644 index 0000000..56a784b --- /dev/null +++ b/src/components/RoleSelect/index.vue @@ -0,0 +1,250 @@ + + + diff --git a/src/components/RuoYiDoc/index.vue b/src/components/RuoYiDoc/index.vue new file mode 100644 index 0000000..1e27d89 --- /dev/null +++ b/src/components/RuoYiDoc/index.vue @@ -0,0 +1,13 @@ + + + diff --git a/src/components/RuoYiGit/index.vue b/src/components/RuoYiGit/index.vue new file mode 100644 index 0000000..ad27808 --- /dev/null +++ b/src/components/RuoYiGit/index.vue @@ -0,0 +1,13 @@ + + + diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue new file mode 100644 index 0000000..ce0b373 --- /dev/null +++ b/src/components/Screenfull/index.vue @@ -0,0 +1,9 @@ + + + diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue new file mode 100644 index 0000000..abf72cc --- /dev/null +++ b/src/components/SizeSelect/index.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue new file mode 100644 index 0000000..05dfe87 --- /dev/null +++ b/src/components/SvgIcon/index.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/src/components/TopNav/index.vue b/src/components/TopNav/index.vue new file mode 100644 index 0000000..cfe2cd7 --- /dev/null +++ b/src/components/TopNav/index.vue @@ -0,0 +1,200 @@ + + + + + diff --git a/src/components/TreeSelect/index.vue b/src/components/TreeSelect/index.vue new file mode 100644 index 0000000..7accd6b --- /dev/null +++ b/src/components/TreeSelect/index.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/src/components/UserSelect/index.vue b/src/components/UserSelect/index.vue new file mode 100644 index 0000000..937a395 --- /dev/null +++ b/src/components/UserSelect/index.vue @@ -0,0 +1,306 @@ + + + + + diff --git a/src/components/iFrame/index.vue b/src/components/iFrame/index.vue new file mode 100644 index 0000000..98f2224 --- /dev/null +++ b/src/components/iFrame/index.vue @@ -0,0 +1,26 @@ + + + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue new file mode 100644 index 0000000..a3237c7 --- /dev/null +++ b/src/layout/components/Navbar.vue @@ -0,0 +1,517 @@ + + + + + diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue new file mode 100644 index 0000000..3082beb --- /dev/null +++ b/src/layout/components/Settings/index.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue new file mode 100644 index 0000000..fd75f35 --- /dev/null +++ b/src/layout/components/Sidebar/Link.vue @@ -0,0 +1,40 @@ + + + diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue new file mode 100644 index 0000000..5251a28 --- /dev/null +++ b/src/layout/components/Sidebar/Logo.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue new file mode 100644 index 0000000..5e82ea3 --- /dev/null +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -0,0 +1,101 @@ + + + diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue new file mode 100644 index 0000000..a4f20d0 --- /dev/null +++ b/src/layout/components/Sidebar/index.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/layout/components/SocialCallback/index.vue b/src/layout/components/SocialCallback/index.vue new file mode 100644 index 0000000..746de20 --- /dev/null +++ b/src/layout/components/SocialCallback/index.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue new file mode 100644 index 0000000..3b30043 --- /dev/null +++ b/src/layout/components/TagsView/ScrollPane.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue new file mode 100644 index 0000000..9bcf285 --- /dev/null +++ b/src/layout/components/TagsView/index.vue @@ -0,0 +1,337 @@ + + + + + + + diff --git a/src/layout/components/TopBar/search.vue b/src/layout/components/TopBar/search.vue new file mode 100644 index 0000000..182e84a --- /dev/null +++ b/src/layout/components/TopBar/search.vue @@ -0,0 +1,158 @@ + + + + + diff --git a/src/layout/components/index.ts b/src/layout/components/index.ts new file mode 100644 index 0000000..47c83e1 --- /dev/null +++ b/src/layout/components/index.ts @@ -0,0 +1,4 @@ +export { default as AppMain } from './AppMain.vue'; +export { default as Navbar } from './Navbar.vue'; +export { default as Settings } from './Settings/index.vue'; +export { default as TagsView } from './TagsView/index.vue'; diff --git a/src/layout/components/notice/index.vue b/src/layout/components/notice/index.vue new file mode 100644 index 0000000..f9092ba --- /dev/null +++ b/src/layout/components/notice/index.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/src/layout/index.vue b/src/layout/index.vue new file mode 100644 index 0000000..98bc8c9 --- /dev/null +++ b/src/layout/index.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..592de58 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,57 @@ +import { createApp } from 'vue'; +// global css +import 'virtual:uno.css'; +import '@/assets/styles/index.scss'; +import 'element-plus/theme-chalk/dark/css-vars.css'; + +// App、router、store +import App from './App.vue'; +import store from './store'; +import router from './router'; + +// 自定义指令 +import directive from './directive'; + +// 注册插件 +import plugins from './plugins/index'; // plugins + +// 高亮组件 +// import 'highlight.js/styles/a11y-light.css'; +import 'highlight.js/styles/atom-one-dark.css'; +import 'highlight.js/lib/common'; +import HighLight from '@highlightjs/vue-plugin'; + +// svg图标 +import 'virtual:svg-icons-register'; +import ElementIcons from '@/plugins/svgicon'; + +// permission control +import './permission'; + +// 国际化 +import i18n from '@/lang/index'; + +// vxeTable +import VXETable from 'vxe-table'; +import 'vxe-table/lib/style.css'; +VXETable.config({ + zIndex: 999999 +}); + +// 修改 el-dialog 默认点击遮照为不关闭 +import { ElDialog } from 'element-plus'; +ElDialog.props.closeOnClickModal.default = false; + +const app = createApp(App); + +app.use(HighLight); +app.use(ElementIcons); +app.use(router); +app.use(store); +app.use(i18n); +app.use(VXETable); +app.use(plugins); +// 自定义指令 +directive(app); + +app.mount('#app'); diff --git a/src/permission.ts b/src/permission.ts new file mode 100644 index 0000000..89bb111 --- /dev/null +++ b/src/permission.ts @@ -0,0 +1,74 @@ +import { to as tos } from 'await-to-js'; +import router from './router'; +import NProgress from 'nprogress'; +import 'nprogress/nprogress.css'; +import { getToken } from '@/utils/auth'; +import { isHttp, isPathMatch } from '@/utils/validate'; +import { isRelogin } from '@/utils/request'; +import useUserStore from '@/store/modules/user'; +import useSettingsStore from '@/store/modules/settings'; +import usePermissionStore from '@/store/modules/permission'; + +NProgress.configure({ showSpinner: false }); +const whiteList = ['/login', '/register', '/social-callback', '/register*', '/register/*', '/index', '/zhishu/wave', '/zhishu/employee']; + +const isWhiteList = (path: string) => { + return whiteList.some(pattern => isPathMatch(pattern, path)) +} + +router.beforeEach(async (to, from, next) => { + NProgress.start(); + if (getToken()) { + to.meta.title && useSettingsStore().setTitle(to.meta.title); + /* has token*/ + if (to.path === '/login') { + // 检查是否存在login_code参数,如果存在则允许访问登录页面 + if (to.query.login_code) { + next(); + NProgress.done(); + } else { + next({ path: '/index' }); + NProgress.done(); + } + } else { + if (useUserStore().roles.length === 0) { + try { + // 获取用户信息 + await useUserStore().getInfo(); + // 生成可访问路由表 + const accessRoutes = await usePermissionStore().generateRoutes(); + // 根据roles权限生成可访问的路由表 + accessRoutes.forEach((route) => { + if (!isHttp(route.path)) { + router.addRoute(route); // 动态添加可访问路由表 + } + }); + // 确保addRoutes已完成 + next({ path: to.path, replace: true }); + } catch (error) { + // 移除 token 并跳转登录页 + await useUserStore().logout(); + ElMessage.error(error || '获取用户信息失败'); + next(`/login?redirect=${to.path}`); + NProgress.done(); + } + } else { + next(); + } + } + } else { + // 没有token + if (isWhiteList(to.path)) { + // 在免登录白名单,直接进入 + next(); + } else { + const redirect = encodeURIComponent(to.fullPath || '/'); + next(`/login?redirect=${redirect}`); // 否则全部重定向到登录页 + NProgress.done(); + } + } +}); + +router.afterEach(() => { + NProgress.done(); +}); diff --git a/src/plugins/auth.ts b/src/plugins/auth.ts new file mode 100644 index 0000000..74c91ee --- /dev/null +++ b/src/plugins/auth.ts @@ -0,0 +1,60 @@ +import useUserStore from '@/store/modules/user'; + +const authPermission = (permission: string): boolean => { + const all_permission = '*:*:*'; + const permissions: string[] = useUserStore().permissions; + if (permission && permission.length > 0) { + return permissions.some((v) => { + return all_permission === v || v === permission; + }); + } else { + return false; + } +}; + +const authRole = (role: string): boolean => { + const super_admin = 'admin'; + const roles = useUserStore().roles; + if (role && role.length > 0) { + return roles.some((v) => { + return super_admin === v || v === role; + }); + } else { + return false; + } +}; + +export default { + // 验证用户是否具备某权限 + hasPermi(permission: string): boolean { + return authPermission(permission); + }, + // 验证用户是否含有指定权限,只需包含其中一个 + hasPermiOr(permissions: string[]): boolean { + return permissions.some((item) => { + return authPermission(item); + }); + }, + // 验证用户是否含有指定权限,必须全部拥有 + hasPermiAnd(permissions: string[]): boolean { + return permissions.every((item) => { + return authPermission(item); + }); + }, + // 验证用户是否具备某角色 + hasRole(role: string): boolean { + return authRole(role); + }, + // 验证用户是否含有指定角色,只需包含其中一个 + hasRoleOr(roles: string[]): boolean { + return roles.some((item) => { + return authRole(item); + }); + }, + // 验证用户是否含有指定角色,必须全部拥有 + hasRoleAnd(roles: string[]): boolean { + return roles.every((item) => { + return authRole(item); + }); + } +}; diff --git a/src/plugins/cache.ts b/src/plugins/cache.ts new file mode 100644 index 0000000..e5ceead --- /dev/null +++ b/src/plugins/cache.ts @@ -0,0 +1,79 @@ +const sessionCache = { + set(key: string, value: any) { + if (!sessionStorage) { + return; + } + if (key != null && value != null) { + sessionStorage.setItem(key, value); + } + }, + get(key: string) { + if (!sessionStorage) { + return null; + } + if (key == null) { + return null; + } + return sessionStorage.getItem(key); + }, + setJSON(key: string, jsonValue: any) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)); + } + }, + getJSON(key: string) { + const value = this.get(key); + if (value != null) { + return JSON.parse(value); + } + return null; + }, + remove(key: string) { + sessionStorage.removeItem(key); + } +}; +const localCache = { + set(key: string, value: any) { + if (!localStorage) { + return; + } + if (key != null && value != null) { + localStorage.setItem(key, value); + } + }, + get(key: string) { + if (!localStorage) { + return null; + } + if (key == null) { + return null; + } + return localStorage.getItem(key); + }, + setJSON(key: string, jsonValue: any) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)); + } + }, + getJSON(key: string) { + const value = this.get(key); + if (value != null) { + return JSON.parse(value); + } + return null; + }, + remove(key: string) { + localStorage.removeItem(key); + } +}; + +export default { + /** + * 会话级缓存 + */ + session: sessionCache, + /** + * 本地缓存 + */ + local: localCache +}; diff --git a/src/plugins/download.ts b/src/plugins/download.ts new file mode 100644 index 0000000..ef66b3a --- /dev/null +++ b/src/plugins/download.ts @@ -0,0 +1,65 @@ +import axios from 'axios'; +import FileSaver from 'file-saver'; +import errorCode from '@/utils/errorCode'; +import { blobValidate } from '@/utils/ruoyi'; +import { LoadingInstance } from 'element-plus/es/components/loading/src/loading'; +import { globalHeaders } from '@/utils/request'; + +const baseURL = import.meta.env.VITE_APP_BASE_API; +let downloadLoadingInstance: LoadingInstance; +export default { + async oss(ossId: string | number) { + const url = baseURL + '/resource/oss/download/' + ossId; + downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' }); + try { + const res = await axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: globalHeaders() + }); + const isBlob = blobValidate(res.data); + if (isBlob) { + const blob = new Blob([res.data], { type: 'application/octet-stream' }); + FileSaver.saveAs(blob, decodeURIComponent(res.headers['download-filename'] as string)); + } else { + this.printErrMsg(res.data); + } + downloadLoadingInstance.close(); + } catch (r) { + console.error(r); + ElMessage.error('下载文件出现错误,请联系管理员!'); + downloadLoadingInstance.close(); + } + }, + async zip(url: string, name: string) { + url = baseURL + url; + downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' }); + try { + const res = await axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: globalHeaders() + }); + const isBlob = blobValidate(res.data); + if (isBlob) { + const blob = new Blob([res.data], { type: 'application/zip' }); + FileSaver.saveAs(blob, name); + } else { + this.printErrMsg(res.data); + } + downloadLoadingInstance.close(); + } catch (r) { + console.error(r); + ElMessage.error('下载文件出现错误,请联系管理员!'); + downloadLoadingInstance.close(); + } + }, + async printErrMsg(data: any) { + const resText = await data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']; + ElMessage.error(errMsg); + } +}; diff --git a/src/plugins/index.ts b/src/plugins/index.ts new file mode 100644 index 0000000..6c5e0c3 --- /dev/null +++ b/src/plugins/index.ts @@ -0,0 +1,43 @@ +import modal from './modal'; +import tab from './tab'; +import download from './download'; +import cache from './cache'; +import auth from './auth'; +// 预设动画 +import animate from '@/animate'; + +import { download as dl } from '@/utils/request'; +import { useDict } from '@/utils/dict'; +import { getConfigKey, updateConfigByKey } from '@/api/system/config'; +import { parseTime, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'; + +import { App } from 'vue'; + +export default function installPlugin(app: App) { + // 页签操作 + app.config.globalProperties.$tab = tab; + + // 模态框对象 + app.config.globalProperties.$modal = modal; + + // 缓存对象 + app.config.globalProperties.$cache = cache; + + // 下载文件 + app.config.globalProperties.$download = download; + + // 认证对象 + app.config.globalProperties.$auth = auth; + + // 全局方法挂载 + app.config.globalProperties.useDict = useDict; + app.config.globalProperties.getConfigKey = getConfigKey; + app.config.globalProperties.updateConfigByKey = updateConfigByKey; + app.config.globalProperties.download = dl; + app.config.globalProperties.parseTime = parseTime; + app.config.globalProperties.handleTree = handleTree; + app.config.globalProperties.addDateRange = addDateRange; + app.config.globalProperties.selectDictLabel = selectDictLabel; + app.config.globalProperties.selectDictLabels = selectDictLabels; + app.config.globalProperties.animate = animate; +} diff --git a/src/plugins/modal.ts b/src/plugins/modal.ts new file mode 100644 index 0000000..a8b0548 --- /dev/null +++ b/src/plugins/modal.ts @@ -0,0 +1,81 @@ +import { MessageBoxData } from 'element-plus'; +import { LoadingInstance } from 'element-plus/es/components/loading/src/loading'; +let loadingInstance: LoadingInstance; +export default { + // 消息提示 + msg(content: any) { + ElMessage.info(content); + }, + // 错误消息 + msgError(content: any) { + ElMessage.error(content); + }, + // 成功消息 + msgSuccess(content: any) { + ElMessage.success(content); + }, + // 警告消息 + msgWarning(content: any) { + ElMessage.warning(content); + }, + // 弹出提示 + alert(content: any) { + ElMessageBox.alert(content, '系统提示'); + }, + // 错误提示 + alertError(content: any) { + ElMessageBox.alert(content, '系统提示', { type: 'error' }); + }, + // 成功提示 + alertSuccess(content: any) { + ElMessageBox.alert(content, '系统提示', { type: 'success' }); + }, + // 警告提示 + alertWarning(content: any) { + ElMessageBox.alert(content, '系统提示', { type: 'warning' }); + }, + // 通知提示 + notify(content: any) { + ElNotification.info(content); + }, + // 错误通知 + notifyError(content: any) { + ElNotification.error(content); + }, + // 成功通知 + notifySuccess(content: any) { + ElNotification.success(content); + }, + // 警告通知 + notifyWarning(content: any) { + ElNotification.warning(content); + }, + // 确认窗体 + confirm(content: any): Promise { + return ElMessageBox.confirm(content, '系统提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }); + }, + // 提交内容 + prompt(content: any) { + return ElMessageBox.prompt(content, '系统提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }); + }, + // 打开遮罩层 + loading(content: string) { + loadingInstance = ElLoading.service({ + lock: true, + text: content, + background: 'rgba(0, 0, 0, 0.7)' + }); + }, + // 关闭遮罩层 + closeLoading() { + loadingInstance.close(); + } +}; diff --git a/src/plugins/svgicon.ts b/src/plugins/svgicon.ts new file mode 100644 index 0000000..8c68609 --- /dev/null +++ b/src/plugins/svgicon.ts @@ -0,0 +1,10 @@ +import * as ElementPlusIconsVue from '@element-plus/icons-vue'; +import { App } from 'vue'; + +export default { + install: (app: App) => { + for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component); + } + } +}; diff --git a/src/plugins/tab.ts b/src/plugins/tab.ts new file mode 100644 index 0000000..4b44dc6 --- /dev/null +++ b/src/plugins/tab.ts @@ -0,0 +1,96 @@ +import router from '@/router'; +import { RouteLocationMatched, RouteLocationNormalized, RouteLocationRaw } from 'vue-router'; +import useTagsViewStore from '@/store/modules/tagsView'; + +export default { + /** + * 刷新当前tab页签 + * @param obj 标签对象 + */ + async refreshPage(obj?: RouteLocationNormalized): Promise { + const { path, query, matched } = router.currentRoute.value; + if (obj === undefined) { + matched.forEach((m: RouteLocationMatched) => { + if (m.components && m.components.default && m.components.default.name) { + if (!['Layout', 'ParentView'].includes(m.components.default.name)) { + obj = { + name: m.components.default.name, + path: path, + query: query, + matched: undefined, + fullPath: undefined, + hash: undefined, + params: undefined, + redirectedFrom: undefined, + meta: undefined + }; + } + } + }); + } + let query1: undefined | {} = {}; + let path1: undefined | string = ''; + if (obj) { + query1 = obj.query; + path1 = obj.path; + } + await useTagsViewStore().delCachedView(obj); + await router.replace({ + path: '/redirect' + path1, + query: query1 + }); + }, + // 关闭当前tab页签,打开新页签 + closeOpenPage(obj: RouteLocationRaw): void { + useTagsViewStore().delView(router.currentRoute.value); + if (obj !== undefined) { + router.push(obj); + } + }, + // 关闭指定tab页签 + async closePage(obj?: RouteLocationNormalized): Promise<{ visitedViews: RouteLocationNormalized[]; cachedViews: string[] } | any> { + if (obj === undefined) { + // prettier-ignore + const { visitedViews } = await useTagsViewStore().delView(router.currentRoute.value) + const latestView = visitedViews.slice(-1)[0]; + if (latestView) { + return router.push(latestView.fullPath); + } + return router.push('/'); + } + return useTagsViewStore().delView(obj); + }, + // 关闭所有tab页签 + closeAllPage() { + return useTagsViewStore().delAllViews(); + }, + // 关闭左侧tab页签 + closeLeftPage(obj?: RouteLocationNormalized) { + return useTagsViewStore().delLeftTags(obj || router.currentRoute.value); + }, + // 关闭右侧tab页签 + closeRightPage(obj?: RouteLocationNormalized) { + return useTagsViewStore().delRightTags(obj || router.currentRoute.value); + }, + // 关闭其他tab页签 + closeOtherPage(obj?: RouteLocationNormalized) { + return useTagsViewStore().delOthersViews(obj || router.currentRoute.value); + }, + /** + * 打开tab页签 + * @param url 路由地址 + * @param title 标题 + * @param query 参数 + */ + openPage(url: string, title?: string, query?: any) { + const obj = { path: url, query: { ...query, title } }; + return router.push(obj); + }, + /** + * 修改tab页签 + * @param obj 标签对象 + */ + updatePage(obj: RouteLocationNormalized) { + return useTagsViewStore().updateVisitedView(obj); + } +}; diff --git a/src/router/index.ts b/src/router/index.ts new file mode 100644 index 0000000..2bb042a --- /dev/null +++ b/src/router/index.ts @@ -0,0 +1,216 @@ +import { createWebHistory, createRouter, RouteRecordRaw } from 'vue-router'; +/* Layout */ +import Layout from '@/layout/index.vue'; + +/** + * Note: 路由配置项 + * + * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1 + * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 + * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面 + * // 若你想不管路由下面的 children 声明的个数都显示你的根路由 + * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由 + * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 + * name:'router-name' // 设定路由的名字,一定要填写不然使用时会出现各种问题 + * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 + * roles: ['admin', 'common'] // 访问路由的角色权限 + * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限 + * meta : { + noCache: true // 如果设置为true,则不会被 缓存(默认 false) + title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 + icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg + breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 + activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 + } + */ + +// 公共路由 +export const constantRoutes: RouteRecordRaw[] = [ + { + path: '/redirect', + component: Layout, + hidden: true, + children: [ + { + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect/index.vue') + } + ] + }, + { + path: '/social-callback', + hidden: true, + component: () => import('@/layout/components/SocialCallback/index.vue') + }, + { + path: '/login', + component: () => import('@/views/login.vue'), + hidden: true + }, + { + path: '/register', + component: () => import('@/views/register.vue'), + hidden: true + }, + { + path: '/register/:code', + component: () => import('@/views/register.vue'), + hidden: true + }, + { + path: '/:pathMatch(.*)*', + component: () => import('@/views/error/404.vue'), + hidden: true + }, + { + path: '/401', + component: () => import('@/views/error/401.vue'), + hidden: true + }, + { + path: '', + component: Layout, + redirect: '/login', + children: [ + { + path: '/index', + component: () => import('@/views/index.vue'), + name: 'Index', + meta: { title: '首页', icon: 'dashboard', affix: true } + } + ] + }, + { + path: '/user', + component: Layout, + hidden: true, + redirect: 'noredirect', + children: [ + { + path: 'profile', + component: () => import('@/views/system/user/profile/index.vue'), + name: 'Profile', + meta: { title: '个人中心', icon: 'user' } + } + ] + } +]; + +// 动态路由,基于用户权限动态去加载 +export const dynamicRoutes: RouteRecordRaw[] = [ + { + path: '/system/user-auth', + component: Layout, + hidden: true, + permissions: ['system:user:edit'], + children: [ + { + path: 'role/:userId(\\d+)', + component: () => import('@/views/system/user/authRole.vue'), + name: 'AuthRole', + meta: { title: '分配角色', activeMenu: '/system/user', icon: '', noCache: true } + } + ] + }, + { + path: '/system/role-auth', + component: Layout, + hidden: true, + permissions: ['system:role:edit'], + children: [ + { + path: 'user/:roleId(\\d+)', + component: () => import('@/views/system/role/authUser.vue'), + name: 'AuthUser', + meta: { title: '分配用户', activeMenu: '/system/role', icon: '', noCache: true } + } + ] + }, + { + path: '/system/dict-data', + component: Layout, + hidden: true, + permissions: ['system:dict:list'], + children: [ + { + path: 'index/:dictId(\\d+)', + component: () => import('@/views/system/dict/data.vue'), + name: 'Data', + meta: { title: '字典数据', activeMenu: '/system/dict', icon: '', noCache: true } + } + ] + }, + { + path: '/system/oss-config', + component: Layout, + hidden: true, + permissions: ['system:ossConfig:list'], + children: [ + { + path: 'index', + component: () => import('@/views/system/oss/config.vue'), + name: 'OssConfig', + meta: { title: '配置管理', activeMenu: '/system/oss', icon: '', noCache: true } + } + ] + }, + { + path: '/tool/gen-edit', + component: Layout, + hidden: true, + permissions: ['tool:gen:edit'], + children: [ + { + path: 'index/:tableId(\\d+)', + component: () => import('@/views/tool/gen/editTable.vue'), + name: 'GenEdit', + meta: { title: '修改生成配置', activeMenu: '/tool/gen', icon: '', noCache: true } + } + ] + }, + { + path: '/workflow/leaveEdit', + component: Layout, + hidden: true, + permissions: ['workflow:leave:edit'], + children: [ + { + path: 'index', + component: () => import('@/views/workflow/leave/leaveEdit.vue'), + name: 'leaveEdit', + meta: { title: '请假申请', activeMenu: '/workflow/leave', noCache: true } + } + ] + }, + { + path: '/workflow/design', + component: Layout, + hidden: true, + permissions: ['workflow:leave:edit'], + children: [ + { + path: 'index', + component: () => import('@/views/workflow/processDefinition/design.vue'), + name: 'design', + meta: { title: '流程设计', activeMenu: '/workflow/processDefinition', noCache: true } + } + ] + } +]; + +/** + * 创建路由 + */ +const router = createRouter({ + history: createWebHistory(import.meta.env.VITE_APP_CONTEXT_PATH), + routes: constantRoutes, + // 刷新时,滚动条位置还原 + scrollBehavior(to, from, savedPosition) { + if (savedPosition) { + return savedPosition; + } + return { top: 0 }; + } +}); + +export default router; diff --git a/src/settings.ts b/src/settings.ts new file mode 100644 index 0000000..4b62c75 --- /dev/null +++ b/src/settings.ts @@ -0,0 +1,62 @@ +import { LanguageEnum } from '@/enums/LanguageEnum'; + +const setting: DefaultSettings = { + /** + * 网页标题 + */ + title: import.meta.env.VITE_APP_TITLE, + + theme: '#409EFF', + + /** + * 侧边栏主题 深色主题theme-dark,浅色主题theme-light + */ + sideTheme: 'theme-dark', + /** + * 是否系统布局配置 + */ + showSettings: true, + + /** + * 是否显示顶部导航 + */ + topNav: false, + + /** + * 是否显示 tagsView + */ + tagsView: true, + + /** + * 是否固定头部 + */ + fixedHeader: false, + + /** + * 是否显示logo + */ + sidebarLogo: true, + + /** + * 是否显示动态标题 + */ + dynamicTitle: false, + + /** + * @type {string | array} 'production' | ['production', 'development'] + * @description Need show err logs component. + * The default is only used in the production env + * If you want to also use it in dev, you can pass ['production', 'development'] + */ + errorLog: 'production', + + animationEnable: false, + + dark: false, + language: LanguageEnum.zh_CN, + + size: 'default', + + layout: '' +}; +export default setting; diff --git a/src/store/index.ts b/src/store/index.ts new file mode 100644 index 0000000..069d54e --- /dev/null +++ b/src/store/index.ts @@ -0,0 +1,3 @@ +const store = createPinia(); + +export default store; diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts new file mode 100644 index 0000000..0205fab --- /dev/null +++ b/src/store/modules/app.ts @@ -0,0 +1,72 @@ +import zhCN from 'element-plus/es/locale/lang/zh-cn'; +import enUS from 'element-plus/es/locale/lang/en'; + +export const useAppStore = defineStore('app', () => { + const sidebarStatus = useStorage('sidebarStatus', '1'); + const sidebar = reactive({ + opened: sidebarStatus.value ? !!+sidebarStatus.value : true, + withoutAnimation: false, + hide: false + }); + const device = ref('desktop'); + const size = useStorage<'large' | 'default' | 'small'>('size', 'default'); + + // 语言 + const language = useStorage('language', 'zh_CN'); + const languageObj: any = { + en_US: enUS, + zh_CN: zhCN + }; + const locale = computed(() => { + return languageObj[language.value]; + }); + + const toggleSideBar = (withoutAnimation: boolean) => { + if (sidebar.hide) { + return false; + } + + sidebar.opened = !sidebar.opened; + sidebar.withoutAnimation = withoutAnimation; + if (sidebar.opened) { + sidebarStatus.value = '1'; + } else { + sidebarStatus.value = '0'; + } + }; + + const closeSideBar = ({ withoutAnimation }: any): void => { + sidebarStatus.value = '0'; + sidebar.opened = false; + sidebar.withoutAnimation = withoutAnimation; + }; + const toggleDevice = (d: string): void => { + device.value = d; + }; + const setSize = (s: 'large' | 'default' | 'small'): void => { + size.value = s; + }; + const toggleSideBarHide = (status: boolean): void => { + sidebar.hide = status; + }; + + const changeLanguage = (val: string): void => { + language.value = val; + }; + + return { + device, + sidebar, + language, + locale, + size, + changeLanguage, + toggleSideBar, + closeSideBar, + toggleDevice, + setSize, + toggleSideBarHide + }; +}); + +export default useAppStore; diff --git a/src/store/modules/dict.ts b/src/store/modules/dict.ts new file mode 100644 index 0000000..cd1a41d --- /dev/null +++ b/src/store/modules/dict.ts @@ -0,0 +1,65 @@ +export const useDictStore = defineStore('dict', () => { + const dict = ref>(new Map()); + + /** + * 获取字典 + * @param _key 字典key + */ + const getDict = (_key: string): DictDataOption[] | null => { + if (!_key) { + return null; + } + return dict.value.get(_key) || null; + }; + + /** + * 设置字典 + * @param _key 字典key + * @param _value 字典value + */ + const setDict = (_key: string, _value: DictDataOption[]) => { + if (!_key) { + return false; + } + try { + dict.value.set(_key, _value); + return true; + } catch (e) { + console.error('Error in setDict:', e); + return false; + } + }; + + /** + * 删除字典 + * @param _key + */ + const removeDict = (_key: string): boolean => { + if (!_key) { + return false; + } + try { + return dict.value.delete(_key); + } catch (e) { + console.error('Error in removeDict:', e); + return false; + } + }; + + /** + * 清空字典 + */ + const cleanDict = (): void => { + dict.value.clear(); + }; + + return { + dict, + getDict, + setDict, + removeDict, + cleanDict + }; +}); + +export default useDictStore; diff --git a/src/store/modules/notice.ts b/src/store/modules/notice.ts new file mode 100644 index 0000000..de980b6 --- /dev/null +++ b/src/store/modules/notice.ts @@ -0,0 +1,42 @@ +import { defineStore } from 'pinia'; + +interface NoticeItem { + title?: string; + read: boolean; + message: any; + time: string; +} + +export const useNoticeStore = defineStore('notice', () => { + const state = reactive({ + notices: [] as NoticeItem[] + }); + + const addNotice = (notice: NoticeItem) => { + state.notices.push(notice); + }; + + const removeNotice = (notice: NoticeItem) => { + state.notices.splice(state.notices.indexOf(notice), 1); + }; + + //实现全部已读 + const readAll = () => { + state.notices.forEach((item: any) => { + item.read = true; + }); + }; + + const clearNotice = () => { + state.notices = []; + }; + return { + state, + addNotice, + removeNotice, + readAll, + clearNotice + }; +}); + +export default useNoticeStore; diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts new file mode 100644 index 0000000..43fcef8 --- /dev/null +++ b/src/store/modules/permission.ts @@ -0,0 +1,221 @@ +import { defineStore } from 'pinia'; +import router, { constantRoutes, dynamicRoutes } from '@/router'; +import store from '@/store'; +import { getRouters } from '@/api/menu'; +import auth from '@/plugins/auth'; +import { RouteRecordRaw } from 'vue-router'; + +import Layout from '@/layout/index.vue'; +import ParentView from '@/components/ParentView/index.vue'; +import InnerLink from '@/layout/components/InnerLink/index.vue'; + +import { createCustomNameComponent } from '@/utils/createCustomNameComponent'; + +// 匹配views里面所有的.vue文件 +const modules = import.meta.glob('./../../views/**/*.vue'); +export const usePermissionStore = defineStore('permission', () => { + const routes = ref([]); + const addRoutes = ref([]); + const defaultRoutes = ref([]); + const topbarRouters = ref([]); + const sidebarRouters = ref([]); + + const getRoutes = (): RouteRecordRaw[] => { + return routes.value as RouteRecordRaw[]; + }; + const getSidebarRoutes = (): RouteRecordRaw[] => { + return sidebarRouters.value as RouteRecordRaw[]; + }; + const getTopbarRoutes = (): RouteRecordRaw[] => { + return topbarRouters.value as RouteRecordRaw[]; + }; + + const setRoutes = (newRoutes: RouteRecordRaw[]): void => { + addRoutes.value = newRoutes; + routes.value = constantRoutes.concat(newRoutes); + }; + const setDefaultRoutes = (routes: RouteRecordRaw[]): void => { + defaultRoutes.value = constantRoutes.concat(routes); + }; + const setTopbarRoutes = (routes: RouteRecordRaw[]): void => { + topbarRouters.value = routes; + }; + const setSidebarRouters = (routes: RouteRecordRaw[]): void => { + sidebarRouters.value = routes; + }; + const generateRoutes = async (): Promise => { + const res = await getRouters(); + const { data } = res; + const sdata = JSON.parse(JSON.stringify(data)); + const rdata = JSON.parse(JSON.stringify(data)); + const defaultData = JSON.parse(JSON.stringify(data)); + const sidebarRoutes = filterAsyncRouter(sdata); + const rewriteRoutes = filterAsyncRouter(rdata, undefined, true); + const defaultRoutes = filterAsyncRouter(defaultData); + const asyncRoutes = filterDynamicRoutes(dynamicRoutes); + asyncRoutes.forEach((route) => { + router.addRoute(route); + }); + setRoutes(rewriteRoutes); + setSidebarRouters(constantRoutes.concat(sidebarRoutes)); + setDefaultRoutes(sidebarRoutes); + setTopbarRoutes(defaultRoutes); + // 路由name重复检查 + duplicateRouteChecker(asyncRoutes, sidebarRoutes); + return new Promise((resolve) => resolve(rewriteRoutes)); + }; + + /** + * 遍历后台传来的路由字符串,转换为组件对象 + * @param asyncRouterMap 后台传来的路由字符串 + * @param lastRouter 上一级路由 + * @param type 是否是重写路由 + */ + const filterAsyncRouter = (asyncRouterMap: RouteRecordRaw[], lastRouter?: RouteRecordRaw, type = false): RouteRecordRaw[] => { + return asyncRouterMap.filter((route) => { + if (type && route.children) { + route.children = filterChildren(route.children, undefined); + } + // Layout ParentView 组件特殊处理 + if (route.component?.toString() === 'Layout') { + route.component = Layout; + } else if (route.component?.toString() === 'ParentView') { + route.component = ParentView; + } else if (route.component?.toString() === 'InnerLink') { + route.component = InnerLink; + } else { + route.component = loadView(route.component, route.name as string); + } + if (route.children != null && route.children && route.children.length) { + route.children = filterAsyncRouter(route.children, route, type); + } else { + delete route.children; + delete route.redirect; + } + return true; + }); + }; + const filterChildren = (childrenMap: RouteRecordRaw[], lastRouter?: RouteRecordRaw): RouteRecordRaw[] => { + let children: RouteRecordRaw[] = []; + childrenMap.forEach((el) => { + if (el.children && el.children.length) { + if (el.component?.toString() === 'ParentView' && !lastRouter) { + el.children.forEach((c) => { + c.path = el.path + '/' + c.path; + if (c.children && c.children.length) { + children = children.concat(filterChildren(c.children, c)); + return; + } + children.push(c); + }); + return; + } + } + if (lastRouter) { + el.path = lastRouter.path + '/' + el.path; + if (el.children && el.children.length) { + children = children.concat(filterChildren(el.children, el)); + return; + } + } + children = children.concat(el); + }); + return children; + }; + return { + routes, + topbarRouters, + sidebarRouters, + defaultRoutes, + + getRoutes, + getSidebarRoutes, + getTopbarRoutes, + + setRoutes, + generateRoutes, + setSidebarRouters + }; +}); + +// 动态路由遍历,验证是否具备权限 +export const filterDynamicRoutes = (routes: RouteRecordRaw[]) => { + const res: RouteRecordRaw[] = []; + routes.forEach((route) => { + if (route.permissions) { + if (auth.hasPermiOr(route.permissions)) { + res.push(route); + } + } else if (route.roles) { + if (auth.hasRoleOr(route.roles)) { + res.push(route); + } + } + }); + return res; +}; + +export const loadView = (view: any, name: string) => { + let res; + for (const path in modules) { + const viewsIndex = path.indexOf('/views/'); + let dir = path.substring(viewsIndex + 7); + dir = dir.substring(0, dir.lastIndexOf('.vue')); + if (dir === view) { + res = createCustomNameComponent(modules[path], { name }); + return res; + } + } + return res; +}; + +// 非setup +export const usePermissionStoreHook = () => { + return usePermissionStore(store); +}; + +interface Route { + name?: string | symbol; + path: string; + children?: Route[]; +} + +/** + * 检查路由name是否重复 + * @param localRoutes 本地路由 + * @param routes 动态路由 + */ +function duplicateRouteChecker(localRoutes: Route[], routes: Route[]) { + // 展平 + function flatRoutes(routes: Route[]) { + const res: Route[] = []; + routes.forEach((route) => { + if (route.children) { + res.push(...flatRoutes(route.children)); + } else { + res.push(route); + } + }); + return res; + } + + const allRoutes = flatRoutes([...localRoutes, ...routes]); + + const nameList: string[] = []; + allRoutes.forEach((route) => { + const name = route.name.toString(); + if (name && nameList.includes(name)) { + const message = `路由名称: [${name}] 重复, 会造成 404`; + console.error(message); + ElNotification({ + title: '路由名称重复', + message, + type: 'error' + }); + return; + } + nameList.push(route.name.toString()); + }); +} + +export default usePermissionStore; diff --git a/src/store/modules/settings.ts b/src/store/modules/settings.ts new file mode 100644 index 0000000..ef49b3c --- /dev/null +++ b/src/store/modules/settings.ts @@ -0,0 +1,47 @@ +import { defineStore } from 'pinia'; +import defaultSettings from '@/settings'; +import { useDynamicTitle } from '@/utils/dynamicTitle'; + +export const useSettingsStore = defineStore('setting', () => { + const storageSetting = useStorage('layout-setting', { + topNav: defaultSettings.topNav, + tagsView: defaultSettings.tagsView, + fixedHeader: defaultSettings.fixedHeader, + sidebarLogo: defaultSettings.sidebarLogo, + dynamicTitle: defaultSettings.dynamicTitle, + sideTheme: defaultSettings.sideTheme, + theme: defaultSettings.theme + }); + const title = ref(defaultSettings.title); + const theme = ref(storageSetting.value.theme); + const sideTheme = ref(storageSetting.value.sideTheme); + const showSettings = ref(defaultSettings.showSettings); + const topNav = ref(storageSetting.value.topNav); + const tagsView = ref(storageSetting.value.tagsView); + const fixedHeader = ref(storageSetting.value.fixedHeader); + const sidebarLogo = ref(storageSetting.value.sidebarLogo); + const dynamicTitle = ref(storageSetting.value.dynamicTitle); + const animationEnable = ref(defaultSettings.animationEnable); + const dark = ref(defaultSettings.dark); + + const setTitle = (value: string) => { + title.value = value; + useDynamicTitle(); + }; + return { + title, + theme, + sideTheme, + showSettings, + topNav, + tagsView, + fixedHeader, + sidebarLogo, + dynamicTitle, + animationEnable, + dark, + setTitle + }; +}); + +export default useSettingsStore; diff --git a/src/store/modules/tagsView.ts b/src/store/modules/tagsView.ts new file mode 100644 index 0000000..b6cf434 --- /dev/null +++ b/src/store/modules/tagsView.ts @@ -0,0 +1,233 @@ +import { RouteLocationNormalized } from 'vue-router'; + +export const useTagsViewStore = defineStore('tagsView', () => { + const visitedViews = ref([]); + const cachedViews = ref([]); + const iframeViews = ref([]); + + const getVisitedViews = (): RouteLocationNormalized[] => { + return visitedViews.value as RouteLocationNormalized[]; + }; + const getIframeViews = (): RouteLocationNormalized[] => { + return iframeViews.value as RouteLocationNormalized[]; + }; + const getCachedViews = (): string[] => { + return cachedViews.value; + }; + + const addView = (view: RouteLocationNormalized) => { + addVisitedView(view); + addCachedView(view); + }; + + const addIframeView = (view: RouteLocationNormalized): void => { + if (iframeViews.value.some((v: RouteLocationNormalized) => v.path === view.path)) return; + iframeViews.value.push( + Object.assign({}, view, { + title: view.meta?.title || 'no-name' + }) + ); + }; + const delIframeView = (view: RouteLocationNormalized): Promise => { + return new Promise((resolve) => { + iframeViews.value = iframeViews.value.filter((item: RouteLocationNormalized) => item.path !== view.path); + resolve([...(iframeViews.value as RouteLocationNormalized[])]); + }); + }; + const addVisitedView = (view: RouteLocationNormalized): void => { + if (visitedViews.value.some((v: RouteLocationNormalized) => v.path === view.path)) return; + visitedViews.value.push( + Object.assign({}, view, { + title: view.meta?.title || 'no-name' + }) + ); + }; + const delView = ( + view: RouteLocationNormalized + ): Promise<{ + visitedViews: RouteLocationNormalized[]; + cachedViews: string[]; + }> => { + return new Promise((resolve) => { + delVisitedView(view); + if (!isDynamicRoute(view)) { + delCachedView(view); + } + resolve({ + visitedViews: [...(visitedViews.value as RouteLocationNormalized[])], + cachedViews: [...cachedViews.value] + }); + }); + }; + + const delVisitedView = (view: RouteLocationNormalized): Promise => { + return new Promise((resolve) => { + for (const [i, v] of visitedViews.value.entries()) { + if (v.path === view.path) { + visitedViews.value.splice(i, 1); + break; + } + } + resolve([...(visitedViews.value as RouteLocationNormalized[])]); + }); + }; + const delCachedView = (view?: RouteLocationNormalized): Promise => { + let viewName = ''; + if (view) { + viewName = view.name as string; + } + return new Promise((resolve) => { + const index = cachedViews.value.indexOf(viewName); + index > -1 && cachedViews.value.splice(index, 1); + resolve([...cachedViews.value]); + }); + }; + const delOthersViews = ( + view: RouteLocationNormalized + ): Promise<{ + visitedViews: RouteLocationNormalized[]; + cachedViews: string[]; + }> => { + return new Promise((resolve) => { + delOthersVisitedViews(view); + delOthersCachedViews(view); + resolve({ + visitedViews: [...(visitedViews.value as RouteLocationNormalized[])], + cachedViews: [...cachedViews.value] + }); + }); + }; + + const delOthersVisitedViews = (view: RouteLocationNormalized): Promise => { + return new Promise((resolve) => { + visitedViews.value = visitedViews.value.filter((v: RouteLocationNormalized) => { + return v.meta?.affix || v.path === view.path; + }); + resolve([...(visitedViews.value as RouteLocationNormalized[])]); + }); + }; + const delOthersCachedViews = (view: RouteLocationNormalized): Promise => { + const viewName = view.name as string; + return new Promise((resolve) => { + const index = cachedViews.value.indexOf(viewName); + if (index > -1) { + cachedViews.value = cachedViews.value.slice(index, index + 1); + } else { + cachedViews.value = []; + } + resolve([...cachedViews.value]); + }); + }; + + const delAllViews = (): Promise<{ visitedViews: RouteLocationNormalized[]; cachedViews: string[] }> => { + return new Promise((resolve) => { + delAllVisitedViews(); + delAllCachedViews(); + resolve({ + visitedViews: [...(visitedViews.value as RouteLocationNormalized[])], + cachedViews: [...cachedViews.value] + }); + }); + }; + const delAllVisitedViews = (): Promise => { + return new Promise((resolve) => { + visitedViews.value = visitedViews.value.filter((tag: RouteLocationNormalized) => tag.meta?.affix); + resolve([...(visitedViews.value as RouteLocationNormalized[])]); + }); + }; + + const delAllCachedViews = (): Promise => { + return new Promise((resolve) => { + cachedViews.value = []; + resolve([...cachedViews.value]); + }); + }; + + const updateVisitedView = (view: RouteLocationNormalized): void => { + for (let v of visitedViews.value) { + if (v.path === view.path) { + v = Object.assign(v, view); + break; + } + } + }; + const delRightTags = (view: RouteLocationNormalized): Promise => { + return new Promise((resolve) => { + const index = visitedViews.value.findIndex((v: RouteLocationNormalized) => v.path === view.path); + if (index === -1) { + return; + } + visitedViews.value = visitedViews.value.filter((item: RouteLocationNormalized, idx: number) => { + if (idx <= index || (item.meta && item.meta.affix)) { + return true; + } + const i = cachedViews.value.indexOf(item.name as string); + if (i > -1) { + cachedViews.value.splice(i, 1); + } + return false; + }); + resolve([...(visitedViews.value as RouteLocationNormalized[])]); + }); + }; + const delLeftTags = (view: RouteLocationNormalized): Promise => { + return new Promise((resolve) => { + const index = visitedViews.value.findIndex((v: RouteLocationNormalized) => v.path === view.path); + if (index === -1) { + return; + } + visitedViews.value = visitedViews.value.filter((item: RouteLocationNormalized, idx: number) => { + if (idx >= index || (item.meta && item.meta.affix)) { + return true; + } + const i = cachedViews.value.indexOf(item.name as string); + if (i > -1) { + cachedViews.value.splice(i, 1); + } + return false; + }); + resolve([...(visitedViews.value as RouteLocationNormalized[])]); + }); + }; + + const addCachedView = (view: RouteLocationNormalized): void => { + const viewName = view.name as string; + if (!viewName) return; + if (cachedViews.value.includes(viewName)) return; + if (!view.meta?.noCache) { + cachedViews.value.push(viewName); + } + }; + + const isDynamicRoute = (view: RouteLocationNormalized): boolean => { + // 检查匹配的路由记录中是否有动态段 + return view.matched.some((m) => m.path.includes(':')); + }; + + return { + visitedViews, + cachedViews, + iframeViews, + + getVisitedViews, + getIframeViews, + getCachedViews, + + addVisitedView, + addCachedView, + delVisitedView, + delCachedView, + updateVisitedView, + addView, + delView, + delAllViews, + delAllVisitedViews, + delAllCachedViews, + delOthersViews, + delRightTags, + delLeftTags, + addIframeView, + delIframeView + }; +}); +export default useTagsViewStore; diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts new file mode 100644 index 0000000..56f369b --- /dev/null +++ b/src/store/modules/user.ts @@ -0,0 +1,91 @@ +import { to } from 'await-to-js'; +import { getToken, removeToken, setToken } from '@/utils/auth'; +import { login as loginApi, logout as logoutApi, getInfo as getUserInfo } from '@/api/login'; +import { LoginData } from '@/api/types'; +import defAva from '@/assets/images/profile.jpg'; +import store from '@/store'; + +export const useUserStore = defineStore('user', () => { + const token = ref(getToken()); + const name = ref(''); + const nickname = ref(''); + const userId = ref(''); + const tenantId = ref(''); + const avatar = ref(''); + const roles = ref>([]); // 用户角色编码集合 → 判断路由权限 + const permissions = ref>([]); // 用户权限编码集合 → 判断按钮权限 + + /** + * 登录 + * @param userInfo + * @returns + */ + const login = async (userInfo: LoginData): Promise => { + const [err, res] = await to(loginApi(userInfo)); + if (res) { + const data = res.data; + setToken(data.access_token); + token.value = data.access_token; + return Promise.resolve(); + } + return Promise.reject(err); + }; + + // 获取用户信息 + const getInfo = async (): Promise => { + const [err, res] = await to(getUserInfo()); + if (res) { + const data = res.data; + const user = data.user; + const profile = user.avatar == '' || user.avatar == null ? defAva : user.avatar; + + if (data.roles && data.roles.length > 0) { + // 验证返回的roles是否是一个非空数组 + roles.value = data.roles; + permissions.value = data.permissions; + } else { + roles.value = ['ROLE_DEFAULT']; + } + name.value = user.userName; + nickname.value = user.nickName; + avatar.value = profile; + userId.value = user.userId; + tenantId.value = user.tenantId; + return Promise.resolve(); + } + return Promise.reject(err); + }; + + // 注销 + const logout = async (): Promise => { + await logoutApi(); + token.value = ''; + roles.value = []; + permissions.value = []; + removeToken(); + }; + + const setAvatar = (value: string) => { + avatar.value = value; + }; + + return { + userId, + tenantId, + token, + nickname, + avatar, + roles, + permissions, + login, + getInfo, + logout, + setAvatar + }; +}); + +export default useUserStore; +// 非setup +export function useUserStoreHook() { + return useUserStore(store); +} diff --git a/src/types/axios.d.ts b/src/types/axios.d.ts new file mode 100644 index 0000000..9f2c6d2 --- /dev/null +++ b/src/types/axios.d.ts @@ -0,0 +1,9 @@ +export {}; +declare module 'axios' { + interface AxiosResponse { + code: number; + msg: string; + rows: T; + total: number; + } +} diff --git a/src/types/element.d.ts b/src/types/element.d.ts new file mode 100644 index 0000000..ae6ecfc --- /dev/null +++ b/src/types/element.d.ts @@ -0,0 +1,35 @@ +import type * as ep from 'element-plus'; +declare global { + declare type ElTagType = 'primary' | 'success' | 'info' | 'warning' | 'danger'; + declare type ElFormInstance = ep.FormInstance; + declare type ElTableInstance = ep.TableInstance; + declare type ElUploadInstance = ep.UploadInstance; + declare type ElScrollbarInstance = ep.ScrollbarInstance; + declare type ElInputInstance = ep.InputInstance; + declare type ElInputNumberInstance = ep.InputNumberInstance; + declare type ElRadioInstance = ep.RadioInstance; + declare type ElRadioGroupInstance = ep.RadioGroupInstance; + declare type ElRadioButtonInstance = ep.RadioButtonInstance; + declare type ElCheckboxInstance = ep.CheckboxInstance; + declare type ElSwitchInstance = ep.SwitchInstance; + declare type ElCascaderInstance = ep.CascaderInstance; + declare type ElColorPickerInstance = ep.ColorPickerInstance; + declare type ElRateInstance = ep.RateInstance; + declare type ElSliderInstance = ep.SliderInstance; + + declare type ElTreeInstance = InstanceType; + declare type ElTreeSelectInstance = InstanceType; + declare type ElSelectInstance = InstanceType; + declare type ElCardInstance = InstanceType; + declare type ElDialogInstance = InstanceType; + declare type ElCheckboxGroupInstance = InstanceType; + declare type ElDatePickerInstance = InstanceType; + declare type ElTimePickerInstance = InstanceType; + declare type ElTimeSelectInstance = InstanceType; + + declare type TransferKey = ep.TransferKey; + declare type CheckboxValueType = ep.CheckboxValueType; + declare type ElFormRules = ep.FormRules; + declare type DateModelType = ep.DateModelType; + declare type UploadFile = ep.UploadFile; +} diff --git a/src/types/env.d.ts b/src/types/env.d.ts new file mode 100644 index 0000000..1fb9f62 --- /dev/null +++ b/src/types/env.d.ts @@ -0,0 +1,27 @@ +declare module '*.vue' { + import { DefineComponent } from 'vue'; + const Component: DefineComponent<{}, {}, any>; + export default Component; +} + +// 环境变量 +interface ImportMetaEnv { + VITE_APP_TITLE: string; + VITE_APP_PORT: number; + VITE_APP_BASE_API: string; + VITE_APP_BASE_URL: string; + VITE_APP_CONTEXT_PATH: string; + VITE_APP_MONITOR_ADMIN: string; + VITE_APP_SNAILJOB_ADMIN: string; + VITE_APP_ENV: string; + VITE_APP_ENCRYPT: string; + VITE_APP_RSA_PUBLIC_KEY: string; + VITE_APP_RSA_PRIVATE_KEY: string; + VITE_APP_CLIENT_ID: string; + VITE_APP_WEBSOCKET: string; + VITE_APP_SSE: string; +} +interface ImportMeta { + readonly env: ImportMetaEnv; + // readonly glob: any; +} diff --git a/src/types/global.d.ts b/src/types/global.d.ts new file mode 100644 index 0000000..229e181 --- /dev/null +++ b/src/types/global.d.ts @@ -0,0 +1,164 @@ +import type { PropType as VuePropType, ComponentInternalInstance as ComponentInstance } from 'vue'; +import { LanguageEnum } from '@/enums/LanguageEnum'; + +declare global { + /** vue Instance */ + declare type ComponentInternalInstance = ComponentInstance; + + /** + * 界面字段隐藏属性 + */ + declare interface FieldOption { + key: number; + label: string; + visible: boolean; + children?: Array; + } + + /** + * 弹窗属性 + */ + declare interface DialogOption { + /** + * 弹窗标题 + */ + title?: string; + /** + * 是否显示 + */ + visible: boolean; + } + + declare interface UploadOption { + /** 设置上传的请求头部 */ + headers: { [key: string]: any }; + + /** 上传的地址 */ + url: string; + } + + /** + * 导入属性 + */ + declare interface ImportOption extends UploadOption { + /** 是否显示弹出层 */ + open: boolean; + /** 弹出层标题 */ + title: string; + /** 是否禁用上传 */ + isUploading: boolean; + + updateSupport: number; + + /** 其他参数 */ + [key: string]: any; + } + /** + * 字典数据 数据配置 + */ + declare interface DictDataOption { + label: string; + value: string; + elTagType?: ElTagType; + elTagClass?: string; + } + + declare interface BaseEntity { + createBy?: any; + createDept?: any; + createTime?: string; + updateBy?: any; + updateTime?: any; + } + + /** + * 分页数据 + * T : 表单数据 + * D : 查询参数 + */ + declare interface PageData { + form: T; + queryParams: D; + rules: ElFormRules; + } + /** + * 分页查询参数 + */ + declare interface PageQuery { + pageNum: number; + pageSize: number; + } + declare interface LayoutSetting { + /** + * 是否显示顶部导航 + */ + topNav: boolean; + + /** + * 是否显示多标签导航 + */ + tagsView: boolean; + /** + * 是否固定头部 + */ + fixedHeader: boolean; + /** + * 是否显示侧边栏Logo + */ + sidebarLogo: boolean; + /** + * 是否显示动态标题 + */ + dynamicTitle: boolean; + /** + * 侧边栏主题 theme-dark | theme-light + */ + sideTheme: string; + /** + * 主题模式 + */ + theme: string; + } + + declare interface DefaultSettings extends LayoutSetting { + /** + * 网页标题 + */ + title: string; + + /** + * 是否显示系统布局设置 + */ + showSettings: boolean; + + /** + * 导航栏布局 + */ + layout: string; + + /** + * 布局大小 + */ + size: 'large' | 'default' | 'small'; + + /** + * 语言 + */ + language: LanguageEnum; + + /** + * 是否启用动画效果 + */ + animationEnable: boolean; + /** + * 是否启用暗黑模式 + * + * true:暗黑模式 + * false: 明亮模式 + */ + dark: boolean; + + errorLog: string; + } +} +export {}; diff --git a/src/types/module.d.ts b/src/types/module.d.ts new file mode 100644 index 0000000..2fc273a --- /dev/null +++ b/src/types/module.d.ts @@ -0,0 +1,51 @@ +import modal from '@/plugins/modal'; +import tab from '@/plugins/tab'; +import download from '@/plugins/download'; +import auth from '@/plugins/auth'; +import cache from '@/plugins/cache'; +import animate from '@/animate'; +import { useDict } from '@/utils/dict'; +import { handleTree, addDateRange, selectDictLabel, selectDictLabels, parseTime } from '@/utils/ruoyi'; +import { getConfigKey, updateConfigByKey } from '@/api/system/config'; +import { download as rd } from '@/utils/request'; +import type { LanguageType } from '@/lang'; + +export {}; + +declare module '@vue/runtime-core' { + interface ComponentCustomProperties { + // 全局方法声明 + $modal: typeof modal; + $tab: typeof tab; + $download: typeof download; + $auth: typeof auth; + $cache: typeof cache; + animate: typeof animate; + /** + * i18n $t方法支持ts类型提示 + * @param key i18n key + */ + $t(key: ObjKeysToUnion): string; + + useDict: typeof useDict; + addDateRange: typeof addDateRange; + download: typeof rd; + handleTree: typeof handleTree; + getConfigKey: typeof getConfigKey; + updateConfigByKey: typeof updateConfigByKey; + selectDictLabel: typeof selectDictLabel; + selectDictLabels: typeof selectDictLabels; + parseTime: typeof parseTime; + } +} + +/** + * { a: 1, b: { ba: { baa: 1, bab: 2 }, bb: 2} } ---> a | b.ba.baa | b.ba.bab | b.bb + * https://juejin.cn/post/7280062870670606397 + */ +export type ObjKeysToUnion = T extends object + ? { + [K in keyof T]: ObjKeysToUnion; + }[keyof T] + : P; + diff --git a/src/types/router.d.ts b/src/types/router.d.ts new file mode 100644 index 0000000..11a60a0 --- /dev/null +++ b/src/types/router.d.ts @@ -0,0 +1,38 @@ +import { LocationQuery, type RouteMeta as VRouteMeta } from 'vue-router'; +declare module 'vue-router' { + interface RouteMeta extends VRouteMeta { + link?: string; + title?: string; + affix?: boolean; + noCache?: boolean; + activeMenu?: string; + icon?: string; + breadcrumb?: boolean; + } + + interface _RouteRecordBase { + hidden?: boolean | string | number; + permissions?: string[]; + roles?: string[]; + alwaysShow?: boolean; + query?: string; + parentPath?: string; + } + + interface _RouteLocationBase { + children?: _RouteRecordBase[]; + path?: string; + title?: string; + } + + interface TagView { + fullPath?: string; + name?: string; + path?: string; + title?: string; + meta?: RouteMeta; + query?: LocationQuery; + } +} + +export {}; diff --git a/src/utils/auth.ts b/src/utils/auth.ts new file mode 100644 index 0000000..d7ff321 --- /dev/null +++ b/src/utils/auth.ts @@ -0,0 +1,23 @@ +const TokenKey = 'Admin-Token'; + +const tokenStorage = useStorage(TokenKey, null); + +export function getToken() { + const token = localStorage.getItem('token'); + return token; +} + +export function setToken(token: string) { + localStorage.setItem('token', token); +} + +export function removeToken() { + localStorage.removeItem('token'); +} + +// export function getToken() { +// return localStorage.getItem('token'); +// } +// export const getToken = () => tokenStorage.value; +// export const setToken = (access_token: string) => (tokenStorage.value = access_token); +// export const removeToken = () => (tokenStorage.value = null); diff --git a/src/utils/createCustomNameComponent.tsx b/src/utils/createCustomNameComponent.tsx new file mode 100644 index 0000000..daf5866 --- /dev/null +++ b/src/utils/createCustomNameComponent.tsx @@ -0,0 +1,39 @@ +/** + * 后台返回的路由动态生成name 解决缓存问题 + * 感谢 @fourteendp + * 详见 https://github.com/vbenjs/vue-vben-admin/issues/3927 + */ +import { Component, defineComponent, h } from 'vue'; + +interface Options { + name?: string; +} + +export function createCustomNameComponent(loader: () => Promise, options: Options = {}): () => Promise { + const { name } = options; + let component: Component | null = null; + + const load = async () => { + try { + const { default: loadedComponent } = await loader(); + component = loadedComponent; + } catch (error) { + console.error(`Cannot resolve component ${name}, error:`, error); + } + }; + + return async () => { + if (!component) { + await load(); + } + + return Promise.resolve( + defineComponent({ + name, + render() { + return h(component as Component); + } + }) + ); + }; +} diff --git a/src/utils/crypto.ts b/src/utils/crypto.ts new file mode 100644 index 0000000..8217146 --- /dev/null +++ b/src/utils/crypto.ts @@ -0,0 +1,66 @@ +import CryptoJS from 'crypto-js'; + +/** + * 随机生成32位的字符串 + * @returns {string} + */ +const generateRandomString = () => { + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + let result = ''; + const charactersLength = characters.length; + for (let i = 0; i < 32; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; +}; + +/** + * 随机生成aes 密钥 + * @returns {string} + */ +export const generateAesKey = () => { + return CryptoJS.enc.Utf8.parse(generateRandomString()); +}; + +/** + * 加密base64 + * @returns {string} + */ +export const encryptBase64 = (str: CryptoJS.lib.WordArray) => { + return CryptoJS.enc.Base64.stringify(str); +}; + +/** + * 解密base64 + */ +export const decryptBase64 = (str: string) => { + return CryptoJS.enc.Base64.parse(str); +}; + +/** + * 使用密钥对数据进行加密 + * @param message + * @param aesKey + * @returns {string} + */ +export const encryptWithAes = (message: string, aesKey: CryptoJS.lib.WordArray) => { + const encrypted = CryptoJS.AES.encrypt(message, aesKey, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }); + return encrypted.toString(); +}; + +/** + * 使用密钥对数据进行解密 + * @param message + * @param aesKey + * @returns {string} + */ +export const decryptWithAes = (message: string, aesKey: CryptoJS.lib.WordArray) => { + const decrypted = CryptoJS.AES.decrypt(message, aesKey, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }); + return decrypted.toString(CryptoJS.enc.Utf8); +}; diff --git a/src/utils/dict.ts b/src/utils/dict.ts new file mode 100644 index 0000000..0575072 --- /dev/null +++ b/src/utils/dict.ts @@ -0,0 +1,27 @@ +import { getDicts } from '@/api/system/dict/data'; +import { useDictStore } from '@/store/modules/dict'; +/** + * 获取字典数据 + */ +export const useDict = (...args: string[]): { [key: string]: DictDataOption[] } => { + const res = ref<{ + [key: string]: DictDataOption[]; + }>({}); + return (() => { + args.forEach(async (dictType) => { + res.value[dictType] = []; + const dicts = useDictStore().getDict(dictType); + if (dicts) { + res.value[dictType] = dicts; + } else { + await getDicts(dictType).then((resp) => { + res.value[dictType] = resp.data.map( + (p): DictDataOption => ({ label: p.dictLabel, value: p.dictValue, elTagType: p.listClass, elTagClass: p.cssClass }) + ); + useDictStore().setDict(dictType, res.value[dictType]); + }); + } + }); + return res.value; + })(); +}; diff --git a/src/utils/dynamicTitle.ts b/src/utils/dynamicTitle.ts new file mode 100644 index 0000000..8e23ef8 --- /dev/null +++ b/src/utils/dynamicTitle.ts @@ -0,0 +1,14 @@ +import defaultSettings from '@/settings'; +import { useSettingsStore } from '@/store/modules/settings'; + +/** + * 动态修改标题 + */ +export const useDynamicTitle = () => { + const settingsStore = useSettingsStore(); + if (settingsStore.dynamicTitle) { + document.title = settingsStore.title + ' - ' + import.meta.env.VITE_APP_TITLE; + } else { + document.title = defaultSettings.title as string; + } +}; diff --git a/src/utils/errorCode.ts b/src/utils/errorCode.ts new file mode 100644 index 0000000..d85914e --- /dev/null +++ b/src/utils/errorCode.ts @@ -0,0 +1,7 @@ +export const errorCode: any = { + '401': '认证失败,无法访问系统资源', + '403': '当前操作没有权限', + '404': '访问资源不存在', + default: '系统未知错误,请反馈给管理员' +}; +export default errorCode; diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts new file mode 100644 index 0000000..ab77af0 --- /dev/null +++ b/src/utils/i18n.ts @@ -0,0 +1,16 @@ +// translate router.meta.title, be used in breadcrumb sidebar tagsview +import i18n from '@/lang/index'; + +/** + * 获取国际化路由,如果不存在则原生返回 + * @param title 路由名称 + * @returns {string} + */ +export const translateRouteTitle = (title: string): string => { + const hasKey = i18n.global.te('route.' + title); + if (hasKey) { + const translatedTitle = i18n.global.t('route.' + title); + return translatedTitle; + } + return title; +}; diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..2b0aad5 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,318 @@ +import { parseTime } from '@/utils/ruoyi'; + +/** + * 表格时间格式化 + */ +export const formatDate = (cellValue: string) => { + if (cellValue == null || cellValue == '') return ''; + const date = new Date(cellValue); + const year = date.getFullYear(); + const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1; + const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); + const hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours(); + const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes(); + const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds(); + return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds; +}; + +/** + * @param {number} time + * @param {string} option + * @returns {string} + */ +export const formatTime = (time: string, option: string) => { + let t: number; + if (('' + time).length === 10) { + t = parseInt(time) * 1000; + } else { + t = +time; + } + const d: any = new Date(t); + const now = Date.now(); + + const diff = (now - d) / 1000; + + if (diff < 30) { + return '刚刚'; + } else if (diff < 3600) { + // less 1 hour + return Math.ceil(diff / 60) + '分钟前'; + } else if (diff < 3600 * 24) { + return Math.ceil(diff / 3600) + '小时前'; + } else if (diff < 3600 * 24 * 2) { + return '1天前'; + } + if (option) { + return parseTime(t, option); + } else { + return d.getMonth() + 1 + '月' + d.getDate() + '日' + d.getHours() + '时' + d.getMinutes() + '分'; + } +}; + +/** + * @param {string} url + * @returns {Object} + */ +export const getQueryObject = (url: string) => { + url = url == null ? window.location.href : url; + const search = url.substring(url.lastIndexOf('?') + 1); + const obj: { [key: string]: string } = {}; + const reg = /([^?&=]+)=([^?&=]*)/g; + search.replace(reg, (rs, $1, $2) => { + const name = decodeURIComponent($1); + let val = decodeURIComponent($2); + val = String(val); + obj[name] = val; + return rs; + }); + return obj; +}; + +/** + * @param {string} input value + * @returns {number} output value + */ +export const byteLength = (str: string) => { + // returns the byte length of an utf8 string + let s = str.length; + for (let i = str.length - 1; i >= 0; i--) { + const code = str.charCodeAt(i); + if (code > 0x7f && code <= 0x7ff) s++; + else if (code > 0x7ff && code <= 0xffff) s += 2; + if (code >= 0xdc00 && code <= 0xdfff) i--; + } + return s; +}; + +/** + * @param {Array} actual + * @returns {Array} + */ +export const cleanArray = (actual: Array) => { + const newArray: any[] = []; + for (let i = 0; i < actual.length; i++) { + if (actual[i]) { + newArray.push(actual[i]); + } + } + return newArray; +}; + +/** + * @param {Object} json + * @returns {Array} + */ +export const param = (json: any) => { + if (!json) return ''; + return cleanArray( + Object.keys(json).map((key) => { + if (json[key] === undefined) return ''; + return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]); + }) + ).join('&'); +}; + +/** + * @param {string} url + * @returns {Object} + */ +export const param2Obj = (url: string) => { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' '); + if (!search) { + return {}; + } + const obj: any = {}; + const searchArr = search.split('&'); + searchArr.forEach((v) => { + const index = v.indexOf('='); + if (index !== -1) { + const name = v.substring(0, index); + const val = v.substring(index + 1, v.length); + obj[name] = val; + } + }); + return obj; +}; + +/** + * @param {string} val + * @returns {string} + */ +export const html2Text = (val: string) => { + const div = document.createElement('div'); + div.innerHTML = val; + return div.textContent || div.innerText; +}; + +/** + * Merges two objects, giving the last one precedence + * @param {Object} target + * @param {(Object|Array)} source + * @returns {Object} + */ +export const objectMerge = (target: any, source: any | any[]) => { + if (typeof target !== 'object') { + target = {}; + } + if (Array.isArray(source)) { + return source.slice(); + } + Object.keys(source).forEach((property) => { + const sourceProperty = source[property]; + if (typeof sourceProperty === 'object') { + target[property] = objectMerge(target[property], sourceProperty); + } else { + target[property] = sourceProperty; + } + }); + return target; +}; + +/** + * @param {HTMLElement} element + * @param {string} className + */ +export const toggleClass = (element: HTMLElement, className: string) => { + if (!element || !className) { + return; + } + let classString = element.className; + const nameIndex = classString.indexOf(className); + if (nameIndex === -1) { + classString += '' + className; + } else { + classString = classString.substring(0, nameIndex) + classString.substring(nameIndex + className.length); + } + element.className = classString; +}; + +/** + * @param {string} type + * @returns {Date} + */ +export const getTime = (type: string) => { + if (type === 'start') { + return new Date().getTime() - 3600 * 1000 * 24 * 90; + } else { + return new Date(new Date().toDateString()); + } +}; + +/** + * @param {Function} func + * @param {number} wait + * @param {boolean} immediate + * @return {*} + */ +export const debounce = (func: any, wait: number, immediate: boolean) => { + let timeout: any, args: any, context: any, timestamp: any, result: any; + + const later = function () { + // 据上一次触发时间间隔 + const last = +new Date() - timestamp; + + // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 + if (!immediate) { + result = func.apply(context, args); + if (!timeout) context = args = null; + } + } + }; + + return (...args: any) => { + context = this; + timestamp = +new Date(); + const callNow = immediate && !timeout; + // 如果延时不存在,重新设定延时 + if (!timeout) timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + return result; + }; +}; + +/** + * This is just a simple version of deep copy + * Has a lot of edge cases bug + * If you want to use a perfect deep copy, use lodash's _.cloneDeep + * @param {Object} source + * @returns {Object} + */ +export const deepClone = (source: any) => { + if (!source && typeof source !== 'object') { + throw new Error('error arguments', 'deepClone' as any); + } + const targetObj: any = source.constructor === Array ? [] : {}; + Object.keys(source).forEach((keys) => { + if (source[keys] && typeof source[keys] === 'object') { + targetObj[keys] = deepClone(source[keys]); + } else { + targetObj[keys] = source[keys]; + } + }); + return targetObj; +}; + +/** + * @param {Array} arr + * @returns {Array} + */ +export const uniqueArr = (arr: any) => { + return Array.from(new Set(arr)); +}; + +/** + * @returns {string} + */ +export const createUniqueString = (): string => { + const timestamp = +new Date() + ''; + const num = (1 + Math.random()) * 65536; + const randomNum = parseInt(num + ''); + return (+(randomNum + timestamp)).toString(32); +}; + +/** + * Check if an element has a class + * @param ele + * @param {string} cls + * @returns {boolean} + */ +export const hasClass = (ele: HTMLElement, cls: string): boolean => { + return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')); +}; + +/** + * Add class to element + * @param ele + * @param {string} cls + */ +export const addClass = (ele: HTMLElement, cls: string) => { + if (!hasClass(ele, cls)) ele.className += ' ' + cls; +}; + +/** + * Remove class from element + * @param ele + * @param {string} cls + */ +export const removeClass = (ele: HTMLElement, cls: string) => { + if (hasClass(ele, cls)) { + const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)'); + ele.className = ele.className.replace(reg, ' '); + } +}; + +/** + * @param {string} path + * @returns {Boolean} + */ +export const isExternal = (path: string) => { + return /^(https?:|http?:|mailto:|tel:)/.test(path); +}; diff --git a/src/utils/jsencrypt.ts b/src/utils/jsencrypt.ts new file mode 100644 index 0000000..42de5a0 --- /dev/null +++ b/src/utils/jsencrypt.ts @@ -0,0 +1,21 @@ +import JSEncrypt from 'jsencrypt'; +// 密钥对生成 http://web.chacuo.net/netrsakeypair + +const publicKey = import.meta.env.VITE_APP_RSA_PUBLIC_KEY; + +// 前端不建议存放私钥 不建议解密数据 因为都是透明的意义不大 +const privateKey = import.meta.env.VITE_APP_RSA_PRIVATE_KEY; + +// 加密 +export const encrypt = (txt: string) => { + const encryptor = new JSEncrypt(); + encryptor.setPublicKey(publicKey); // 设置公钥 + return encryptor.encrypt(txt); // 对数据进行加密 +}; + +// 解密 +export const decrypt = (txt: string) => { + const encryptor = new JSEncrypt(); + encryptor.setPrivateKey(privateKey); // 设置私钥 + return encryptor.decrypt(txt); // 对数据进行解密 +}; diff --git a/src/utils/permission.ts b/src/utils/permission.ts new file mode 100644 index 0000000..eb3838a --- /dev/null +++ b/src/utils/permission.ts @@ -0,0 +1,51 @@ +import useUserStore from '@/store/modules/user'; + +/** + * 字符权限校验 + * @param {Array} value 校验值 + * @returns {Boolean} + */ +export const checkPermi = (value: any) => { + if (value && value instanceof Array && value.length > 0) { + const permissions = useUserStore().permissions; + const permissionDatas = value; + const all_permission = '*:*:*'; + + const hasPermission = permissions.some((permission) => { + return all_permission === permission || permissionDatas.includes(permission); + }); + + if (!hasPermission) { + return false; + } + return true; + } else { + console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`); + return false; + } +}; + +/** + * 角色权限校验 + * @param {Array} value 校验值 + * @returns {Boolean} + */ +export const checkRole = (value: any): boolean => { + if (value && value instanceof Array && value.length > 0) { + const roles = useUserStore().roles; + const permissionRoles = value; + const super_admin = 'admin'; + + const hasRole = roles.some((role) => { + return super_admin === role || permissionRoles.includes(role); + }); + + if (!hasRole) { + return false; + } + return true; + } else { + console.error(`need roles! Like checkRole="['admin','editor']"`); + return false; + } +}; diff --git a/src/utils/propTypes.ts b/src/utils/propTypes.ts new file mode 100644 index 0000000..24d861d --- /dev/null +++ b/src/utils/propTypes.ts @@ -0,0 +1,26 @@ +import { CSSProperties } from 'vue'; +import VueTypes, { createTypes, toValidableType, VueTypeValidableDef, VueTypesInterface } from 'vue-types'; + +type PropTypes = VueTypesInterface & { + readonly style: VueTypeValidableDef; + readonly fieldOption: VueTypeValidableDef>; +}; + +const propTypes = createTypes({ + func: undefined, + bool: undefined, + string: undefined, + number: undefined, + object: undefined, + integer: undefined +}) as PropTypes; + +export default class ProjectTypes extends VueTypes { + static get style() { + return toValidableType('style', { + type: [String, Object], + default: undefined + }); + } +} +export { propTypes }; diff --git a/src/utils/request.ts b/src/utils/request.ts new file mode 100644 index 0000000..ebeca45 --- /dev/null +++ b/src/utils/request.ts @@ -0,0 +1,209 @@ +import axios, { AxiosResponse, InternalAxiosRequestConfig } from 'axios'; +import { useUserStore } from '@/store/modules/user'; +import { getToken } from '@/utils/auth'; +import { tansParams, blobValidate } from '@/utils/ruoyi'; +import cache from '@/plugins/cache'; +import { HttpStatus } from '@/enums/RespEnum'; +import { errorCode } from '@/utils/errorCode'; +import { LoadingInstance } from 'element-plus/es/components/loading/src/loading'; +import FileSaver from 'file-saver'; +import { getLanguage } from '@/lang'; +import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto'; +import { encrypt, decrypt } from '@/utils/jsencrypt'; +import router from '@/router'; + +const encryptHeader = 'encrypt-key'; +let downloadLoadingInstance: LoadingInstance; +// 是否显示重新登录 +export const isRelogin = { show: false }; +export const globalHeaders = () => { + return { + Authorization: 'Bearer ' + getToken(), + clientid: import.meta.env.VITE_APP_CLIENT_ID + }; +}; + +axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'; +axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID; +// 创建 axios 实例 +const service = axios.create({ + baseURL: import.meta.env.VITE_APP_BASE_API, + // baseURL: 'http://api.buzhiyushu.cn', + timeout: 500000, + withCredentials: true // 允许跨域请求携带cookie +}); + +// 请求拦截器 +service.interceptors.request.use( + (config: InternalAxiosRequestConfig) => { + // 对应国际化资源文件后缀 + config.headers['Content-Language'] = getLanguage(); + + const isToken = config.headers?.isToken === false; + // 是否需要防止数据重复提交 + const isRepeatSubmit = config.headers?.repeatSubmit === false; + // 是否需要加密 + const isEncrypt = config.headers?.isEncrypt === 'true'; + + if (getToken() && !isToken) { + config.headers['Authorization'] = 'Bearer ' + getToken(); + } + // get请求映射params参数 + if (config.method === 'get' && config.params) { + let url = config.url + '?' + tansParams(config.params); + url = url.slice(0, -1); + config.params = {}; + config.url = url; + } + + if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { + const requestObj = { + url: config.url, + data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, + time: new Date().getTime() + }; + const sessionObj = cache.session.getJSON('sessionObj'); + if (sessionObj === undefined || sessionObj === null || sessionObj === '') { + cache.session.setJSON('sessionObj', requestObj); + } else { + const s_url = sessionObj.url; // 请求地址 + const s_data = sessionObj.data; // 请求数据 + const s_time = sessionObj.time; // 请求时间 + const interval = 500; // 间隔时间(ms),小于此时间视为重复提交 + if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { + const message = '数据正在处理,请勿重复提交'; + console.warn(`[${s_url}]: ` + message); + return Promise.reject(new Error(message)); + } else { + cache.session.setJSON('sessionObj', requestObj); + } + } + } + if (import.meta.env.VITE_APP_ENCRYPT === 'true') { + // 当开启参数加密 + if (isEncrypt && (config.method === 'post' || config.method === 'put')) { + // 生成一个 AES 密钥 + const aesKey = generateAesKey(); + config.headers[encryptHeader] = encrypt(encryptBase64(aesKey)); + config.data = typeof config.data === 'object' ? encryptWithAes(JSON.stringify(config.data), aesKey) : encryptWithAes(config.data, aesKey); + } + } + // FormData数据去请求头Content-Type + if (config.data instanceof FormData) { + delete config.headers['Content-Type']; + } + return config; + }, + (error: any) => { + return Promise.reject(error); + } +); + +// 响应拦截器 +service.interceptors.response.use( + (res: AxiosResponse) => { + if (import.meta.env.VITE_APP_ENCRYPT === 'true') { + // 加密后的 AES 秘钥 + const keyStr = res.headers[encryptHeader]; + // 加密 + if (keyStr != null && keyStr != '') { + const data = res.data; + // 请求体 AES 解密 + const base64Str = decrypt(keyStr); + // base64 解码 得到请求头的 AES 秘钥 + const aesKey = decryptBase64(base64Str.toString()); + // aesKey 解码 data + const decryptData = decryptWithAes(data, aesKey); + // 将结果 (得到的是 JSON 字符串) 转为 JSON + res.data = JSON.parse(decryptData); + } + } + // 未设置状态码则默认成功状态 + const code = res.data.code || HttpStatus.SUCCESS; + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default']; + // 二进制数据则直接返回 + if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { + return res.data; + } + if (code === 401) { + // prettier-ignore + if (!isRelogin.show) { + isRelogin.show = true; + ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { + confirmButtonText: '重新登录', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + isRelogin.show = false; + useUserStore().logout().then(() => { + router.replace({ + path: '/login', + query: { + redirect: encodeURIComponent(router.currentRoute.value.fullPath || '/') + } + }) + }); + }).catch(() => { + isRelogin.show = false; + }); + } + return Promise.reject('无效的会话,或者会话已过期,请重新登录。'); + } else if (code === HttpStatus.SERVER_ERROR) { + ElMessage({ message: msg, type: 'error' }); + return Promise.reject(new Error(msg)); + } else if (code === HttpStatus.WARN) { + ElMessage({ message: msg, type: 'warning' }); + return Promise.reject(new Error(msg)); + } else if (code !== HttpStatus.SUCCESS) { + ElNotification.error({ title: msg }); + return Promise.reject('error'); + } else { + return Promise.resolve(res.data); + } + }, + (error: any) => { + let { message } = error; + if (message == 'Network Error') { + message = '后端接口连接异常'; + } else if (message.includes('timeout')) { + message = '系统接口请求超时'; + } else if (message.includes('Request failed with status code')) { + message = '系统接口' + message.substr(message.length - 3) + '异常'; + } + ElMessage({ message: message, type: 'error', duration: 5 * 1000 }); + return Promise.reject(error); + } +); +// 通用下载方法 +export function download(url: string, params: any, fileName: string) { + downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' }); + // prettier-ignore + return service.post(url, params, { + transformRequest: [ + (params: any) => { + return tansParams(params); + } + ], + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob' + }).then(async (resp: any) => { + const isLogin = blobValidate(resp); + if (isLogin) { + const blob = new Blob([resp]); + FileSaver.saveAs(blob, fileName); + } else { + const resText = await resp.data.text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']; + ElMessage.error(errMsg); + } + downloadLoadingInstance.close(); + }).catch((r: any) => { + console.error(r); + ElMessage.error('下载文件出现错误,请联系管理员!'); + downloadLoadingInstance.close(); + }); +} +// 导出 axios 实例 +export default service; diff --git a/src/utils/ruoyi.ts b/src/utils/ruoyi.ts new file mode 100644 index 0000000..8efd12c --- /dev/null +++ b/src/utils/ruoyi.ts @@ -0,0 +1,251 @@ +// 日期格式化 +export function parseTime(time: any, pattern?: string) { + if (arguments.length === 0 || !time) { + return null; + } + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'; + let date; + if (typeof time === 'object') { + date = time; + } else { + if (typeof time === 'string' && /^[0-9]+$/.test(time)) { + time = parseInt(time); + } else if (typeof time === 'string') { + time = time + .replace(new RegExp(/-/gm), '/') + .replace('T', ' ') + .replace(new RegExp(/\.[\d]{3}/gm), ''); + } + if (typeof time === 'number' && time.toString().length === 10) { + time = time * 1000; + } + date = new Date(time); + } + const formatObj: { [key: string]: any } = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + }; + return format.replace(/{(y|m|d|h|i|s|a)+}/g, (result: string, key: string) => { + let value = formatObj[key]; + // Note: getDay() returns 0 on Sunday + if (key === 'a') { + return ['日', '一', '二', '三', '四', '五', '六'][value]; + } + if (result.length > 0 && value < 10) { + value = '0' + value; + } + return value || 0; + }); +} + +/** + * 添加日期范围 + * @param params + * @param dateRange + * @param propName + */ +export const addDateRange = (params: any, dateRange: any[], propName?: string) => { + const search = params; + search.params = typeof search.params === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {}; + dateRange = Array.isArray(dateRange) ? dateRange : []; + if (typeof propName === 'undefined') { + search.params['beginTime'] = dateRange[0]; + search.params['endTime'] = dateRange[1]; + } else { + search.params['begin' + propName] = dateRange[0]; + search.params['end' + propName] = dateRange[1]; + } + return search; +}; + +// 回显数据字典 +export const selectDictLabel = (datas: any, value: number | string) => { + if (value === undefined) { + return ''; + } + const actions: Array = []; + Object.keys(datas).some((key) => { + if (datas[key].value == '' + value) { + actions.push(datas[key].label); + return true; + } + }); + if (actions.length === 0) { + actions.push(value); + } + return actions.join(''); +}; + +// 回显数据字典(字符串数组) +export const selectDictLabels = (datas: any, value: any, separator: any) => { + if (value === undefined || value.length === 0) { + return ''; + } + if (Array.isArray(value)) { + value = value.join(','); + } + const actions: any[] = []; + const currentSeparator = undefined === separator ? ',' : separator; + const temp = value.split(currentSeparator); + Object.keys(value.split(currentSeparator)).some((val) => { + let match = false; + Object.keys(datas).some((key) => { + if (datas[key].value == '' + temp[val]) { + actions.push(datas[key].label + currentSeparator); + match = true; + } + }); + if (!match) { + actions.push(temp[val] + currentSeparator); + } + }); + return actions.join('').substring(0, actions.join('').length - 1); +}; + +// 字符串格式化(%s ) +export function sprintf(str: string) { + if (arguments.length !== 0) { + let flag = true, + i = 1; + str = str.replace(/%s/g, function () { + const arg = arguments[i++]; + if (typeof arg === 'undefined') { + flag = false; + return ''; + } + return arg; + }); + return flag ? str : ''; + } +} + +// 转换字符串,undefined,null等转化为"" +export const parseStrEmpty = (str: any) => { + if (!str || str == 'undefined' || str == 'null') { + return ''; + } + return str; +}; + +// 数据合并 +export const mergeRecursive = (source: any, target: any) => { + for (const p in target) { + try { + if (target[p].constructor == Object) { + source[p] = mergeRecursive(source[p], target[p]); + } else { + source[p] = target[p]; + } + } catch (e) { + source[p] = target[p]; + } + } + return source; +}; + +/** + * 构造树型结构数据 + * @param {*} data 数据源 + * @param {*} id id字段 默认 'id' + * @param {*} parentId 父节点字段 默认 'parentId' + * @param {*} children 孩子节点字段 默认 'children' + */ +export const handleTree = (data: any[], id?: string, parentId?: string, children?: string): T[] => { + const config: { + id: string; + parentId: string; + childrenList: string; + } = { + id: id || 'id', + parentId: parentId || 'parentId', + childrenList: children || 'children' + }; + + const childrenListMap: any = {}; + const nodeIds: any = {}; + const tree: T[] = []; + + for (const d of data) { + const parentId = d[config.parentId]; + if (childrenListMap[parentId] == null) { + childrenListMap[parentId] = []; + } + nodeIds[d[config.id]] = d; + childrenListMap[parentId].push(d); + } + + for (const d of data) { + const parentId = d[config.parentId]; + if (nodeIds[parentId] == null) { + tree.push(d); + } + } + const adaptToChildrenList = (o: any) => { + if (childrenListMap[o[config.id]] !== null) { + o[config.childrenList] = childrenListMap[o[config.id]]; + } + if (o[config.childrenList]) { + for (const c of o[config.childrenList]) { + adaptToChildrenList(c); + } + } + }; + + for (const t of tree) { + adaptToChildrenList(t); + } + + return tree; +}; + +/** + * 参数处理 + * @param {*} params 参数 + */ +export const tansParams = (params: any) => { + let result = ''; + for (const propName of Object.keys(params)) { + const value = params[propName]; + const part = encodeURIComponent(propName) + '='; + if (value !== null && value !== '' && typeof value !== 'undefined') { + if (typeof value === 'object') { + for (const key of Object.keys(value)) { + if (value[key] !== null && value[key] !== '' && typeof value[key] !== 'undefined') { + const params = propName + '[' + key + ']'; + const subPart = encodeURIComponent(params) + '='; + result += subPart + encodeURIComponent(value[key]) + '&'; + } + } + } else { + result += part + encodeURIComponent(value) + '&'; + } + } + } + return result; +}; + +// 返回项目路径 +export const getNormalPath = (p: string): string => { + if (p.length === 0 || !p || p === 'undefined') { + return p; + } + const res = p.replace('//', '/'); + if (res[res.length - 1] === '/') { + return res.slice(0, res.length - 1); + } + return res; +}; + +// 验证是否为blob格式 +export const blobValidate = (data: any) => { + return data.type !== 'application/json'; +}; + +export default { + handleTree +}; diff --git a/src/utils/scroll-to.ts b/src/utils/scroll-to.ts new file mode 100644 index 0000000..c2fa379 --- /dev/null +++ b/src/utils/scroll-to.ts @@ -0,0 +1,65 @@ +const easeInOutQuad = (t: number, b: number, c: number, d: number) => { + t /= d / 2; + if (t < 1) { + return (c / 2) * t * t + b; + } + t--; + return (-c / 2) * (t * (t - 2) - 1) + b; +}; + +// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts +const requestAnimFrame = (function () { + return ( + window.requestAnimationFrame || + (window as any).webkitRequestAnimationFrame || + (window as any).mozRequestAnimationFrame || + function (callback) { + window.setTimeout(callback, 1000 / 60); + } + ); +})(); + +/** + * Because it's so fucking difficult to detect the scrolling element, just move them all + * @param {number} amount + */ +const move = (amount: number) => { + document.documentElement.scrollTop = amount; + (document.body.parentNode as HTMLElement).scrollTop = amount; + document.body.scrollTop = amount; +}; + +const position = () => { + return document.documentElement.scrollTop || (document.body.parentNode as HTMLElement).scrollTop || document.body.scrollTop; +}; + +/** + * @param {number} to + * @param {number} duration + * @param {Function} callback + */ +export const scrollTo = (to: number, duration: number, callback?: any) => { + const start = position(); + const change = to - start; + const increment = 20; + let currentTime = 0; + duration = typeof duration === 'undefined' ? 500 : duration; + const animateScroll = function () { + // increment the time + currentTime += increment; + // find the value with the quadratic in-out easing function + const val = easeInOutQuad(currentTime, start, change, duration); + // move the document.body + move(val); + // do the animation unless its over + if (currentTime < duration) { + requestAnimFrame(animateScroll); + } else { + if (callback && typeof callback === 'function') { + // the animation is done so lets callback + callback(); + } + } + }; + animateScroll(); +}; diff --git a/src/utils/sse.ts b/src/utils/sse.ts new file mode 100644 index 0000000..65eeef5 --- /dev/null +++ b/src/utils/sse.ts @@ -0,0 +1,69 @@ +import { getToken } from '@/utils/auth'; +import { ElNotification } from 'element-plus'; +import useNoticeStore from '@/store/modules/notice'; + +// 初始化 +export const initSSE = (url: any) => { + + + if (import.meta.env.VITE_APP_SSE === 'false') { + return; + } + + // 创建事件总线(全局通知) + const eventBus = useEventBus('sys-notification'); + + url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID; + const { data, error } = useEventSource(url, [], { + autoReconnect: { + retries: 10, + delay: 3000, + onFailed() { + console.log('Failed to connect after 10 retries'); + } + } + }); + + watch(error, () => { + console.log('SSE connection error:', error.value); + error.value = null; + }); + + watch(data, () => { + if (!data.value) return; + useNoticeStore().addNotice({ + message: data.value, + read: false, + time: new Date().toLocaleString() + }); + + // 2. 触发全局刷新事件(关键改动点) + eventBus.emit('refresh-shop'); // 发送刷新指 + eventBus.emit('refresh-task'); // 发送刷新指 + + + if(data.value == '授权成功'){ + ElNotification({ + title: '授权成功', + message: data.value, + type: 'success', + duration: 5000 + }); + }else if(data.value == '授权失败'){ + ElNotification({ + title: '授权失败', + message: '登录的店铺和之前店铺的绑定信息不一致,请登录和绑定店铺一致的账号,如果是新店铺,请点击添加店铺,然后再点击新店铺的授权进行绑定', + type: 'error', + duration: 10000 + }); + }else{ + ElNotification({ + title: '消息', + message: data.value, + type: 'success', + duration: 3000 + }); + } + data.value = null; + }); +}; diff --git a/src/utils/theme.ts b/src/utils/theme.ts new file mode 100644 index 0000000..3936248 --- /dev/null +++ b/src/utils/theme.ts @@ -0,0 +1,52 @@ +// 处理主题样式 +export const handleThemeStyle = (theme: string) => { + document.documentElement.style.setProperty('--el-color-primary', theme); + for (let i = 1; i <= 9; i++) { + document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, `${getLightColor(theme, i / 10)}`); + } + for (let i = 1; i <= 9; i++) { + document.documentElement.style.setProperty(`--el-color-primary-dark-${i}`, `${getDarkColor(theme, i / 10)}`); + } +}; + +// hex颜色转rgb颜色 +export const hexToRgb = (str: string): string[] => { + str = str.replace('#', ''); + const hexs = str.match(/../g); + for (let i = 0; i < 3; i++) { + if (hexs) { + hexs[i] = String(parseInt(hexs[i], 16)); + } + } + return hexs ? hexs : []; +}; + +// rgb颜色转Hex颜色 +export const rgbToHex = (r: string, g: string, b: string) => { + const hexs = [Number(r).toString(16), Number(g).toString(16), Number(b).toString(16)]; + for (let i = 0; i < 3; i++) { + if (hexs[i].length == 1) { + hexs[i] = `0${hexs[i]}`; + } + } + return `#${hexs.join('')}`; +}; + +// 变浅颜色值 +export const getLightColor = (color: string, level: number) => { + const rgb = hexToRgb(color); + for (let i = 0; i < 3; i++) { + const s = (255 - Number(rgb[i])) * level + Number(rgb[i]); + rgb[i] = String(Math.floor(s)); + } + return rgbToHex(rgb[0], rgb[1], rgb[2]); +}; + +// 变深颜色值 +export const getDarkColor = (color: string, level: number) => { + const rgb = hexToRgb(color); + for (let i = 0; i < 3; i++) { + rgb[i] = String(Math.floor(Number(rgb[i]) * (1 - level))); + } + return rgbToHex(rgb[0], rgb[1], rgb[2]); +}; diff --git a/src/utils/validate.ts b/src/utils/validate.ts new file mode 100644 index 0000000..e2886e4 --- /dev/null +++ b/src/utils/validate.ts @@ -0,0 +1,108 @@ +/** + * 路径匹配器 + * @param {string} pattern + * @param {string} path + * @returns {Boolean} + */ +export function isPathMatch(pattern: string, path: string) { + const regexPattern = pattern + .replace(/\//g, '\\/') + .replace(/\*\*/g, '__DOUBLE_STAR__') + .replace(/\*/g, '[^\\/]*') + .replace(/__DOUBLE_STAR__/g, '.*'); + const regex = new RegExp(`^${regexPattern}$`); + return regex.test(path); +} + +/** + * 判断url是否是http或https + * @returns {Boolean} + * @param url + */ +export const isHttp = (url: string): boolean => { + return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1; +}; + +/** + * 判断path是否为外链 + * @param {string} path + * @returns {Boolean} + */ +export const isExternal = (path: string) => { + return /^(https?:|mailto:|tel:)/.test(path); +}; + +/** + * @param {string} str + * @returns {Boolean} + */ +export const validUsername = (str: string) => { + const valid_map = ['admin', 'editor']; + return valid_map.indexOf(str.trim()) >= 0; +}; + +/** + * @param {string} url + * @returns {Boolean} + */ +export const validURL = (url: string) => { + const reg = + /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/; + return reg.test(url); +}; + +/** + * @param {string} str + * @returns {Boolean} + */ +export const validLowerCase = (str: string) => { + const reg = /^[a-z]+$/; + return reg.test(str); +}; + +/** + * @param {string} str + * @returns {Boolean} + */ +export const validUpperCase = (str: string) => { + const reg = /^[A-Z]+$/; + return reg.test(str); +}; + +/** + * @param {string} str + * @returns {Boolean} + */ +export const validAlphabets = (str: string) => { + const reg = /^[A-Za-z]+$/; + return reg.test(str); +}; + +/** + * @param {string} email + * @returns {Boolean} + */ +export const validEmail = (email: string) => { + const reg = + /^(([^<>()\]\\.,;:\s@"]+(\.[^<>()\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + return reg.test(email); +}; + +/** + * @param {string} str + * @returns {Boolean} + */ +export const isString = (str: any) => { + return typeof str === 'string' || str instanceof String; +}; + +/** + * @param {Array} arg + * @returns {Boolean} + */ +export const isArray = (arg: string | string[]) => { + if (typeof Array.isArray === 'undefined') { + return Object.prototype.toString.call(arg) === '[object Array]'; + } + return Array.isArray(arg); +}; diff --git a/src/utils/websocket.ts b/src/utils/websocket.ts new file mode 100644 index 0000000..c9b394c --- /dev/null +++ b/src/utils/websocket.ts @@ -0,0 +1,51 @@ +import { getToken } from '@/utils/auth'; +import { ElNotification } from 'element-plus'; +import useNoticeStore from '@/store/modules/notice'; + +// 初始化socket +export const initWebSocket = (url: any) => { + if (import.meta.env.VITE_APP_WEBSOCKET === 'false') { + return; + } + url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID; + useWebSocket(url, { + autoReconnect: { + // 重连最大次数 + retries: 3, + // 重连间隔 + delay: 1000, + onFailed() { + console.log('websocket重连失败'); + } + }, + heartbeat: { + message: JSON.stringify({ type: 'ping' }), + // 发送心跳的间隔 + interval: 10000, + // 接收到心跳response的超时时间 + pongTimeout: 2000 + }, + onConnected() { + console.log('websocket已经连接'); + }, + onDisconnected() { + console.log('websocket已经断开'); + }, + onMessage: (_, e) => { + if (e.data.indexOf('ping') > 0) { + return; + } + useNoticeStore().addNotice({ + message: e.data, + read: false, + time: new Date().toLocaleString() + }); + ElNotification({ + title: '消息', + message: e.data, + type: 'success', + duration: 3000 + }); + } + }); +}; diff --git a/src/views/demo/demo/index.vue b/src/views/demo/demo/index.vue new file mode 100644 index 0000000..da1bc16 --- /dev/null +++ b/src/views/demo/demo/index.vue @@ -0,0 +1,254 @@ + + + diff --git a/src/views/demo/tree/index.vue b/src/views/demo/tree/index.vue new file mode 100644 index 0000000..566d071 --- /dev/null +++ b/src/views/demo/tree/index.vue @@ -0,0 +1,258 @@ + + + diff --git a/src/views/error/401.vue b/src/views/error/401.vue new file mode 100644 index 0000000..968550c --- /dev/null +++ b/src/views/error/401.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/views/error/404.vue b/src/views/error/404.vue new file mode 100644 index 0000000..b9a9ea3 --- /dev/null +++ b/src/views/error/404.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/src/views/index.vue b/src/views/index.vue new file mode 100644 index 0000000..be24284 --- /dev/null +++ b/src/views/index.vue @@ -0,0 +1,776 @@ + + + + + diff --git a/src/views/login.vue b/src/views/login.vue new file mode 100644 index 0000000..ff38fcf --- /dev/null +++ b/src/views/login.vue @@ -0,0 +1,471 @@ + + + + + diff --git a/src/views/monitor/admin/index.vue b/src/views/monitor/admin/index.vue new file mode 100644 index 0000000..b71a5cc --- /dev/null +++ b/src/views/monitor/admin/index.vue @@ -0,0 +1,9 @@ + + + diff --git a/src/views/monitor/cache/index.vue b/src/views/monitor/cache/index.vue new file mode 100644 index 0000000..81bbf2d --- /dev/null +++ b/src/views/monitor/cache/index.vue @@ -0,0 +1,192 @@ + + + diff --git a/src/views/monitor/logininfor/index.vue b/src/views/monitor/logininfor/index.vue new file mode 100644 index 0000000..d914544 --- /dev/null +++ b/src/views/monitor/logininfor/index.vue @@ -0,0 +1,208 @@ + + + diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue new file mode 100644 index 0000000..7a58bb7 --- /dev/null +++ b/src/views/monitor/online/index.vue @@ -0,0 +1,116 @@ + + + diff --git a/src/views/monitor/operlog/index.vue b/src/views/monitor/operlog/index.vue new file mode 100644 index 0000000..0c64af4 --- /dev/null +++ b/src/views/monitor/operlog/index.vue @@ -0,0 +1,260 @@ + + + diff --git a/src/views/monitor/operlog/oper-info-dialog.vue b/src/views/monitor/operlog/oper-info-dialog.vue new file mode 100644 index 0000000..66491e2 --- /dev/null +++ b/src/views/monitor/operlog/oper-info-dialog.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/src/views/monitor/snailjob/index.vue b/src/views/monitor/snailjob/index.vue new file mode 100644 index 0000000..89e3b23 --- /dev/null +++ b/src/views/monitor/snailjob/index.vue @@ -0,0 +1,9 @@ + + + diff --git a/src/views/redirect/index.vue b/src/views/redirect/index.vue new file mode 100644 index 0000000..97a6556 --- /dev/null +++ b/src/views/redirect/index.vue @@ -0,0 +1,14 @@ + + + diff --git a/src/views/register.vue b/src/views/register.vue new file mode 100644 index 0000000..d2a9e9b --- /dev/null +++ b/src/views/register.vue @@ -0,0 +1,500 @@ + + + + + diff --git a/src/views/system/client/index.vue b/src/views/system/client/index.vue new file mode 100644 index 0000000..37e8609 --- /dev/null +++ b/src/views/system/client/index.vue @@ -0,0 +1,316 @@ + + + diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue new file mode 100644 index 0000000..ddc0753 --- /dev/null +++ b/src/views/system/config/index.vue @@ -0,0 +1,261 @@ + + + diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue new file mode 100644 index 0000000..1f5facb --- /dev/null +++ b/src/views/system/dept/index.vue @@ -0,0 +1,319 @@ + + + diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue new file mode 100644 index 0000000..3e9b0a1 --- /dev/null +++ b/src/views/system/dict/data.vue @@ -0,0 +1,309 @@ + + + diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue new file mode 100644 index 0000000..d30ad54 --- /dev/null +++ b/src/views/system/dict/index.vue @@ -0,0 +1,246 @@ + + + diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue new file mode 100644 index 0000000..05630f4 --- /dev/null +++ b/src/views/system/menu/index.vue @@ -0,0 +1,410 @@ + + + diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue new file mode 100644 index 0000000..5d7d9ba --- /dev/null +++ b/src/views/system/notice/index.vue @@ -0,0 +1,243 @@ + + + diff --git a/src/views/system/oss/config.vue b/src/views/system/oss/config.vue new file mode 100644 index 0000000..0563a02 --- /dev/null +++ b/src/views/system/oss/config.vue @@ -0,0 +1,334 @@ + + + diff --git a/src/views/system/oss/index.vue b/src/views/system/oss/index.vue new file mode 100644 index 0000000..f76dbab --- /dev/null +++ b/src/views/system/oss/index.vue @@ -0,0 +1,332 @@ + + + diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue new file mode 100644 index 0000000..4aa4e3a --- /dev/null +++ b/src/views/system/post/index.vue @@ -0,0 +1,360 @@ + + + diff --git a/src/views/system/role/authUser.vue b/src/views/system/role/authUser.vue new file mode 100644 index 0000000..0af7b6d --- /dev/null +++ b/src/views/system/role/authUser.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue new file mode 100644 index 0000000..fc42cd5 --- /dev/null +++ b/src/views/system/role/index.vue @@ -0,0 +1,503 @@ + + + diff --git a/src/views/system/role/selectUser.vue b/src/views/system/role/selectUser.vue new file mode 100644 index 0000000..e55120a --- /dev/null +++ b/src/views/system/role/selectUser.vue @@ -0,0 +1,132 @@ + + + + + diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue new file mode 100644 index 0000000..45865c0 --- /dev/null +++ b/src/views/system/tenant/index.vue @@ -0,0 +1,374 @@ + + + diff --git a/src/views/system/tenantPackage/index.vue b/src/views/system/tenantPackage/index.vue new file mode 100644 index 0000000..f97bb35 --- /dev/null +++ b/src/views/system/tenantPackage/index.vue @@ -0,0 +1,335 @@ + + + diff --git a/src/views/system/user/authRole.vue b/src/views/system/user/authRole.vue new file mode 100644 index 0000000..fe2e974 --- /dev/null +++ b/src/views/system/user/authRole.vue @@ -0,0 +1,139 @@ + + + diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue new file mode 100644 index 0000000..cbaedd6 --- /dev/null +++ b/src/views/system/user/index.vue @@ -0,0 +1,731 @@ + + + + + diff --git a/src/views/system/user/newuser.vue b/src/views/system/user/newuser.vue new file mode 100644 index 0000000..4f882d2 --- /dev/null +++ b/src/views/system/user/newuser.vue @@ -0,0 +1,477 @@ + + + + + + + diff --git a/src/views/system/user/profile/index.vue b/src/views/system/user/profile/index.vue new file mode 100644 index 0000000..f631076 --- /dev/null +++ b/src/views/system/user/profile/index.vue @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/src/views/system/user/profile/inviteCode.vue b/src/views/system/user/profile/inviteCode.vue new file mode 100644 index 0000000..532e1e0 --- /dev/null +++ b/src/views/system/user/profile/inviteCode.vue @@ -0,0 +1,249 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/user/profile/onlineDevice.vue b/src/views/system/user/profile/onlineDevice.vue new file mode 100644 index 0000000..7634b06 --- /dev/null +++ b/src/views/system/user/profile/onlineDevice.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/views/system/user/profile/resetPwd.vue b/src/views/system/user/profile/resetPwd.vue new file mode 100644 index 0000000..3ca5ee9 --- /dev/null +++ b/src/views/system/user/profile/resetPwd.vue @@ -0,0 +1,73 @@ + + + diff --git a/src/views/system/user/profile/thirdParty.vue b/src/views/system/user/profile/thirdParty.vue new file mode 100644 index 0000000..5cd7347 --- /dev/null +++ b/src/views/system/user/profile/thirdParty.vue @@ -0,0 +1,144 @@ + + + + + diff --git a/src/views/system/user/profile/userAvatar.vue b/src/views/system/user/profile/userAvatar.vue new file mode 100644 index 0000000..32b6f5c --- /dev/null +++ b/src/views/system/user/profile/userAvatar.vue @@ -0,0 +1,182 @@ + + + + + diff --git a/src/views/system/user/profile/userInfo.vue b/src/views/system/user/profile/userInfo.vue new file mode 100644 index 0000000..adb4613 --- /dev/null +++ b/src/views/system/user/profile/userInfo.vue @@ -0,0 +1,75 @@ + + + diff --git a/src/views/tool/gen/basicInfoForm.vue b/src/views/tool/gen/basicInfoForm.vue new file mode 100644 index 0000000..5412088 --- /dev/null +++ b/src/views/tool/gen/basicInfoForm.vue @@ -0,0 +1,49 @@ + + + diff --git a/src/views/tool/gen/editTable.vue b/src/views/tool/gen/editTable.vue new file mode 100644 index 0000000..bbb0889 --- /dev/null +++ b/src/views/tool/gen/editTable.vue @@ -0,0 +1,198 @@ + + + diff --git a/src/views/tool/gen/genInfoForm.vue b/src/views/tool/gen/genInfoForm.vue new file mode 100644 index 0000000..05b728b --- /dev/null +++ b/src/views/tool/gen/genInfoForm.vue @@ -0,0 +1,294 @@ + + + diff --git a/src/views/tool/gen/importTable.vue b/src/views/tool/gen/importTable.vue new file mode 100644 index 0000000..f6e75cc --- /dev/null +++ b/src/views/tool/gen/importTable.vue @@ -0,0 +1,122 @@ + + + diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue new file mode 100644 index 0000000..b4df31b --- /dev/null +++ b/src/views/tool/gen/index.vue @@ -0,0 +1,250 @@ + + + diff --git a/src/views/tool/shelving/index.vue b/src/views/tool/shelving/index.vue new file mode 100644 index 0000000..0e35437 --- /dev/null +++ b/src/views/tool/shelving/index.vue @@ -0,0 +1,483 @@ + + + + + \ No newline at end of file diff --git a/src/views/workflow/category/index.vue b/src/views/workflow/category/index.vue new file mode 100644 index 0000000..d3e87ea --- /dev/null +++ b/src/views/workflow/category/index.vue @@ -0,0 +1,257 @@ + + + diff --git a/src/views/workflow/leave/index.vue b/src/views/workflow/leave/index.vue new file mode 100644 index 0000000..2c8da0e --- /dev/null +++ b/src/views/workflow/leave/index.vue @@ -0,0 +1,236 @@ + + + diff --git a/src/views/workflow/leave/leaveEdit.vue b/src/views/workflow/leave/leaveEdit.vue new file mode 100644 index 0000000..a8c1bfd --- /dev/null +++ b/src/views/workflow/leave/leaveEdit.vue @@ -0,0 +1,308 @@ + + + diff --git a/src/views/workflow/processDefinition/design.vue b/src/views/workflow/processDefinition/design.vue new file mode 100644 index 0000000..05e6538 --- /dev/null +++ b/src/views/workflow/processDefinition/design.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/views/workflow/processDefinition/index.vue b/src/views/workflow/processDefinition/index.vue new file mode 100644 index 0000000..9888892 --- /dev/null +++ b/src/views/workflow/processDefinition/index.vue @@ -0,0 +1,517 @@ + + + diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue new file mode 100644 index 0000000..b58b189 --- /dev/null +++ b/src/views/workflow/processInstance/index.vue @@ -0,0 +1,417 @@ + + + diff --git a/src/views/workflow/task/allTaskWaiting.vue b/src/views/workflow/task/allTaskWaiting.vue new file mode 100644 index 0000000..0c6c46e --- /dev/null +++ b/src/views/workflow/task/allTaskWaiting.vue @@ -0,0 +1,252 @@ + + + diff --git a/src/views/workflow/task/myDocument.vue b/src/views/workflow/task/myDocument.vue new file mode 100644 index 0000000..baee949 --- /dev/null +++ b/src/views/workflow/task/myDocument.vue @@ -0,0 +1,245 @@ + + + diff --git a/src/views/workflow/task/taskCopyList.vue b/src/views/workflow/task/taskCopyList.vue new file mode 100644 index 0000000..6224fff --- /dev/null +++ b/src/views/workflow/task/taskCopyList.vue @@ -0,0 +1,135 @@ + + + diff --git a/src/views/workflow/task/taskFinish.vue b/src/views/workflow/task/taskFinish.vue new file mode 100644 index 0000000..0f5758e --- /dev/null +++ b/src/views/workflow/task/taskFinish.vue @@ -0,0 +1,180 @@ + + + diff --git a/src/views/workflow/task/taskWaiting.vue b/src/views/workflow/task/taskWaiting.vue new file mode 100644 index 0000000..339077d --- /dev/null +++ b/src/views/workflow/task/taskWaiting.vue @@ -0,0 +1,179 @@ + + + diff --git a/src/views/zhishu/account/index.vue b/src/views/zhishu/account/index.vue new file mode 100644 index 0000000..1aeb844 --- /dev/null +++ b/src/views/zhishu/account/index.vue @@ -0,0 +1,270 @@ + + + \ No newline at end of file diff --git a/src/views/zhishu/audit/index.vue b/src/views/zhishu/audit/index.vue new file mode 100644 index 0000000..a00d07e --- /dev/null +++ b/src/views/zhishu/audit/index.vue @@ -0,0 +1,697 @@ + + + + + diff --git a/src/views/zhishu/baseInfo/index.vue b/src/views/zhishu/baseInfo/index.vue new file mode 100644 index 0000000..741817b --- /dev/null +++ b/src/views/zhishu/baseInfo/index.vue @@ -0,0 +1,3377 @@ + + + + + diff --git a/src/views/zhishu/baseInfo/kfzCategory.json b/src/views/zhishu/baseInfo/kfzCategory.json new file mode 100644 index 0000000..05d650f --- /dev/null +++ b/src/views/zhishu/baseInfo/kfzCategory.json @@ -0,0 +1,148 @@ +{ + "体育": {}, + "军事": {}, + "医药卫生": {}, + "历史": {}, + "哲学心理学": {}, + "国学古籍": { + "军事": {}, + "医药卫生": {}, + "历史": {}, + "哲学心理学": {}, + "地理": {}, + "宗教": {}, + "小说": {}, + "工程技术": {}, + "政治": {}, + "教育": {}, + "文学": {}, + "法律": {}, + "生活": {}, + "社会文化": {}, + "童书": {}, + "经济": {}, + "综合性图书": {}, + "自然科学": {}, + "艺术": {}, + "语言文字": {} + }, + "地理": {}, + "外文古旧书": { + "俄文书": { + "小说": {}, + "自然科学": {}, + "艺术": {} + }, + "其他语种": { + "童书": {}, + "语言文字": {} + }, + "德文书": { + "历史": {}, + "小说": {}, + "工程技术": {}, + "文学": {}, + "艺术": {} + }, + "日文书": { + "小说": {}, + "工程技术": {}, + "政治": {}, + "教育": {}, + "文学": {}, + "生活": {}, + "管理": {}, + "艺术": {}, + "语言文字": {} + }, + "法文书": { + "历史": {}, + "小说": {}, + "文学": {}, + "生活": {}, + "艺术": {} + }, + "英文书": { + "体育": {}, + "医药卫生": {}, + "历史": {}, + "哲学心理学": {}, + "地理": {}, + "宗教": {}, + "小说": {}, + "工程技术": {}, + "政治": {}, + "教材教辅考试": {}, + "教育": {}, + "文学": {}, + "法律": {}, + "生活": {}, + "社会文化": {}, + "童书": {}, + "管理": {}, + "经济": {}, + "综合性图书": {}, + "自然科学": {}, + "艺术": {}, + "计算机与互联网": {}, + "语言文字": {} + } + }, + "宗教": {}, + "小说": {}, + "工程技术": {}, + "收藏与鉴赏": { + "书目": {}, + "收藏指南": {}, + "杂项收藏图书": {}, + "版本书话": {}, + "特装限量本": {}, + "钱币图书": {}, + "集邮文献": {} + }, + "政治": {}, + "教材教辅考试": { + "教材": { + "中职教材": {}, + "大学教材": {}, + "成人教育教材": {}, + "研究生教材": {}, + "职业培训教材": {}, + "高职教材": {} + }, + "教辅": { + "中学教辅": {}, + "其他教辅": {}, + "小学教辅": {}, + "高中教辅": {} + }, + "考试": { + "事业单位考试": {}, + "会计类考试": {}, + "公务员考试": {}, + "其他考试": {}, + "医学/药学考试": {}, + "司法考试": {}, + "外语考试": {}, + "建筑工程类考试": {}, + "教师类考试": {}, + "研究生考试": {}, + "计算机考试": {}, + "财税外贸保险类考试": {}, + "银行类考试": {} + } + }, + "教育": {}, + "文学": {}, + "法律": {}, + "生活": {}, + "社会文化": {}, + "童书": {}, + "管理": {}, + "经济": {}, + "综合性图书": {}, + "自然科学": {}, + "艺术": {}, + "计算机与互联网": {}, + "语言文字": {} +} diff --git a/src/views/zhishu/bookAudit/index.vue b/src/views/zhishu/bookAudit/index.vue new file mode 100644 index 0000000..b78754c --- /dev/null +++ b/src/views/zhishu/bookAudit/index.vue @@ -0,0 +1,344 @@ + + + + diff --git a/src/views/zhishu/depot/index.vue b/src/views/zhishu/depot/index.vue new file mode 100644 index 0000000..aeba419 --- /dev/null +++ b/src/views/zhishu/depot/index.vue @@ -0,0 +1,525 @@ + + + + diff --git a/src/views/zhishu/depotOrder/index.vue b/src/views/zhishu/depotOrder/index.vue new file mode 100644 index 0000000..bdf98d6 --- /dev/null +++ b/src/views/zhishu/depotOrder/index.vue @@ -0,0 +1,825 @@ + + + diff --git a/src/views/zhishu/erpGoodsOrder/index.vue b/src/views/zhishu/erpGoodsOrder/index.vue new file mode 100644 index 0000000..642dcdc --- /dev/null +++ b/src/views/zhishu/erpGoodsOrder/index.vue @@ -0,0 +1,1585 @@ + + + + + diff --git a/src/views/zhishu/excelTask/index.vue b/src/views/zhishu/excelTask/index.vue new file mode 100644 index 0000000..2bbc537 --- /dev/null +++ b/src/views/zhishu/excelTask/index.vue @@ -0,0 +1,518 @@ + + + + + diff --git a/src/views/zhishu/fastMail/index.vue b/src/views/zhishu/fastMail/index.vue new file mode 100644 index 0000000..bdf1682 --- /dev/null +++ b/src/views/zhishu/fastMail/index.vue @@ -0,0 +1,416 @@ + + + diff --git a/src/views/zhishu/filterSet/index.vue b/src/views/zhishu/filterSet/index.vue new file mode 100644 index 0000000..f4e4966 --- /dev/null +++ b/src/views/zhishu/filterSet/index.vue @@ -0,0 +1,442 @@ + + + + + diff --git a/src/views/zhishu/freight/index.vue b/src/views/zhishu/freight/index.vue new file mode 100644 index 0000000..371d30a --- /dev/null +++ b/src/views/zhishu/freight/index.vue @@ -0,0 +1,373 @@ + + + + diff --git a/src/views/zhishu/goodsAutoFail/index.vue b/src/views/zhishu/goodsAutoFail/index.vue new file mode 100644 index 0000000..58a4a48 --- /dev/null +++ b/src/views/zhishu/goodsAutoFail/index.vue @@ -0,0 +1,434 @@ + + + diff --git a/src/views/zhishu/invitation/index.vue b/src/views/zhishu/invitation/index.vue new file mode 100644 index 0000000..204b879 --- /dev/null +++ b/src/views/zhishu/invitation/index.vue @@ -0,0 +1,447 @@ + + + + + diff --git a/src/views/zhishu/linkage/index.vue b/src/views/zhishu/linkage/index.vue new file mode 100644 index 0000000..13f7d1b --- /dev/null +++ b/src/views/zhishu/linkage/index.vue @@ -0,0 +1,1762 @@ + + + + diff --git a/src/views/zhishu/linkage/localTypes.ts b/src/views/zhishu/linkage/localTypes.ts new file mode 100644 index 0000000..0e0ae63 --- /dev/null +++ b/src/views/zhishu/linkage/localTypes.ts @@ -0,0 +1,53 @@ +// 本地展示专用类型定义 +import { DepotVO } from '@/api/zhishu/depot/types'; +import { ShelvesVO } from '@/api/zhishu/shelves/types'; +import { FreightVO } from '@/api/zhishu/freight/types'; + +// 不直接扩展后端接口,而是基于后端接口创建本地展示类型(覆盖 children 字段) +export type LocalDepotVO = Omit & { + children: LocalShelvesVO[]; + allowDistribution: string; + level: number; +}; + +export type LocalShelvesVO = Omit & { + children: LocalFreightVO[]; + allowDistribution: string; + level: number; + sheNumber?: number; + hasChildren?: boolean; +}; + +export type LocalFreightVO = FreightVO & { + allowDistribution: string; + level: number; + sheNumber?: number; + hasChildren?: boolean; +}; + +// 转换函数:把后端数据转换为本地展示数据(补全 children/allowDistribution/level) +export function toLocalDepotVO(data: DepotVO): LocalDepotVO { + return { + ...data, + children: Array.isArray((data as any).children) ? (data as any).children : [], + allowDistribution: '0', + level: 1 + }; +} + +export function toLocalShelvesVO(data: ShelvesVO): LocalShelvesVO { + return { + ...data, + children: Array.isArray((data as any).children) ? (data as any).children : [], + allowDistribution: '0', + level: 2 + }; +} + +export function toLocalFreightVO(data: FreightVO): LocalFreightVO { + console.log(data,"!!!!!!!!!!!!!!!!!!!!!") + return { + ...data, + level: 3 + }; +} diff --git a/src/views/zhishu/logistics/index.vue b/src/views/zhishu/logistics/index.vue new file mode 100644 index 0000000..23d9ada --- /dev/null +++ b/src/views/zhishu/logistics/index.vue @@ -0,0 +1,925 @@ + + + diff --git a/src/views/zhishu/newInventory/index.vue b/src/views/zhishu/newInventory/index.vue new file mode 100644 index 0000000..3315cbc --- /dev/null +++ b/src/views/zhishu/newInventory/index.vue @@ -0,0 +1,41 @@ + + + + + \ No newline at end of file diff --git a/src/views/zhishu/newLocationManager/index.vue b/src/views/zhishu/newLocationManager/index.vue new file mode 100644 index 0000000..e385e73 --- /dev/null +++ b/src/views/zhishu/newLocationManager/index.vue @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file diff --git a/src/views/zhishu/newProduct/index.vue b/src/views/zhishu/newProduct/index.vue new file mode 100644 index 0000000..cea2544 --- /dev/null +++ b/src/views/zhishu/newProduct/index.vue @@ -0,0 +1,41 @@ + + + + + \ No newline at end of file diff --git a/src/views/zhishu/newTask/index.vue b/src/views/zhishu/newTask/index.vue new file mode 100644 index 0000000..44077d2 --- /dev/null +++ b/src/views/zhishu/newTask/index.vue @@ -0,0 +1,751 @@ + + + + + \ No newline at end of file diff --git a/src/views/zhishu/notice/index.vue b/src/views/zhishu/notice/index.vue new file mode 100644 index 0000000..cd1e057 --- /dev/null +++ b/src/views/zhishu/notice/index.vue @@ -0,0 +1,231 @@ + + + + + + diff --git a/src/views/zhishu/onlineProducts/index.vue b/src/views/zhishu/onlineProducts/index.vue new file mode 100644 index 0000000..a4797bf --- /dev/null +++ b/src/views/zhishu/onlineProducts/index.vue @@ -0,0 +1,302 @@ + + + + diff --git a/src/views/zhishu/orderExternalGoods/index.vue b/src/views/zhishu/orderExternalGoods/index.vue new file mode 100644 index 0000000..b3a6707 --- /dev/null +++ b/src/views/zhishu/orderExternalGoods/index.vue @@ -0,0 +1,1375 @@ + + + + + diff --git a/src/views/zhishu/orderExternalGoodsAfterSales/index.vue b/src/views/zhishu/orderExternalGoodsAfterSales/index.vue new file mode 100644 index 0000000..a7aef9d --- /dev/null +++ b/src/views/zhishu/orderExternalGoodsAfterSales/index.vue @@ -0,0 +1,973 @@ + + + + + \ No newline at end of file diff --git a/src/views/zhishu/pddGoods/index.vue b/src/views/zhishu/pddGoods/index.vue new file mode 100644 index 0000000..62d614f --- /dev/null +++ b/src/views/zhishu/pddGoods/index.vue @@ -0,0 +1,2255 @@ + + + + + diff --git a/src/views/zhishu/pddGoodsPlatformRejection/index.vue b/src/views/zhishu/pddGoodsPlatformRejection/index.vue new file mode 100644 index 0000000..8742948 --- /dev/null +++ b/src/views/zhishu/pddGoodsPlatformRejection/index.vue @@ -0,0 +1,563 @@ + + + + + diff --git a/src/views/zhishu/pddGoodsRejection/index.vue b/src/views/zhishu/pddGoodsRejection/index.vue new file mode 100644 index 0000000..ee27f54 --- /dev/null +++ b/src/views/zhishu/pddGoodsRejection/index.vue @@ -0,0 +1,562 @@ + + + + + diff --git a/src/views/zhishu/priceTemplate/index.vue b/src/views/zhishu/priceTemplate/index.vue new file mode 100644 index 0000000..f7ac3b5 --- /dev/null +++ b/src/views/zhishu/priceTemplate/index.vue @@ -0,0 +1,646 @@ + + + + + + diff --git a/src/views/zhishu/printTemplate/index.vue b/src/views/zhishu/printTemplate/index.vue new file mode 100644 index 0000000..21cab4d --- /dev/null +++ b/src/views/zhishu/printTemplate/index.vue @@ -0,0 +1,438 @@ + + + + + + \ No newline at end of file diff --git a/src/views/zhishu/printer/index.vue b/src/views/zhishu/printer/index.vue new file mode 100644 index 0000000..dd11479 --- /dev/null +++ b/src/views/zhishu/printer/index.vue @@ -0,0 +1,320 @@ + + + diff --git a/src/views/zhishu/product/index.vue b/src/views/zhishu/product/index.vue new file mode 100644 index 0000000..1db4f1e --- /dev/null +++ b/src/views/zhishu/product/index.vue @@ -0,0 +1,587 @@ + + + + + \ No newline at end of file diff --git a/src/views/zhishu/profitSharingLog/index.vue b/src/views/zhishu/profitSharingLog/index.vue new file mode 100644 index 0000000..d32f349 --- /dev/null +++ b/src/views/zhishu/profitSharingLog/index.vue @@ -0,0 +1,215 @@ + + + \ No newline at end of file diff --git a/src/views/zhishu/shelves/index.vue b/src/views/zhishu/shelves/index.vue new file mode 100644 index 0000000..da83041 --- /dev/null +++ b/src/views/zhishu/shelves/index.vue @@ -0,0 +1,345 @@ + + + + diff --git a/src/views/zhishu/shop/index.vue b/src/views/zhishu/shop/index.vue new file mode 100644 index 0000000..b824986 --- /dev/null +++ b/src/views/zhishu/shop/index.vue @@ -0,0 +1,4292 @@ + + + + + + + diff --git a/src/views/zhishu/shopAllGoods/index.vue b/src/views/zhishu/shopAllGoods/index.vue new file mode 100644 index 0000000..4ec74d7 --- /dev/null +++ b/src/views/zhishu/shopAllGoods/index.vue @@ -0,0 +1,1568 @@ + + + + + diff --git a/src/views/zhishu/shopDepotAotu/index.vue b/src/views/zhishu/shopDepotAotu/index.vue new file mode 100644 index 0000000..4ed5184 --- /dev/null +++ b/src/views/zhishu/shopDepotAotu/index.vue @@ -0,0 +1,106 @@ + + + diff --git a/src/views/zhishu/shopGoods/index.vue b/src/views/zhishu/shopGoods/index.vue new file mode 100644 index 0000000..f144ddc --- /dev/null +++ b/src/views/zhishu/shopGoods/index.vue @@ -0,0 +1,2452 @@ + + + + + diff --git a/src/views/zhishu/shopGoodsPublished/index.vue b/src/views/zhishu/shopGoodsPublished/index.vue new file mode 100644 index 0000000..5fd128b --- /dev/null +++ b/src/views/zhishu/shopGoodsPublished/index.vue @@ -0,0 +1,410 @@ + + + + + diff --git a/src/views/zhishu/shopOrder/index.vue b/src/views/zhishu/shopOrder/index.vue new file mode 100644 index 0000000..d72a3b7 --- /dev/null +++ b/src/views/zhishu/shopOrder/index.vue @@ -0,0 +1,1516 @@ + + + + + + diff --git a/src/views/zhishu/shopOrderDetail/index.vue b/src/views/zhishu/shopOrderDetail/index.vue new file mode 100644 index 0000000..9d0f1ae --- /dev/null +++ b/src/views/zhishu/shopOrderDetail/index.vue @@ -0,0 +1,349 @@ + + + diff --git a/src/views/zhishu/singlePrint/index.vue b/src/views/zhishu/singlePrint/index.vue new file mode 100644 index 0000000..6b83dba --- /dev/null +++ b/src/views/zhishu/singlePrint/index.vue @@ -0,0 +1,787 @@ + + + + + diff --git a/src/views/zhishu/statisticView/index.vue b/src/views/zhishu/statisticView/index.vue new file mode 100644 index 0000000..87979e8 --- /dev/null +++ b/src/views/zhishu/statisticView/index.vue @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + diff --git a/src/views/zhishu/subAccount/index.vue b/src/views/zhishu/subAccount/index.vue new file mode 100644 index 0000000..417c292 --- /dev/null +++ b/src/views/zhishu/subAccount/index.vue @@ -0,0 +1,11 @@ + + + \ No newline at end of file diff --git a/src/views/zhishu/subAccount/subAccountManagement.vue b/src/views/zhishu/subAccount/subAccountManagement.vue new file mode 100644 index 0000000..5b0bfe2 --- /dev/null +++ b/src/views/zhishu/subAccount/subAccountManagement.vue @@ -0,0 +1,951 @@ + + + + + \ No newline at end of file diff --git a/src/views/zhishu/synchronizationShopLog/index.vue b/src/views/zhishu/synchronizationShopLog/index.vue new file mode 100644 index 0000000..077e789 --- /dev/null +++ b/src/views/zhishu/synchronizationShopLog/index.vue @@ -0,0 +1,359 @@ + + + \ No newline at end of file diff --git a/src/views/zhishu/task/index.vue b/src/views/zhishu/task/index.vue new file mode 100644 index 0000000..c4d1597 --- /dev/null +++ b/src/views/zhishu/task/index.vue @@ -0,0 +1,1626 @@ + + + + + + + diff --git a/src/views/zhishu/taskTotal/index.vue b/src/views/zhishu/taskTotal/index.vue new file mode 100644 index 0000000..020384d --- /dev/null +++ b/src/views/zhishu/taskTotal/index.vue @@ -0,0 +1,638 @@ + + + + + + + diff --git a/src/views/zhishu/treeText/textTree.vue b/src/views/zhishu/treeText/textTree.vue new file mode 100644 index 0000000..68c2e00 --- /dev/null +++ b/src/views/zhishu/treeText/textTree.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/views/zhishu/userAccount/index.vue b/src/views/zhishu/userAccount/index.vue new file mode 100644 index 0000000..00e46ca --- /dev/null +++ b/src/views/zhishu/userAccount/index.vue @@ -0,0 +1,248 @@ + + + diff --git a/src/views/zhishu/userAudit/index.vue b/src/views/zhishu/userAudit/index.vue new file mode 100644 index 0000000..1f33a5f --- /dev/null +++ b/src/views/zhishu/userAudit/index.vue @@ -0,0 +1,799 @@ + + + + + diff --git a/src/views/zhishu/userRecharge/index.vue b/src/views/zhishu/userRecharge/index.vue new file mode 100644 index 0000000..81ccdee --- /dev/null +++ b/src/views/zhishu/userRecharge/index.vue @@ -0,0 +1,764 @@ + + + + + diff --git a/src/views/zhishu/violation/index.vue b/src/views/zhishu/violation/index.vue new file mode 100644 index 0000000..578b365 --- /dev/null +++ b/src/views/zhishu/violation/index.vue @@ -0,0 +1,377 @@ + + + diff --git a/src/views/zhishu/warehouseSettings/index.vue b/src/views/zhishu/warehouseSettings/index.vue new file mode 100644 index 0000000..7785942 --- /dev/null +++ b/src/views/zhishu/warehouseSettings/index.vue @@ -0,0 +1,718 @@ + + + + + \ No newline at end of file diff --git a/src/views/zhishu/wave/index.vue b/src/views/zhishu/wave/index.vue new file mode 100644 index 0000000..e72d338 --- /dev/null +++ b/src/views/zhishu/wave/index.vue @@ -0,0 +1,240 @@ + + + + + diff --git a/src/views/zhishu/xyBind/index.vue b/src/views/zhishu/xyBind/index.vue new file mode 100644 index 0000000..b6d5137 --- /dev/null +++ b/src/views/zhishu/xyBind/index.vue @@ -0,0 +1,685 @@ + + + + + + + diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..6315891 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + // "useDefineForClassFields": true, + "moduleResolution": "bundler", + "strict": true, + "jsx": "preserve", + "strictNullChecks": false, + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "strictFunctionTypes": false, + "lib": ["esnext", "dom"], + "noImplicitAny": false, + "baseUrl": ".", + "allowJs": true, + "experimentalDecorators": true, + "paths": { + "@/*": ["src/*"] + }, + "types": ["vite/client"], + "skipLibCheck": true, + "removeComments": true, + // 允许默认导入 + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["src/**/*.ts", "src/**/*.vue", "src/types/**/*.d.ts", "vite.config.ts"], + "exclude": ["node_modules", "dist", "**/*.js", "**/*.md", "src/**/*.md"] +} diff --git a/uno.config.ts b/uno.config.ts new file mode 100644 index 0000000..0c60a22 --- /dev/null +++ b/uno.config.ts @@ -0,0 +1,33 @@ +import { + defineConfig, + presetAttributify, + presetIcons, + presetTypography, + presetUno, + presetWebFonts, + transformerDirectives, + transformerVariantGroup +} from 'unocss'; + +export default defineConfig({ + shortcuts: { + 'panel-title': + 'pb-[5px] font-sans leading-[1.1] font-medium text-base text-[#6379bb] border-b border-b-solid border-[var(--el-border-color-light)] mb-5 mt-0' + }, + theme: { + colors: { + primary: 'var(--el-color-primary)', + primary_dark: 'var(--el-color-primary-light-5)' + } + }, + presets: [ + presetUno(), + presetAttributify(), + presetIcons(), + presetTypography(), + presetWebFonts({ + fonts: {} + }) + ], + transformers: [transformerDirectives(), transformerVariantGroup()] +}); diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..c302559 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,73 @@ +import { UserConfig, ConfigEnv, loadEnv, defineConfig } from 'vite'; + +import createPlugins from './vite/plugins'; + +import path from 'path'; +export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => { + const env = loadEnv(mode, process.cwd()); + return { + // 部署生产环境和开发环境下的URL。 + // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上 + // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 + base: env.VITE_APP_CONTEXT_PATH, + resolve: { + alias: { + '~': path.resolve(__dirname, './'), + '@': path.resolve(__dirname, './src') + }, + extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] + }, + // https://cn.vitejs.dev/config/#resolve-extensions + plugins: createPlugins(env, command === 'build'), + server: { + host: '0.0.0.0', + port: Number(env.VITE_APP_PORT), + open: true, + proxy: { + [env.VITE_APP_BASE_API]: { + //target: 'https://test.api.buzhiyushu.cn', + target: 'http://localhost:8080', + changeOrigin: true, + ws: true, + rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '') + } + } + }, + css: { + preprocessorOptions: { + scss: { + javascriptEnabled: true + } + }, + postcss: { + plugins: [ + { + postcssPlugin: 'internal:charset-removal', + AtRule: { + charset: (atRule) => { + if (atRule.name === 'charset') { + atRule.remove(); + } + } + } + } + ] + } + }, + // 预编译 + optimizeDeps: { + include: [ + 'vue', + 'vue-router', + 'pinia', + 'axios', + '@vueuse/core', + 'echarts', + 'vue-i18n', + '@vueup/vue-quill', + 'image-conversion', + 'element-plus/es/components/**/css' + ] + } + }; +}); diff --git a/vite.config.ts.timestamp-1774937576958-54fa760d87b39.mjs b/vite.config.ts.timestamp-1774937576958-54fa760d87b39.mjs new file mode 100644 index 0000000..a41ee44 --- /dev/null +++ b/vite.config.ts.timestamp-1774937576958-54fa760d87b39.mjs @@ -0,0 +1,207 @@ +// vite.config.ts +import { loadEnv, defineConfig } from "file:///D:/vueWork/erpWeb/node_modules/vite/dist/node/index.js"; + +// vite/plugins/index.ts +import vue from "file:///D:/vueWork/erpWeb/node_modules/@vitejs/plugin-vue/dist/index.mjs"; + +// vite/plugins/unocss.ts +import UnoCss from "file:///D:/vueWork/erpWeb/node_modules/unocss/dist/vite.mjs"; +var unocss_default = () => { + return UnoCss({ + hmrTopLevelAwait: false + // unocss默认是true,低版本浏览器是不支持的,启动后会报错 + }); +}; + +// vite/plugins/auto-import.ts +import AutoImport from "file:///D:/vueWork/erpWeb/node_modules/unplugin-auto-import/dist/vite.js"; +import { ElementPlusResolver } from "file:///D:/vueWork/erpWeb/node_modules/unplugin-vue-components/dist/resolvers.js"; +import IconsResolver from "file:///D:/vueWork/erpWeb/node_modules/unplugin-icons/dist/resolver.js"; +var __vite_injected_original_dirname = "D:\\vueWork\\erpWeb\\vite\\plugins"; +var auto_import_default = (path3) => { + return AutoImport({ + // 自动导入 Vue 相关函数 + imports: ["vue", "vue-router", "@vueuse/core", "pinia"], + eslintrc: { + enabled: false, + filepath: "./.eslintrc-auto-import.json", + globalsPropValue: true + }, + resolvers: [ + // 自动导入 Element Plus 相关函数ElMessage, ElMessageBox... (带样式) + ElementPlusResolver(), + IconsResolver({ + prefix: "Icon" + }) + ], + vueTemplate: true, + // 是否在 vue 模板中自动导入 + dts: path3.resolve(path3.resolve(__vite_injected_original_dirname, "../../src"), "types", "auto-imports.d.ts") + }); +}; + +// vite/plugins/components.ts +import Components from "file:///D:/vueWork/erpWeb/node_modules/unplugin-vue-components/dist/vite.js"; +import { ElementPlusResolver as ElementPlusResolver2 } from "file:///D:/vueWork/erpWeb/node_modules/unplugin-vue-components/dist/resolvers.js"; +import IconsResolver2 from "file:///D:/vueWork/erpWeb/node_modules/unplugin-icons/dist/resolver.js"; +var __vite_injected_original_dirname2 = "D:\\vueWork\\erpWeb\\vite\\plugins"; +var components_default = (path3) => { + return Components({ + resolvers: [ + // 自动导入 Element Plus 组件 + ElementPlusResolver2(), + // 自动注册图标组件 + IconsResolver2({ + enabledCollections: ["ep"] + }) + ], + dts: path3.resolve(path3.resolve(__vite_injected_original_dirname2, "../../src"), "types", "components.d.ts") + }); +}; + +// vite/plugins/icons.ts +import Icons from "file:///D:/vueWork/erpWeb/node_modules/unplugin-icons/dist/vite.js"; +var icons_default = () => { + return Icons({ + // 自动安装图标库 + autoInstall: true + }); +}; + +// vite/plugins/svg-icon.ts +import { createSvgIconsPlugin } from "file:///D:/vueWork/erpWeb/node_modules/vite-plugin-svg-icons/dist/index.mjs"; +var __vite_injected_original_dirname3 = "D:\\vueWork\\erpWeb\\vite\\plugins"; +var svg_icon_default = (path3, isBuild) => { + return createSvgIconsPlugin({ + // 指定需要缓存的图标文件夹 + iconDirs: [path3.resolve(path3.resolve(__vite_injected_original_dirname3, "../../src"), "assets/icons/svg")], + // 指定symbolId格式 + symbolId: "icon-[dir]-[name]", + svgoOptions: isBuild + }); +}; + +// vite/plugins/compression.ts +import compression from "file:///D:/vueWork/erpWeb/node_modules/vite-plugin-compression/dist/index.mjs"; +var compression_default = (env) => { + const { VITE_BUILD_COMPRESS } = env; + const plugin = []; + if (VITE_BUILD_COMPRESS) { + const compressList = VITE_BUILD_COMPRESS.split(","); + if (compressList.includes("gzip")) { + plugin.push( + compression({ + ext: ".gz", + deleteOriginFile: false + }) + ); + } + if (compressList.includes("brotli")) { + plugin.push( + compression({ + ext: ".br", + algorithm: "brotliCompress", + deleteOriginFile: false + }) + ); + } + } + return plugin; +}; + +// vite/plugins/setup-extend.ts +import setupExtend from "file:///D:/vueWork/erpWeb/node_modules/unplugin-vue-setup-extend-plus/dist/vite.js"; +var setup_extend_default = () => { + return setupExtend({}); +}; + +// vite/plugins/index.ts +import path from "path"; +var plugins_default = (viteEnv, isBuild = false) => { + const vitePlugins = []; + vitePlugins.push(vue()); + vitePlugins.push(unocss_default()); + vitePlugins.push(auto_import_default(path)); + vitePlugins.push(components_default(path)); + vitePlugins.push(compression_default(viteEnv)); + vitePlugins.push(icons_default()); + vitePlugins.push(svg_icon_default(path, isBuild)); + vitePlugins.push(setup_extend_default()); + return vitePlugins; +}; + +// vite.config.ts +import path2 from "path"; +var __vite_injected_original_dirname4 = "D:\\vueWork\\erpWeb"; +var vite_config_default = defineConfig(({ mode, command }) => { + const env = loadEnv(mode, process.cwd()); + return { + // 部署生产环境和开发环境下的URL。 + // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上 + // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 + base: env.VITE_APP_CONTEXT_PATH, + resolve: { + alias: { + "~": path2.resolve(__vite_injected_original_dirname4, "./"), + "@": path2.resolve(__vite_injected_original_dirname4, "./src") + }, + extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"] + }, + // https://cn.vitejs.dev/config/#resolve-extensions + plugins: plugins_default(env, command === "build"), + server: { + host: "0.0.0.0", + port: Number(env.VITE_APP_PORT), + open: true, + proxy: { + [env.VITE_APP_BASE_API]: { + //target: 'https://test.api.buzhiyushu.cn', + target: "http://localhost:8080", + changeOrigin: true, + ws: true, + rewrite: (path3) => path3.replace(new RegExp("^" + env.VITE_APP_BASE_API), "") + } + } + }, + css: { + preprocessorOptions: { + scss: { + javascriptEnabled: true + } + }, + postcss: { + plugins: [ + { + postcssPlugin: "internal:charset-removal", + AtRule: { + charset: (atRule) => { + if (atRule.name === "charset") { + atRule.remove(); + } + } + } + } + ] + } + }, + // 预编译 + optimizeDeps: { + include: [ + "vue", + "vue-router", + "pinia", + "axios", + "@vueuse/core", + "echarts", + "vue-i18n", + "@vueup/vue-quill", + "image-conversion", + "element-plus/es/components/**/css" + ] + } + }; +}); +export { + vite_config_default as default +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiLCAidml0ZS9wbHVnaW5zL2luZGV4LnRzIiwgInZpdGUvcGx1Z2lucy91bm9jc3MudHMiLCAidml0ZS9wbHVnaW5zL2F1dG8taW1wb3J0LnRzIiwgInZpdGUvcGx1Z2lucy9jb21wb25lbnRzLnRzIiwgInZpdGUvcGx1Z2lucy9pY29ucy50cyIsICJ2aXRlL3BsdWdpbnMvc3ZnLWljb24udHMiLCAidml0ZS9wbHVnaW5zL2NvbXByZXNzaW9uLnRzIiwgInZpdGUvcGx1Z2lucy9zZXR1cC1leHRlbmQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJEOlxcXFx2dWVXb3JrXFxcXGVycFdlYlwiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZS5jb25maWcudHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0Q6L3Z1ZVdvcmsvZXJwV2ViL3ZpdGUuY29uZmlnLnRzXCI7aW1wb3J0IHsgVXNlckNvbmZpZywgQ29uZmlnRW52LCBsb2FkRW52LCBkZWZpbmVDb25maWcgfSBmcm9tICd2aXRlJztcclxuXHJcbmltcG9ydCBjcmVhdGVQbHVnaW5zIGZyb20gJy4vdml0ZS9wbHVnaW5zJztcclxuXHJcbmltcG9ydCBwYXRoIGZyb20gJ3BhdGgnO1xyXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoKHsgbW9kZSwgY29tbWFuZCB9OiBDb25maWdFbnYpOiBVc2VyQ29uZmlnID0+IHtcclxuICBjb25zdCBlbnYgPSBsb2FkRW52KG1vZGUsIHByb2Nlc3MuY3dkKCkpO1xyXG4gIHJldHVybiB7XHJcbiAgICAvLyBcdTkwRThcdTdGNzJcdTc1MUZcdTRFQTdcdTczQUZcdTU4ODNcdTU0OENcdTVGMDBcdTUzRDFcdTczQUZcdTU4ODNcdTRFMEJcdTc2ODRVUkxcdTMwMDJcclxuICAgIC8vIFx1OUVEOFx1OEJBNFx1NjBDNVx1NTFCNVx1NEUwQlx1RkYwQ3ZpdGUgXHU0RjFBXHU1MDQ3XHU4QkJFXHU0RjYwXHU3Njg0XHU1RTk0XHU3NTI4XHU2NjJGXHU4OEFCXHU5MEU4XHU3RjcyXHU1NzI4XHU0RTAwXHU0RTJBXHU1N0RGXHU1NDBEXHU3Njg0XHU2ODM5XHU4REVGXHU1Rjg0XHU0RTBBXHJcbiAgICAvLyBcdTRGOEJcdTU5ODIgaHR0cHM6Ly93d3cucnVveWkudmlwL1x1MzAwMlx1NTk4Mlx1Njc5Q1x1NUU5NFx1NzUyOFx1ODhBQlx1OTBFOFx1N0Y3Mlx1NTcyOFx1NEUwMFx1NEUyQVx1NUI1MFx1OERFRlx1NUY4NFx1NEUwQVx1RkYwQ1x1NEY2MFx1NUMzMVx1OTcwMFx1ODk4MVx1NzUyOFx1OEZEOVx1NEUyQVx1OTAwOVx1OTg3OVx1NjMwN1x1NUI5QVx1OEZEOVx1NEUyQVx1NUI1MFx1OERFRlx1NUY4NFx1MzAwMlx1NEY4Qlx1NTk4Mlx1RkYwQ1x1NTk4Mlx1Njc5Q1x1NEY2MFx1NzY4NFx1NUU5NFx1NzUyOFx1ODhBQlx1OTBFOFx1N0Y3Mlx1NTcyOCBodHRwczovL3d3dy5ydW95aS52aXAvYWRtaW4vXHVGRjBDXHU1MjE5XHU4QkJFXHU3RjZFIGJhc2VVcmwgXHU0RTNBIC9hZG1pbi9cdTMwMDJcclxuICAgIGJhc2U6IGVudi5WSVRFX0FQUF9DT05URVhUX1BBVEgsXHJcbiAgICByZXNvbHZlOiB7XHJcbiAgICAgIGFsaWFzOiB7XHJcbiAgICAgICAgJ34nOiBwYXRoLnJlc29sdmUoX19kaXJuYW1lLCAnLi8nKSxcclxuICAgICAgICAnQCc6IHBhdGgucmVzb2x2ZShfX2Rpcm5hbWUsICcuL3NyYycpXHJcbiAgICAgIH0sXHJcbiAgICAgIGV4dGVuc2lvbnM6IFsnLm1qcycsICcuanMnLCAnLnRzJywgJy5qc3gnLCAnLnRzeCcsICcuanNvbicsICcudnVlJ11cclxuICAgIH0sXHJcbiAgICAvLyBodHRwczovL2NuLnZpdGVqcy5kZXYvY29uZmlnLyNyZXNvbHZlLWV4dGVuc2lvbnNcclxuICAgIHBsdWdpbnM6IGNyZWF0ZVBsdWdpbnMoZW52LCBjb21tYW5kID09PSAnYnVpbGQnKSxcclxuICAgIHNlcnZlcjoge1xyXG4gICAgICBob3N0OiAnMC4wLjAuMCcsXHJcbiAgICAgIHBvcnQ6IE51bWJlcihlbnYuVklURV9BUFBfUE9SVCksXHJcbiAgICAgIG9wZW46IHRydWUsXHJcbiAgICAgIHByb3h5OiB7XHJcbiAgICAgICAgW2Vudi5WSVRFX0FQUF9CQVNFX0FQSV06IHtcclxuICAgICAgICAgIC8vdGFyZ2V0OiAnaHR0cHM6Ly90ZXN0LmFwaS5idXpoaXl1c2h1LmNuJyxcclxuICAgICAgICAgIHRhcmdldDogJ2h0dHA6Ly9sb2NhbGhvc3Q6ODA4MCcsXHJcbiAgICAgICAgICBjaGFuZ2VPcmlnaW46IHRydWUsXHJcbiAgICAgICAgICB3czogdHJ1ZSxcclxuICAgICAgICAgIHJld3JpdGU6IChwYXRoKSA9PiBwYXRoLnJlcGxhY2UobmV3IFJlZ0V4cCgnXicgKyBlbnYuVklURV9BUFBfQkFTRV9BUEkpLCAnJylcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH0sXHJcbiAgICBjc3M6IHtcclxuICAgICAgcHJlcHJvY2Vzc29yT3B0aW9uczoge1xyXG4gICAgICAgIHNjc3M6IHtcclxuICAgICAgICAgIGphdmFzY3JpcHRFbmFibGVkOiB0cnVlXHJcbiAgICAgICAgfVxyXG4gICAgICB9LFxyXG4gICAgICBwb3N0Y3NzOiB7XHJcbiAgICAgICAgcGx1Z2luczogW1xyXG4gICAgICAgICAge1xyXG4gICAgICAgICAgICBwb3N0Y3NzUGx1Z2luOiAnaW50ZXJuYWw6Y2hhcnNldC1yZW1vdmFsJyxcclxuICAgICAgICAgICAgQXRSdWxlOiB7XHJcbiAgICAgICAgICAgICAgY2hhcnNldDogKGF0UnVsZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKGF0UnVsZS5uYW1lID09PSAnY2hhcnNldCcpIHtcclxuICAgICAgICAgICAgICAgICAgYXRSdWxlLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgIF1cclxuICAgICAgfVxyXG4gICAgfSxcclxuICAgIC8vIFx1OTg4NFx1N0YxNlx1OEJEMVxyXG4gICAgb3B0aW1pemVEZXBzOiB7XHJcbiAgICAgIGluY2x1ZGU6IFtcclxuICAgICAgICAndnVlJyxcclxuICAgICAgICAndnVlLXJvdXRlcicsXHJcbiAgICAgICAgJ3BpbmlhJyxcclxuICAgICAgICAnYXhpb3MnLFxyXG4gICAgICAgICdAdnVldXNlL2NvcmUnLFxyXG4gICAgICAgICdlY2hhcnRzJyxcclxuICAgICAgICAndnVlLWkxOG4nLFxyXG4gICAgICAgICdAdnVldXAvdnVlLXF1aWxsJyxcclxuICAgICAgICAnaW1hZ2UtY29udmVyc2lvbicsXHJcbiAgICAgICAgJ2VsZW1lbnQtcGx1cy9lcy9jb21wb25lbnRzLyoqL2NzcydcclxuICAgICAgXVxyXG4gICAgfVxyXG4gIH07XHJcbn0pO1xyXG4iLCAiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXFxcXGluZGV4LnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9EOi92dWVXb3JrL2VycFdlYi92aXRlL3BsdWdpbnMvaW5kZXgudHNcIjtpbXBvcnQgdnVlIGZyb20gJ0B2aXRlanMvcGx1Z2luLXZ1ZSc7XHJcbmltcG9ydCBjcmVhdGVVbm9Dc3MgZnJvbSAnLi91bm9jc3MnO1xyXG5pbXBvcnQgY3JlYXRlQXV0b0ltcG9ydCBmcm9tICcuL2F1dG8taW1wb3J0JztcclxuaW1wb3J0IGNyZWF0ZUNvbXBvbmVudHMgZnJvbSAnLi9jb21wb25lbnRzJztcclxuaW1wb3J0IGNyZWF0ZUljb25zIGZyb20gJy4vaWNvbnMnO1xyXG5pbXBvcnQgY3JlYXRlU3ZnSWNvbnNQbHVnaW4gZnJvbSAnLi9zdmctaWNvbic7XHJcbmltcG9ydCBjcmVhdGVDb21wcmVzc2lvbiBmcm9tICcuL2NvbXByZXNzaW9uJztcclxuaW1wb3J0IGNyZWF0ZVNldHVwRXh0ZW5kIGZyb20gJy4vc2V0dXAtZXh0ZW5kJztcclxuaW1wb3J0IHBhdGggZnJvbSAncGF0aCc7XHJcblxyXG5leHBvcnQgZGVmYXVsdCAodml0ZUVudjogYW55LCBpc0J1aWxkID0gZmFsc2UpOiBbXSA9PiB7XHJcbiAgY29uc3Qgdml0ZVBsdWdpbnM6IGFueSA9IFtdO1xyXG4gIHZpdGVQbHVnaW5zLnB1c2godnVlKCkpO1xyXG4gIHZpdGVQbHVnaW5zLnB1c2goY3JlYXRlVW5vQ3NzKCkpO1xyXG4gIHZpdGVQbHVnaW5zLnB1c2goY3JlYXRlQXV0b0ltcG9ydChwYXRoKSk7XHJcbiAgdml0ZVBsdWdpbnMucHVzaChjcmVhdGVDb21wb25lbnRzKHBhdGgpKTtcclxuICB2aXRlUGx1Z2lucy5wdXNoKGNyZWF0ZUNvbXByZXNzaW9uKHZpdGVFbnYpKTtcclxuICB2aXRlUGx1Z2lucy5wdXNoKGNyZWF0ZUljb25zKCkpO1xyXG4gIHZpdGVQbHVnaW5zLnB1c2goY3JlYXRlU3ZnSWNvbnNQbHVnaW4ocGF0aCwgaXNCdWlsZCkpO1xyXG4gIHZpdGVQbHVnaW5zLnB1c2goY3JlYXRlU2V0dXBFeHRlbmQoKSk7XHJcbiAgcmV0dXJuIHZpdGVQbHVnaW5zO1xyXG59O1xyXG4iLCAiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXFxcXHVub2Nzcy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vRDovdnVlV29yay9lcnBXZWIvdml0ZS9wbHVnaW5zL3Vub2Nzcy50c1wiO2ltcG9ydCBVbm9Dc3MgZnJvbSAndW5vY3NzL3ZpdGUnO1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgKCkgPT4ge1xyXG4gIHJldHVybiBVbm9Dc3Moe1xyXG4gICAgaG1yVG9wTGV2ZWxBd2FpdDogZmFsc2UgLy8gdW5vY3NzXHU5RUQ4XHU4QkE0XHU2NjJGdHJ1ZVx1RkYwQ1x1NEY0RVx1NzI0OFx1NjcyQ1x1NkQ0Rlx1ODlDOFx1NTY2OFx1NjYyRlx1NEUwRFx1NjUyRlx1NjMwMVx1NzY4NFx1RkYwQ1x1NTQyRlx1NTJBOFx1NTQwRVx1NEYxQVx1NjJBNVx1OTUxOVxyXG4gIH0pO1xyXG59O1xyXG4iLCAiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXFxcXGF1dG8taW1wb3J0LnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9EOi92dWVXb3JrL2VycFdlYi92aXRlL3BsdWdpbnMvYXV0by1pbXBvcnQudHNcIjtpbXBvcnQgQXV0b0ltcG9ydCBmcm9tICd1bnBsdWdpbi1hdXRvLWltcG9ydC92aXRlJztcclxuaW1wb3J0IHsgRWxlbWVudFBsdXNSZXNvbHZlciB9IGZyb20gJ3VucGx1Z2luLXZ1ZS1jb21wb25lbnRzL3Jlc29sdmVycyc7XHJcbmltcG9ydCBJY29uc1Jlc29sdmVyIGZyb20gJ3VucGx1Z2luLWljb25zL3Jlc29sdmVyJztcclxuXHJcbmV4cG9ydCBkZWZhdWx0IChwYXRoOiBhbnkpID0+IHtcclxuICByZXR1cm4gQXV0b0ltcG9ydCh7XHJcbiAgICAvLyBcdTgxRUFcdTUyQThcdTVCRkNcdTUxNjUgVnVlIFx1NzZGOFx1NTE3M1x1NTFGRFx1NjU3MFxyXG4gICAgaW1wb3J0czogWyd2dWUnLCAndnVlLXJvdXRlcicsICdAdnVldXNlL2NvcmUnLCAncGluaWEnXSxcclxuICAgIGVzbGludHJjOiB7XHJcbiAgICAgIGVuYWJsZWQ6IGZhbHNlLFxyXG4gICAgICBmaWxlcGF0aDogJy4vLmVzbGludHJjLWF1dG8taW1wb3J0Lmpzb24nLFxyXG4gICAgICBnbG9iYWxzUHJvcFZhbHVlOiB0cnVlXHJcbiAgICB9LFxyXG4gICAgcmVzb2x2ZXJzOiBbXHJcbiAgICAgIC8vIFx1ODFFQVx1NTJBOFx1NUJGQ1x1NTE2NSBFbGVtZW50IFBsdXMgXHU3NkY4XHU1MTczXHU1MUZEXHU2NTcwRWxNZXNzYWdlLCBFbE1lc3NhZ2VCb3guLi4gKFx1NUUyNlx1NjgzN1x1NUYwRilcclxuICAgICAgRWxlbWVudFBsdXNSZXNvbHZlcigpLFxyXG4gICAgICBJY29uc1Jlc29sdmVyKHtcclxuICAgICAgICBwcmVmaXg6ICdJY29uJ1xyXG4gICAgICB9KVxyXG4gICAgXSxcclxuICAgIHZ1ZVRlbXBsYXRlOiB0cnVlLCAvLyBcdTY2MkZcdTU0MjZcdTU3MjggdnVlIFx1NkEyMVx1Njc3Rlx1NEUyRFx1ODFFQVx1NTJBOFx1NUJGQ1x1NTE2NVxyXG4gICAgZHRzOiBwYXRoLnJlc29sdmUocGF0aC5yZXNvbHZlKF9fZGlybmFtZSwgJy4uLy4uL3NyYycpLCAndHlwZXMnLCAnYXV0by1pbXBvcnRzLmQudHMnKVxyXG4gIH0pO1xyXG59O1xyXG4iLCAiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXFxcXGNvbXBvbmVudHMudHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0Q6L3Z1ZVdvcmsvZXJwV2ViL3ZpdGUvcGx1Z2lucy9jb21wb25lbnRzLnRzXCI7aW1wb3J0IENvbXBvbmVudHMgZnJvbSAndW5wbHVnaW4tdnVlLWNvbXBvbmVudHMvdml0ZSc7XHJcbmltcG9ydCB7IEVsZW1lbnRQbHVzUmVzb2x2ZXIgfSBmcm9tICd1bnBsdWdpbi12dWUtY29tcG9uZW50cy9yZXNvbHZlcnMnO1xyXG5pbXBvcnQgSWNvbnNSZXNvbHZlciBmcm9tICd1bnBsdWdpbi1pY29ucy9yZXNvbHZlcic7XHJcblxyXG5leHBvcnQgZGVmYXVsdCAocGF0aDogYW55KSA9PiB7XHJcbiAgcmV0dXJuIENvbXBvbmVudHMoe1xyXG4gICAgcmVzb2x2ZXJzOiBbXHJcbiAgICAgIC8vIFx1ODFFQVx1NTJBOFx1NUJGQ1x1NTE2NSBFbGVtZW50IFBsdXMgXHU3RUM0XHU0RUY2XHJcbiAgICAgIEVsZW1lbnRQbHVzUmVzb2x2ZXIoKSxcclxuICAgICAgLy8gXHU4MUVBXHU1MkE4XHU2Q0U4XHU1MThDXHU1NkZFXHU2ODA3XHU3RUM0XHU0RUY2XHJcbiAgICAgIEljb25zUmVzb2x2ZXIoe1xyXG4gICAgICAgIGVuYWJsZWRDb2xsZWN0aW9uczogWydlcCddXHJcbiAgICAgIH0pXHJcbiAgICBdLFxyXG4gICAgZHRzOiBwYXRoLnJlc29sdmUocGF0aC5yZXNvbHZlKF9fZGlybmFtZSwgJy4uLy4uL3NyYycpLCAndHlwZXMnLCAnY29tcG9uZW50cy5kLnRzJylcclxuICB9KTtcclxufTtcclxuIiwgImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJEOlxcXFx2dWVXb3JrXFxcXGVycFdlYlxcXFx2aXRlXFxcXHBsdWdpbnNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1xcXFxpY29ucy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vRDovdnVlV29yay9lcnBXZWIvdml0ZS9wbHVnaW5zL2ljb25zLnRzXCI7aW1wb3J0IEljb25zIGZyb20gJ3VucGx1Z2luLWljb25zL3ZpdGUnO1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgKCkgPT4ge1xyXG4gIHJldHVybiBJY29ucyh7XHJcbiAgICAvLyBcdTgxRUFcdTUyQThcdTVCODlcdTg4QzVcdTU2RkVcdTY4MDdcdTVFOTNcclxuICAgIGF1dG9JbnN0YWxsOiB0cnVlXHJcbiAgfSk7XHJcbn07XHJcbiIsICJjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCJEOlxcXFx2dWVXb3JrXFxcXGVycFdlYlxcXFx2aXRlXFxcXHBsdWdpbnNcXFxcc3ZnLWljb24udHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0Q6L3Z1ZVdvcmsvZXJwV2ViL3ZpdGUvcGx1Z2lucy9zdmctaWNvbi50c1wiO2ltcG9ydCB7IGNyZWF0ZVN2Z0ljb25zUGx1Z2luIH0gZnJvbSAndml0ZS1wbHVnaW4tc3ZnLWljb25zJztcclxuZXhwb3J0IGRlZmF1bHQgKHBhdGg6IGFueSwgaXNCdWlsZDogYm9vbGVhbikgPT4ge1xyXG4gIHJldHVybiBjcmVhdGVTdmdJY29uc1BsdWdpbih7XHJcbiAgICAvLyBcdTYzMDdcdTVCOUFcdTk3MDBcdTg5ODFcdTdGMTNcdTVCNThcdTc2ODRcdTU2RkVcdTY4MDdcdTY1ODdcdTRFRjZcdTU5MzlcclxuICAgIGljb25EaXJzOiBbcGF0aC5yZXNvbHZlKHBhdGgucmVzb2x2ZShfX2Rpcm5hbWUsICcuLi8uLi9zcmMnKSwgJ2Fzc2V0cy9pY29ucy9zdmcnKV0sXHJcbiAgICAvLyBcdTYzMDdcdTVCOUFzeW1ib2xJZFx1NjgzQ1x1NUYwRlxyXG4gICAgc3ltYm9sSWQ6ICdpY29uLVtkaXJdLVtuYW1lXScsXHJcbiAgICBzdmdvT3B0aW9uczogaXNCdWlsZFxyXG4gIH0pO1xyXG59O1xyXG4iLCAiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXFxcXGNvbXByZXNzaW9uLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9EOi92dWVXb3JrL2VycFdlYi92aXRlL3BsdWdpbnMvY29tcHJlc3Npb24udHNcIjtpbXBvcnQgY29tcHJlc3Npb24gZnJvbSAndml0ZS1wbHVnaW4tY29tcHJlc3Npb24nO1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgKGVudjogYW55KSA9PiB7XHJcbiAgY29uc3QgeyBWSVRFX0JVSUxEX0NPTVBSRVNTIH0gPSBlbnY7XHJcbiAgY29uc3QgcGx1Z2luOiBhbnlbXSA9IFtdO1xyXG4gIGlmIChWSVRFX0JVSUxEX0NPTVBSRVNTKSB7XHJcbiAgICBjb25zdCBjb21wcmVzc0xpc3QgPSBWSVRFX0JVSUxEX0NPTVBSRVNTLnNwbGl0KCcsJyk7XHJcbiAgICBpZiAoY29tcHJlc3NMaXN0LmluY2x1ZGVzKCdnemlwJykpIHtcclxuICAgICAgLy8gaHR0cDovL2RvYy5ydW95aS52aXAvcnVveWktdnVlL290aGVyL2ZhcS5odG1sI1x1NEY3Rlx1NzUyOGd6aXBcdTg5RTNcdTUzOEJcdTdGMjlcdTk3NTlcdTYwMDFcdTY1ODdcdTRFRjZcclxuICAgICAgcGx1Z2luLnB1c2goXHJcbiAgICAgICAgY29tcHJlc3Npb24oe1xyXG4gICAgICAgICAgZXh0OiAnLmd6JyxcclxuICAgICAgICAgIGRlbGV0ZU9yaWdpbkZpbGU6IGZhbHNlXHJcbiAgICAgICAgfSlcclxuICAgICAgKTtcclxuICAgIH1cclxuICAgIGlmIChjb21wcmVzc0xpc3QuaW5jbHVkZXMoJ2Jyb3RsaScpKSB7XHJcbiAgICAgIHBsdWdpbi5wdXNoKFxyXG4gICAgICAgIGNvbXByZXNzaW9uKHtcclxuICAgICAgICAgIGV4dDogJy5icicsXHJcbiAgICAgICAgICBhbGdvcml0aG06ICdicm90bGlDb21wcmVzcycsXHJcbiAgICAgICAgICBkZWxldGVPcmlnaW5GaWxlOiBmYWxzZVxyXG4gICAgICAgIH0pXHJcbiAgICAgICk7XHJcbiAgICB9XHJcbiAgfVxyXG4gIHJldHVybiBwbHVnaW47XHJcbn07XHJcbiIsICJjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCJEOlxcXFx2dWVXb3JrXFxcXGVycFdlYlxcXFx2aXRlXFxcXHBsdWdpbnNcXFxcc2V0dXAtZXh0ZW5kLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9EOi92dWVXb3JrL2VycFdlYi92aXRlL3BsdWdpbnMvc2V0dXAtZXh0ZW5kLnRzXCI7aW1wb3J0IHNldHVwRXh0ZW5kIGZyb20gJ3VucGx1Z2luLXZ1ZS1zZXR1cC1leHRlbmQtcGx1cy92aXRlJztcclxuXHJcbmV4cG9ydCBkZWZhdWx0ICgpID0+IHtcclxuICByZXR1cm4gc2V0dXBFeHRlbmQoe30pO1xyXG59O1xyXG4iXSwKICAibWFwcGluZ3MiOiAiO0FBQTJPLFNBQWdDLFNBQVMsb0JBQW9COzs7QUNBOUIsT0FBTyxTQUFTOzs7QUNBZCxPQUFPLFlBQVk7QUFFL1IsSUFBTyxpQkFBUSxNQUFNO0FBQ25CLFNBQU8sT0FBTztBQUFBLElBQ1osa0JBQWtCO0FBQUE7QUFBQSxFQUNwQixDQUFDO0FBQ0g7OztBQ05zUixPQUFPLGdCQUFnQjtBQUM3UyxTQUFTLDJCQUEyQjtBQUNwQyxPQUFPLG1CQUFtQjtBQUYxQixJQUFNLG1DQUFtQztBQUl6QyxJQUFPLHNCQUFRLENBQUNBLFVBQWM7QUFDNUIsU0FBTyxXQUFXO0FBQUE7QUFBQSxJQUVoQixTQUFTLENBQUMsT0FBTyxjQUFjLGdCQUFnQixPQUFPO0FBQUEsSUFDdEQsVUFBVTtBQUFBLE1BQ1IsU0FBUztBQUFBLE1BQ1QsVUFBVTtBQUFBLE1BQ1Ysa0JBQWtCO0FBQUEsSUFDcEI7QUFBQSxJQUNBLFdBQVc7QUFBQTtBQUFBLE1BRVQsb0JBQW9CO0FBQUEsTUFDcEIsY0FBYztBQUFBLFFBQ1osUUFBUTtBQUFBLE1BQ1YsQ0FBQztBQUFBLElBQ0g7QUFBQSxJQUNBLGFBQWE7QUFBQTtBQUFBLElBQ2IsS0FBS0EsTUFBSyxRQUFRQSxNQUFLLFFBQVEsa0NBQVcsV0FBVyxHQUFHLFNBQVMsbUJBQW1CO0FBQUEsRUFDdEYsQ0FBQztBQUNIOzs7QUN2Qm9SLE9BQU8sZ0JBQWdCO0FBQzNTLFNBQVMsdUJBQUFDLDRCQUEyQjtBQUNwQyxPQUFPQyxvQkFBbUI7QUFGMUIsSUFBTUMsb0NBQW1DO0FBSXpDLElBQU8scUJBQVEsQ0FBQ0MsVUFBYztBQUM1QixTQUFPLFdBQVc7QUFBQSxJQUNoQixXQUFXO0FBQUE7QUFBQSxNQUVUQyxxQkFBb0I7QUFBQTtBQUFBLE1BRXBCQyxlQUFjO0FBQUEsUUFDWixvQkFBb0IsQ0FBQyxJQUFJO0FBQUEsTUFDM0IsQ0FBQztBQUFBLElBQ0g7QUFBQSxJQUNBLEtBQUtGLE1BQUssUUFBUUEsTUFBSyxRQUFRRyxtQ0FBVyxXQUFXLEdBQUcsU0FBUyxpQkFBaUI7QUFBQSxFQUNwRixDQUFDO0FBQ0g7OztBQ2hCMFEsT0FBTyxXQUFXO0FBRTVSLElBQU8sZ0JBQVEsTUFBTTtBQUNuQixTQUFPLE1BQU07QUFBQTtBQUFBLElBRVgsYUFBYTtBQUFBLEVBQ2YsQ0FBQztBQUNIOzs7QUNQZ1IsU0FBUyw0QkFBNEI7QUFBclQsSUFBTUMsb0NBQW1DO0FBQ3pDLElBQU8sbUJBQVEsQ0FBQ0MsT0FBVyxZQUFxQjtBQUM5QyxTQUFPLHFCQUFxQjtBQUFBO0FBQUEsSUFFMUIsVUFBVSxDQUFDQSxNQUFLLFFBQVFBLE1BQUssUUFBUUMsbUNBQVcsV0FBVyxHQUFHLGtCQUFrQixDQUFDO0FBQUE7QUFBQSxJQUVqRixVQUFVO0FBQUEsSUFDVixhQUFhO0FBQUEsRUFDZixDQUFDO0FBQ0g7OztBQ1RzUixPQUFPLGlCQUFpQjtBQUU5UyxJQUFPLHNCQUFRLENBQUMsUUFBYTtBQUMzQixRQUFNLEVBQUUsb0JBQW9CLElBQUk7QUFDaEMsUUFBTSxTQUFnQixDQUFDO0FBQ3ZCLE1BQUkscUJBQXFCO0FBQ3ZCLFVBQU0sZUFBZSxvQkFBb0IsTUFBTSxHQUFHO0FBQ2xELFFBQUksYUFBYSxTQUFTLE1BQU0sR0FBRztBQUVqQyxhQUFPO0FBQUEsUUFDTCxZQUFZO0FBQUEsVUFDVixLQUFLO0FBQUEsVUFDTCxrQkFBa0I7QUFBQSxRQUNwQixDQUFDO0FBQUEsTUFDSDtBQUFBLElBQ0Y7QUFDQSxRQUFJLGFBQWEsU0FBUyxRQUFRLEdBQUc7QUFDbkMsYUFBTztBQUFBLFFBQ0wsWUFBWTtBQUFBLFVBQ1YsS0FBSztBQUFBLFVBQ0wsV0FBVztBQUFBLFVBQ1gsa0JBQWtCO0FBQUEsUUFDcEIsQ0FBQztBQUFBLE1BQ0g7QUFBQSxJQUNGO0FBQUEsRUFDRjtBQUNBLFNBQU87QUFDVDs7O0FDM0J3UixPQUFPLGlCQUFpQjtBQUVoVCxJQUFPLHVCQUFRLE1BQU07QUFDbkIsU0FBTyxZQUFZLENBQUMsQ0FBQztBQUN2Qjs7O0FQSUEsT0FBTyxVQUFVO0FBRWpCLElBQU8sa0JBQVEsQ0FBQyxTQUFjLFVBQVUsVUFBYztBQUNwRCxRQUFNLGNBQW1CLENBQUM7QUFDMUIsY0FBWSxLQUFLLElBQUksQ0FBQztBQUN0QixjQUFZLEtBQUssZUFBYSxDQUFDO0FBQy9CLGNBQVksS0FBSyxvQkFBaUIsSUFBSSxDQUFDO0FBQ3ZDLGNBQVksS0FBSyxtQkFBaUIsSUFBSSxDQUFDO0FBQ3ZDLGNBQVksS0FBSyxvQkFBa0IsT0FBTyxDQUFDO0FBQzNDLGNBQVksS0FBSyxjQUFZLENBQUM7QUFDOUIsY0FBWSxLQUFLLGlCQUFxQixNQUFNLE9BQU8sQ0FBQztBQUNwRCxjQUFZLEtBQUsscUJBQWtCLENBQUM7QUFDcEMsU0FBTztBQUNUOzs7QURqQkEsT0FBT0MsV0FBVTtBQUpqQixJQUFNQyxvQ0FBbUM7QUFLekMsSUFBTyxzQkFBUSxhQUFhLENBQUMsRUFBRSxNQUFNLFFBQVEsTUFBNkI7QUFDeEUsUUFBTSxNQUFNLFFBQVEsTUFBTSxRQUFRLElBQUksQ0FBQztBQUN2QyxTQUFPO0FBQUE7QUFBQTtBQUFBO0FBQUEsSUFJTCxNQUFNLElBQUk7QUFBQSxJQUNWLFNBQVM7QUFBQSxNQUNQLE9BQU87QUFBQSxRQUNMLEtBQUtDLE1BQUssUUFBUUMsbUNBQVcsSUFBSTtBQUFBLFFBQ2pDLEtBQUtELE1BQUssUUFBUUMsbUNBQVcsT0FBTztBQUFBLE1BQ3RDO0FBQUEsTUFDQSxZQUFZLENBQUMsUUFBUSxPQUFPLE9BQU8sUUFBUSxRQUFRLFNBQVMsTUFBTTtBQUFBLElBQ3BFO0FBQUE7QUFBQSxJQUVBLFNBQVMsZ0JBQWMsS0FBSyxZQUFZLE9BQU87QUFBQSxJQUMvQyxRQUFRO0FBQUEsTUFDTixNQUFNO0FBQUEsTUFDTixNQUFNLE9BQU8sSUFBSSxhQUFhO0FBQUEsTUFDOUIsTUFBTTtBQUFBLE1BQ04sT0FBTztBQUFBLFFBQ0wsQ0FBQyxJQUFJLGlCQUFpQixHQUFHO0FBQUE7QUFBQSxVQUV2QixRQUFRO0FBQUEsVUFDUixjQUFjO0FBQUEsVUFDZCxJQUFJO0FBQUEsVUFDSixTQUFTLENBQUNELFVBQVNBLE1BQUssUUFBUSxJQUFJLE9BQU8sTUFBTSxJQUFJLGlCQUFpQixHQUFHLEVBQUU7QUFBQSxRQUM3RTtBQUFBLE1BQ0Y7QUFBQSxJQUNGO0FBQUEsSUFDQSxLQUFLO0FBQUEsTUFDSCxxQkFBcUI7QUFBQSxRQUNuQixNQUFNO0FBQUEsVUFDSixtQkFBbUI7QUFBQSxRQUNyQjtBQUFBLE1BQ0Y7QUFBQSxNQUNBLFNBQVM7QUFBQSxRQUNQLFNBQVM7QUFBQSxVQUNQO0FBQUEsWUFDRSxlQUFlO0FBQUEsWUFDZixRQUFRO0FBQUEsY0FDTixTQUFTLENBQUMsV0FBVztBQUNuQixvQkFBSSxPQUFPLFNBQVMsV0FBVztBQUM3Qix5QkFBTyxPQUFPO0FBQUEsZ0JBQ2hCO0FBQUEsY0FDRjtBQUFBLFlBQ0Y7QUFBQSxVQUNGO0FBQUEsUUFDRjtBQUFBLE1BQ0Y7QUFBQSxJQUNGO0FBQUE7QUFBQSxJQUVBLGNBQWM7QUFBQSxNQUNaLFNBQVM7QUFBQSxRQUNQO0FBQUEsUUFDQTtBQUFBLFFBQ0E7QUFBQSxRQUNBO0FBQUEsUUFDQTtBQUFBLFFBQ0E7QUFBQSxRQUNBO0FBQUEsUUFDQTtBQUFBLFFBQ0E7QUFBQSxRQUNBO0FBQUEsTUFDRjtBQUFBLElBQ0Y7QUFBQSxFQUNGO0FBQ0YsQ0FBQzsiLAogICJuYW1lcyI6IFsicGF0aCIsICJFbGVtZW50UGx1c1Jlc29sdmVyIiwgIkljb25zUmVzb2x2ZXIiLCAiX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUiLCAicGF0aCIsICJFbGVtZW50UGx1c1Jlc29sdmVyIiwgIkljb25zUmVzb2x2ZXIiLCAiX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUiLCAiX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUiLCAicGF0aCIsICJfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSIsICJwYXRoIiwgIl9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lIiwgInBhdGgiLCAiX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUiXQp9Cg== diff --git a/vite.config.ts.timestamp-1781167684579-99ce88fe775e.mjs b/vite.config.ts.timestamp-1781167684579-99ce88fe775e.mjs new file mode 100644 index 0000000..a41ee44 --- /dev/null +++ b/vite.config.ts.timestamp-1781167684579-99ce88fe775e.mjs @@ -0,0 +1,207 @@ +// vite.config.ts +import { loadEnv, defineConfig } from "file:///D:/vueWork/erpWeb/node_modules/vite/dist/node/index.js"; + +// vite/plugins/index.ts +import vue from "file:///D:/vueWork/erpWeb/node_modules/@vitejs/plugin-vue/dist/index.mjs"; + +// vite/plugins/unocss.ts +import UnoCss from "file:///D:/vueWork/erpWeb/node_modules/unocss/dist/vite.mjs"; +var unocss_default = () => { + return UnoCss({ + hmrTopLevelAwait: false + // unocss默认是true,低版本浏览器是不支持的,启动后会报错 + }); +}; + +// vite/plugins/auto-import.ts +import AutoImport from "file:///D:/vueWork/erpWeb/node_modules/unplugin-auto-import/dist/vite.js"; +import { ElementPlusResolver } from "file:///D:/vueWork/erpWeb/node_modules/unplugin-vue-components/dist/resolvers.js"; +import IconsResolver from "file:///D:/vueWork/erpWeb/node_modules/unplugin-icons/dist/resolver.js"; +var __vite_injected_original_dirname = "D:\\vueWork\\erpWeb\\vite\\plugins"; +var auto_import_default = (path3) => { + return AutoImport({ + // 自动导入 Vue 相关函数 + imports: ["vue", "vue-router", "@vueuse/core", "pinia"], + eslintrc: { + enabled: false, + filepath: "./.eslintrc-auto-import.json", + globalsPropValue: true + }, + resolvers: [ + // 自动导入 Element Plus 相关函数ElMessage, ElMessageBox... (带样式) + ElementPlusResolver(), + IconsResolver({ + prefix: "Icon" + }) + ], + vueTemplate: true, + // 是否在 vue 模板中自动导入 + dts: path3.resolve(path3.resolve(__vite_injected_original_dirname, "../../src"), "types", "auto-imports.d.ts") + }); +}; + +// vite/plugins/components.ts +import Components from "file:///D:/vueWork/erpWeb/node_modules/unplugin-vue-components/dist/vite.js"; +import { ElementPlusResolver as ElementPlusResolver2 } from "file:///D:/vueWork/erpWeb/node_modules/unplugin-vue-components/dist/resolvers.js"; +import IconsResolver2 from "file:///D:/vueWork/erpWeb/node_modules/unplugin-icons/dist/resolver.js"; +var __vite_injected_original_dirname2 = "D:\\vueWork\\erpWeb\\vite\\plugins"; +var components_default = (path3) => { + return Components({ + resolvers: [ + // 自动导入 Element Plus 组件 + ElementPlusResolver2(), + // 自动注册图标组件 + IconsResolver2({ + enabledCollections: ["ep"] + }) + ], + dts: path3.resolve(path3.resolve(__vite_injected_original_dirname2, "../../src"), "types", "components.d.ts") + }); +}; + +// vite/plugins/icons.ts +import Icons from "file:///D:/vueWork/erpWeb/node_modules/unplugin-icons/dist/vite.js"; +var icons_default = () => { + return Icons({ + // 自动安装图标库 + autoInstall: true + }); +}; + +// vite/plugins/svg-icon.ts +import { createSvgIconsPlugin } from "file:///D:/vueWork/erpWeb/node_modules/vite-plugin-svg-icons/dist/index.mjs"; +var __vite_injected_original_dirname3 = "D:\\vueWork\\erpWeb\\vite\\plugins"; +var svg_icon_default = (path3, isBuild) => { + return createSvgIconsPlugin({ + // 指定需要缓存的图标文件夹 + iconDirs: [path3.resolve(path3.resolve(__vite_injected_original_dirname3, "../../src"), "assets/icons/svg")], + // 指定symbolId格式 + symbolId: "icon-[dir]-[name]", + svgoOptions: isBuild + }); +}; + +// vite/plugins/compression.ts +import compression from "file:///D:/vueWork/erpWeb/node_modules/vite-plugin-compression/dist/index.mjs"; +var compression_default = (env) => { + const { VITE_BUILD_COMPRESS } = env; + const plugin = []; + if (VITE_BUILD_COMPRESS) { + const compressList = VITE_BUILD_COMPRESS.split(","); + if (compressList.includes("gzip")) { + plugin.push( + compression({ + ext: ".gz", + deleteOriginFile: false + }) + ); + } + if (compressList.includes("brotli")) { + plugin.push( + compression({ + ext: ".br", + algorithm: "brotliCompress", + deleteOriginFile: false + }) + ); + } + } + return plugin; +}; + +// vite/plugins/setup-extend.ts +import setupExtend from "file:///D:/vueWork/erpWeb/node_modules/unplugin-vue-setup-extend-plus/dist/vite.js"; +var setup_extend_default = () => { + return setupExtend({}); +}; + +// vite/plugins/index.ts +import path from "path"; +var plugins_default = (viteEnv, isBuild = false) => { + const vitePlugins = []; + vitePlugins.push(vue()); + vitePlugins.push(unocss_default()); + vitePlugins.push(auto_import_default(path)); + vitePlugins.push(components_default(path)); + vitePlugins.push(compression_default(viteEnv)); + vitePlugins.push(icons_default()); + vitePlugins.push(svg_icon_default(path, isBuild)); + vitePlugins.push(setup_extend_default()); + return vitePlugins; +}; + +// vite.config.ts +import path2 from "path"; +var __vite_injected_original_dirname4 = "D:\\vueWork\\erpWeb"; +var vite_config_default = defineConfig(({ mode, command }) => { + const env = loadEnv(mode, process.cwd()); + return { + // 部署生产环境和开发环境下的URL。 + // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上 + // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 + base: env.VITE_APP_CONTEXT_PATH, + resolve: { + alias: { + "~": path2.resolve(__vite_injected_original_dirname4, "./"), + "@": path2.resolve(__vite_injected_original_dirname4, "./src") + }, + extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"] + }, + // https://cn.vitejs.dev/config/#resolve-extensions + plugins: plugins_default(env, command === "build"), + server: { + host: "0.0.0.0", + port: Number(env.VITE_APP_PORT), + open: true, + proxy: { + [env.VITE_APP_BASE_API]: { + //target: 'https://test.api.buzhiyushu.cn', + target: "http://localhost:8080", + changeOrigin: true, + ws: true, + rewrite: (path3) => path3.replace(new RegExp("^" + env.VITE_APP_BASE_API), "") + } + } + }, + css: { + preprocessorOptions: { + scss: { + javascriptEnabled: true + } + }, + postcss: { + plugins: [ + { + postcssPlugin: "internal:charset-removal", + AtRule: { + charset: (atRule) => { + if (atRule.name === "charset") { + atRule.remove(); + } + } + } + } + ] + } + }, + // 预编译 + optimizeDeps: { + include: [ + "vue", + "vue-router", + "pinia", + "axios", + "@vueuse/core", + "echarts", + "vue-i18n", + "@vueup/vue-quill", + "image-conversion", + "element-plus/es/components/**/css" + ] + } + }; +}); +export { + vite_config_default as default +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiLCAidml0ZS9wbHVnaW5zL2luZGV4LnRzIiwgInZpdGUvcGx1Z2lucy91bm9jc3MudHMiLCAidml0ZS9wbHVnaW5zL2F1dG8taW1wb3J0LnRzIiwgInZpdGUvcGx1Z2lucy9jb21wb25lbnRzLnRzIiwgInZpdGUvcGx1Z2lucy9pY29ucy50cyIsICJ2aXRlL3BsdWdpbnMvc3ZnLWljb24udHMiLCAidml0ZS9wbHVnaW5zL2NvbXByZXNzaW9uLnRzIiwgInZpdGUvcGx1Z2lucy9zZXR1cC1leHRlbmQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJEOlxcXFx2dWVXb3JrXFxcXGVycFdlYlwiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZS5jb25maWcudHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0Q6L3Z1ZVdvcmsvZXJwV2ViL3ZpdGUuY29uZmlnLnRzXCI7aW1wb3J0IHsgVXNlckNvbmZpZywgQ29uZmlnRW52LCBsb2FkRW52LCBkZWZpbmVDb25maWcgfSBmcm9tICd2aXRlJztcclxuXHJcbmltcG9ydCBjcmVhdGVQbHVnaW5zIGZyb20gJy4vdml0ZS9wbHVnaW5zJztcclxuXHJcbmltcG9ydCBwYXRoIGZyb20gJ3BhdGgnO1xyXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoKHsgbW9kZSwgY29tbWFuZCB9OiBDb25maWdFbnYpOiBVc2VyQ29uZmlnID0+IHtcclxuICBjb25zdCBlbnYgPSBsb2FkRW52KG1vZGUsIHByb2Nlc3MuY3dkKCkpO1xyXG4gIHJldHVybiB7XHJcbiAgICAvLyBcdTkwRThcdTdGNzJcdTc1MUZcdTRFQTdcdTczQUZcdTU4ODNcdTU0OENcdTVGMDBcdTUzRDFcdTczQUZcdTU4ODNcdTRFMEJcdTc2ODRVUkxcdTMwMDJcclxuICAgIC8vIFx1OUVEOFx1OEJBNFx1NjBDNVx1NTFCNVx1NEUwQlx1RkYwQ3ZpdGUgXHU0RjFBXHU1MDQ3XHU4QkJFXHU0RjYwXHU3Njg0XHU1RTk0XHU3NTI4XHU2NjJGXHU4OEFCXHU5MEU4XHU3RjcyXHU1NzI4XHU0RTAwXHU0RTJBXHU1N0RGXHU1NDBEXHU3Njg0XHU2ODM5XHU4REVGXHU1Rjg0XHU0RTBBXHJcbiAgICAvLyBcdTRGOEJcdTU5ODIgaHR0cHM6Ly93d3cucnVveWkudmlwL1x1MzAwMlx1NTk4Mlx1Njc5Q1x1NUU5NFx1NzUyOFx1ODhBQlx1OTBFOFx1N0Y3Mlx1NTcyOFx1NEUwMFx1NEUyQVx1NUI1MFx1OERFRlx1NUY4NFx1NEUwQVx1RkYwQ1x1NEY2MFx1NUMzMVx1OTcwMFx1ODk4MVx1NzUyOFx1OEZEOVx1NEUyQVx1OTAwOVx1OTg3OVx1NjMwN1x1NUI5QVx1OEZEOVx1NEUyQVx1NUI1MFx1OERFRlx1NUY4NFx1MzAwMlx1NEY4Qlx1NTk4Mlx1RkYwQ1x1NTk4Mlx1Njc5Q1x1NEY2MFx1NzY4NFx1NUU5NFx1NzUyOFx1ODhBQlx1OTBFOFx1N0Y3Mlx1NTcyOCBodHRwczovL3d3dy5ydW95aS52aXAvYWRtaW4vXHVGRjBDXHU1MjE5XHU4QkJFXHU3RjZFIGJhc2VVcmwgXHU0RTNBIC9hZG1pbi9cdTMwMDJcclxuICAgIGJhc2U6IGVudi5WSVRFX0FQUF9DT05URVhUX1BBVEgsXHJcbiAgICByZXNvbHZlOiB7XHJcbiAgICAgIGFsaWFzOiB7XHJcbiAgICAgICAgJ34nOiBwYXRoLnJlc29sdmUoX19kaXJuYW1lLCAnLi8nKSxcclxuICAgICAgICAnQCc6IHBhdGgucmVzb2x2ZShfX2Rpcm5hbWUsICcuL3NyYycpXHJcbiAgICAgIH0sXHJcbiAgICAgIGV4dGVuc2lvbnM6IFsnLm1qcycsICcuanMnLCAnLnRzJywgJy5qc3gnLCAnLnRzeCcsICcuanNvbicsICcudnVlJ11cclxuICAgIH0sXHJcbiAgICAvLyBodHRwczovL2NuLnZpdGVqcy5kZXYvY29uZmlnLyNyZXNvbHZlLWV4dGVuc2lvbnNcclxuICAgIHBsdWdpbnM6IGNyZWF0ZVBsdWdpbnMoZW52LCBjb21tYW5kID09PSAnYnVpbGQnKSxcclxuICAgIHNlcnZlcjoge1xyXG4gICAgICBob3N0OiAnMC4wLjAuMCcsXHJcbiAgICAgIHBvcnQ6IE51bWJlcihlbnYuVklURV9BUFBfUE9SVCksXHJcbiAgICAgIG9wZW46IHRydWUsXHJcbiAgICAgIHByb3h5OiB7XHJcbiAgICAgICAgW2Vudi5WSVRFX0FQUF9CQVNFX0FQSV06IHtcclxuICAgICAgICAgIC8vdGFyZ2V0OiAnaHR0cHM6Ly90ZXN0LmFwaS5idXpoaXl1c2h1LmNuJyxcclxuICAgICAgICAgIHRhcmdldDogJ2h0dHA6Ly9sb2NhbGhvc3Q6ODA4MCcsXHJcbiAgICAgICAgICBjaGFuZ2VPcmlnaW46IHRydWUsXHJcbiAgICAgICAgICB3czogdHJ1ZSxcclxuICAgICAgICAgIHJld3JpdGU6IChwYXRoKSA9PiBwYXRoLnJlcGxhY2UobmV3IFJlZ0V4cCgnXicgKyBlbnYuVklURV9BUFBfQkFTRV9BUEkpLCAnJylcclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH0sXHJcbiAgICBjc3M6IHtcclxuICAgICAgcHJlcHJvY2Vzc29yT3B0aW9uczoge1xyXG4gICAgICAgIHNjc3M6IHtcclxuICAgICAgICAgIGphdmFzY3JpcHRFbmFibGVkOiB0cnVlXHJcbiAgICAgICAgfVxyXG4gICAgICB9LFxyXG4gICAgICBwb3N0Y3NzOiB7XHJcbiAgICAgICAgcGx1Z2luczogW1xyXG4gICAgICAgICAge1xyXG4gICAgICAgICAgICBwb3N0Y3NzUGx1Z2luOiAnaW50ZXJuYWw6Y2hhcnNldC1yZW1vdmFsJyxcclxuICAgICAgICAgICAgQXRSdWxlOiB7XHJcbiAgICAgICAgICAgICAgY2hhcnNldDogKGF0UnVsZSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKGF0UnVsZS5uYW1lID09PSAnY2hhcnNldCcpIHtcclxuICAgICAgICAgICAgICAgICAgYXRSdWxlLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgIF1cclxuICAgICAgfVxyXG4gICAgfSxcclxuICAgIC8vIFx1OTg4NFx1N0YxNlx1OEJEMVxyXG4gICAgb3B0aW1pemVEZXBzOiB7XHJcbiAgICAgIGluY2x1ZGU6IFtcclxuICAgICAgICAndnVlJyxcclxuICAgICAgICAndnVlLXJvdXRlcicsXHJcbiAgICAgICAgJ3BpbmlhJyxcclxuICAgICAgICAnYXhpb3MnLFxyXG4gICAgICAgICdAdnVldXNlL2NvcmUnLFxyXG4gICAgICAgICdlY2hhcnRzJyxcclxuICAgICAgICAndnVlLWkxOG4nLFxyXG4gICAgICAgICdAdnVldXAvdnVlLXF1aWxsJyxcclxuICAgICAgICAnaW1hZ2UtY29udmVyc2lvbicsXHJcbiAgICAgICAgJ2VsZW1lbnQtcGx1cy9lcy9jb21wb25lbnRzLyoqL2NzcydcclxuICAgICAgXVxyXG4gICAgfVxyXG4gIH07XHJcbn0pO1xyXG4iLCAiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXFxcXGluZGV4LnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9EOi92dWVXb3JrL2VycFdlYi92aXRlL3BsdWdpbnMvaW5kZXgudHNcIjtpbXBvcnQgdnVlIGZyb20gJ0B2aXRlanMvcGx1Z2luLXZ1ZSc7XHJcbmltcG9ydCBjcmVhdGVVbm9Dc3MgZnJvbSAnLi91bm9jc3MnO1xyXG5pbXBvcnQgY3JlYXRlQXV0b0ltcG9ydCBmcm9tICcuL2F1dG8taW1wb3J0JztcclxuaW1wb3J0IGNyZWF0ZUNvbXBvbmVudHMgZnJvbSAnLi9jb21wb25lbnRzJztcclxuaW1wb3J0IGNyZWF0ZUljb25zIGZyb20gJy4vaWNvbnMnO1xyXG5pbXBvcnQgY3JlYXRlU3ZnSWNvbnNQbHVnaW4gZnJvbSAnLi9zdmctaWNvbic7XHJcbmltcG9ydCBjcmVhdGVDb21wcmVzc2lvbiBmcm9tICcuL2NvbXByZXNzaW9uJztcclxuaW1wb3J0IGNyZWF0ZVNldHVwRXh0ZW5kIGZyb20gJy4vc2V0dXAtZXh0ZW5kJztcclxuaW1wb3J0IHBhdGggZnJvbSAncGF0aCc7XHJcblxyXG5leHBvcnQgZGVmYXVsdCAodml0ZUVudjogYW55LCBpc0J1aWxkID0gZmFsc2UpOiBbXSA9PiB7XHJcbiAgY29uc3Qgdml0ZVBsdWdpbnM6IGFueSA9IFtdO1xyXG4gIHZpdGVQbHVnaW5zLnB1c2godnVlKCkpO1xyXG4gIHZpdGVQbHVnaW5zLnB1c2goY3JlYXRlVW5vQ3NzKCkpO1xyXG4gIHZpdGVQbHVnaW5zLnB1c2goY3JlYXRlQXV0b0ltcG9ydChwYXRoKSk7XHJcbiAgdml0ZVBsdWdpbnMucHVzaChjcmVhdGVDb21wb25lbnRzKHBhdGgpKTtcclxuICB2aXRlUGx1Z2lucy5wdXNoKGNyZWF0ZUNvbXByZXNzaW9uKHZpdGVFbnYpKTtcclxuICB2aXRlUGx1Z2lucy5wdXNoKGNyZWF0ZUljb25zKCkpO1xyXG4gIHZpdGVQbHVnaW5zLnB1c2goY3JlYXRlU3ZnSWNvbnNQbHVnaW4ocGF0aCwgaXNCdWlsZCkpO1xyXG4gIHZpdGVQbHVnaW5zLnB1c2goY3JlYXRlU2V0dXBFeHRlbmQoKSk7XHJcbiAgcmV0dXJuIHZpdGVQbHVnaW5zO1xyXG59O1xyXG4iLCAiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXFxcXHVub2Nzcy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vRDovdnVlV29yay9lcnBXZWIvdml0ZS9wbHVnaW5zL3Vub2Nzcy50c1wiO2ltcG9ydCBVbm9Dc3MgZnJvbSAndW5vY3NzL3ZpdGUnO1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgKCkgPT4ge1xyXG4gIHJldHVybiBVbm9Dc3Moe1xyXG4gICAgaG1yVG9wTGV2ZWxBd2FpdDogZmFsc2UgLy8gdW5vY3NzXHU5RUQ4XHU4QkE0XHU2NjJGdHJ1ZVx1RkYwQ1x1NEY0RVx1NzI0OFx1NjcyQ1x1NkQ0Rlx1ODlDOFx1NTY2OFx1NjYyRlx1NEUwRFx1NjUyRlx1NjMwMVx1NzY4NFx1RkYwQ1x1NTQyRlx1NTJBOFx1NTQwRVx1NEYxQVx1NjJBNVx1OTUxOVxyXG4gIH0pO1xyXG59O1xyXG4iLCAiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXFxcXGF1dG8taW1wb3J0LnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9EOi92dWVXb3JrL2VycFdlYi92aXRlL3BsdWdpbnMvYXV0by1pbXBvcnQudHNcIjtpbXBvcnQgQXV0b0ltcG9ydCBmcm9tICd1bnBsdWdpbi1hdXRvLWltcG9ydC92aXRlJztcclxuaW1wb3J0IHsgRWxlbWVudFBsdXNSZXNvbHZlciB9IGZyb20gJ3VucGx1Z2luLXZ1ZS1jb21wb25lbnRzL3Jlc29sdmVycyc7XHJcbmltcG9ydCBJY29uc1Jlc29sdmVyIGZyb20gJ3VucGx1Z2luLWljb25zL3Jlc29sdmVyJztcclxuXHJcbmV4cG9ydCBkZWZhdWx0IChwYXRoOiBhbnkpID0+IHtcclxuICByZXR1cm4gQXV0b0ltcG9ydCh7XHJcbiAgICAvLyBcdTgxRUFcdTUyQThcdTVCRkNcdTUxNjUgVnVlIFx1NzZGOFx1NTE3M1x1NTFGRFx1NjU3MFxyXG4gICAgaW1wb3J0czogWyd2dWUnLCAndnVlLXJvdXRlcicsICdAdnVldXNlL2NvcmUnLCAncGluaWEnXSxcclxuICAgIGVzbGludHJjOiB7XHJcbiAgICAgIGVuYWJsZWQ6IGZhbHNlLFxyXG4gICAgICBmaWxlcGF0aDogJy4vLmVzbGludHJjLWF1dG8taW1wb3J0Lmpzb24nLFxyXG4gICAgICBnbG9iYWxzUHJvcFZhbHVlOiB0cnVlXHJcbiAgICB9LFxyXG4gICAgcmVzb2x2ZXJzOiBbXHJcbiAgICAgIC8vIFx1ODFFQVx1NTJBOFx1NUJGQ1x1NTE2NSBFbGVtZW50IFBsdXMgXHU3NkY4XHU1MTczXHU1MUZEXHU2NTcwRWxNZXNzYWdlLCBFbE1lc3NhZ2VCb3guLi4gKFx1NUUyNlx1NjgzN1x1NUYwRilcclxuICAgICAgRWxlbWVudFBsdXNSZXNvbHZlcigpLFxyXG4gICAgICBJY29uc1Jlc29sdmVyKHtcclxuICAgICAgICBwcmVmaXg6ICdJY29uJ1xyXG4gICAgICB9KVxyXG4gICAgXSxcclxuICAgIHZ1ZVRlbXBsYXRlOiB0cnVlLCAvLyBcdTY2MkZcdTU0MjZcdTU3MjggdnVlIFx1NkEyMVx1Njc3Rlx1NEUyRFx1ODFFQVx1NTJBOFx1NUJGQ1x1NTE2NVxyXG4gICAgZHRzOiBwYXRoLnJlc29sdmUocGF0aC5yZXNvbHZlKF9fZGlybmFtZSwgJy4uLy4uL3NyYycpLCAndHlwZXMnLCAnYXV0by1pbXBvcnRzLmQudHMnKVxyXG4gIH0pO1xyXG59O1xyXG4iLCAiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXFxcXGNvbXBvbmVudHMudHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0Q6L3Z1ZVdvcmsvZXJwV2ViL3ZpdGUvcGx1Z2lucy9jb21wb25lbnRzLnRzXCI7aW1wb3J0IENvbXBvbmVudHMgZnJvbSAndW5wbHVnaW4tdnVlLWNvbXBvbmVudHMvdml0ZSc7XHJcbmltcG9ydCB7IEVsZW1lbnRQbHVzUmVzb2x2ZXIgfSBmcm9tICd1bnBsdWdpbi12dWUtY29tcG9uZW50cy9yZXNvbHZlcnMnO1xyXG5pbXBvcnQgSWNvbnNSZXNvbHZlciBmcm9tICd1bnBsdWdpbi1pY29ucy9yZXNvbHZlcic7XHJcblxyXG5leHBvcnQgZGVmYXVsdCAocGF0aDogYW55KSA9PiB7XHJcbiAgcmV0dXJuIENvbXBvbmVudHMoe1xyXG4gICAgcmVzb2x2ZXJzOiBbXHJcbiAgICAgIC8vIFx1ODFFQVx1NTJBOFx1NUJGQ1x1NTE2NSBFbGVtZW50IFBsdXMgXHU3RUM0XHU0RUY2XHJcbiAgICAgIEVsZW1lbnRQbHVzUmVzb2x2ZXIoKSxcclxuICAgICAgLy8gXHU4MUVBXHU1MkE4XHU2Q0U4XHU1MThDXHU1NkZFXHU2ODA3XHU3RUM0XHU0RUY2XHJcbiAgICAgIEljb25zUmVzb2x2ZXIoe1xyXG4gICAgICAgIGVuYWJsZWRDb2xsZWN0aW9uczogWydlcCddXHJcbiAgICAgIH0pXHJcbiAgICBdLFxyXG4gICAgZHRzOiBwYXRoLnJlc29sdmUocGF0aC5yZXNvbHZlKF9fZGlybmFtZSwgJy4uLy4uL3NyYycpLCAndHlwZXMnLCAnY29tcG9uZW50cy5kLnRzJylcclxuICB9KTtcclxufTtcclxuIiwgImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJEOlxcXFx2dWVXb3JrXFxcXGVycFdlYlxcXFx2aXRlXFxcXHBsdWdpbnNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1xcXFxpY29ucy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vRDovdnVlV29yay9lcnBXZWIvdml0ZS9wbHVnaW5zL2ljb25zLnRzXCI7aW1wb3J0IEljb25zIGZyb20gJ3VucGx1Z2luLWljb25zL3ZpdGUnO1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgKCkgPT4ge1xyXG4gIHJldHVybiBJY29ucyh7XHJcbiAgICAvLyBcdTgxRUFcdTUyQThcdTVCODlcdTg4QzVcdTU2RkVcdTY4MDdcdTVFOTNcclxuICAgIGF1dG9JbnN0YWxsOiB0cnVlXHJcbiAgfSk7XHJcbn07XHJcbiIsICJjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCJEOlxcXFx2dWVXb3JrXFxcXGVycFdlYlxcXFx2aXRlXFxcXHBsdWdpbnNcXFxcc3ZnLWljb24udHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0Q6L3Z1ZVdvcmsvZXJwV2ViL3ZpdGUvcGx1Z2lucy9zdmctaWNvbi50c1wiO2ltcG9ydCB7IGNyZWF0ZVN2Z0ljb25zUGx1Z2luIH0gZnJvbSAndml0ZS1wbHVnaW4tc3ZnLWljb25zJztcclxuZXhwb3J0IGRlZmF1bHQgKHBhdGg6IGFueSwgaXNCdWlsZDogYm9vbGVhbikgPT4ge1xyXG4gIHJldHVybiBjcmVhdGVTdmdJY29uc1BsdWdpbih7XHJcbiAgICAvLyBcdTYzMDdcdTVCOUFcdTk3MDBcdTg5ODFcdTdGMTNcdTVCNThcdTc2ODRcdTU2RkVcdTY4MDdcdTY1ODdcdTRFRjZcdTU5MzlcclxuICAgIGljb25EaXJzOiBbcGF0aC5yZXNvbHZlKHBhdGgucmVzb2x2ZShfX2Rpcm5hbWUsICcuLi8uLi9zcmMnKSwgJ2Fzc2V0cy9pY29ucy9zdmcnKV0sXHJcbiAgICAvLyBcdTYzMDdcdTVCOUFzeW1ib2xJZFx1NjgzQ1x1NUYwRlxyXG4gICAgc3ltYm9sSWQ6ICdpY29uLVtkaXJdLVtuYW1lXScsXHJcbiAgICBzdmdvT3B0aW9uczogaXNCdWlsZFxyXG4gIH0pO1xyXG59O1xyXG4iLCAiY29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUgPSBcIkQ6XFxcXHZ1ZVdvcmtcXFxcZXJwV2ViXFxcXHZpdGVcXFxccGx1Z2luc1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXFxcXGNvbXByZXNzaW9uLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9EOi92dWVXb3JrL2VycFdlYi92aXRlL3BsdWdpbnMvY29tcHJlc3Npb24udHNcIjtpbXBvcnQgY29tcHJlc3Npb24gZnJvbSAndml0ZS1wbHVnaW4tY29tcHJlc3Npb24nO1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgKGVudjogYW55KSA9PiB7XHJcbiAgY29uc3QgeyBWSVRFX0JVSUxEX0NPTVBSRVNTIH0gPSBlbnY7XHJcbiAgY29uc3QgcGx1Z2luOiBhbnlbXSA9IFtdO1xyXG4gIGlmIChWSVRFX0JVSUxEX0NPTVBSRVNTKSB7XHJcbiAgICBjb25zdCBjb21wcmVzc0xpc3QgPSBWSVRFX0JVSUxEX0NPTVBSRVNTLnNwbGl0KCcsJyk7XHJcbiAgICBpZiAoY29tcHJlc3NMaXN0LmluY2x1ZGVzKCdnemlwJykpIHtcclxuICAgICAgLy8gaHR0cDovL2RvYy5ydW95aS52aXAvcnVveWktdnVlL290aGVyL2ZhcS5odG1sI1x1NEY3Rlx1NzUyOGd6aXBcdTg5RTNcdTUzOEJcdTdGMjlcdTk3NTlcdTYwMDFcdTY1ODdcdTRFRjZcclxuICAgICAgcGx1Z2luLnB1c2goXHJcbiAgICAgICAgY29tcHJlc3Npb24oe1xyXG4gICAgICAgICAgZXh0OiAnLmd6JyxcclxuICAgICAgICAgIGRlbGV0ZU9yaWdpbkZpbGU6IGZhbHNlXHJcbiAgICAgICAgfSlcclxuICAgICAgKTtcclxuICAgIH1cclxuICAgIGlmIChjb21wcmVzc0xpc3QuaW5jbHVkZXMoJ2Jyb3RsaScpKSB7XHJcbiAgICAgIHBsdWdpbi5wdXNoKFxyXG4gICAgICAgIGNvbXByZXNzaW9uKHtcclxuICAgICAgICAgIGV4dDogJy5icicsXHJcbiAgICAgICAgICBhbGdvcml0aG06ICdicm90bGlDb21wcmVzcycsXHJcbiAgICAgICAgICBkZWxldGVPcmlnaW5GaWxlOiBmYWxzZVxyXG4gICAgICAgIH0pXHJcbiAgICAgICk7XHJcbiAgICB9XHJcbiAgfVxyXG4gIHJldHVybiBwbHVnaW47XHJcbn07XHJcbiIsICJjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSA9IFwiRDpcXFxcdnVlV29ya1xcXFxlcnBXZWJcXFxcdml0ZVxcXFxwbHVnaW5zXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCJEOlxcXFx2dWVXb3JrXFxcXGVycFdlYlxcXFx2aXRlXFxcXHBsdWdpbnNcXFxcc2V0dXAtZXh0ZW5kLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9EOi92dWVXb3JrL2VycFdlYi92aXRlL3BsdWdpbnMvc2V0dXAtZXh0ZW5kLnRzXCI7aW1wb3J0IHNldHVwRXh0ZW5kIGZyb20gJ3VucGx1Z2luLXZ1ZS1zZXR1cC1leHRlbmQtcGx1cy92aXRlJztcclxuXHJcbmV4cG9ydCBkZWZhdWx0ICgpID0+IHtcclxuICByZXR1cm4gc2V0dXBFeHRlbmQoe30pO1xyXG59O1xyXG4iXSwKICAibWFwcGluZ3MiOiAiO0FBQTJPLFNBQWdDLFNBQVMsb0JBQW9COzs7QUNBOUIsT0FBTyxTQUFTOzs7QUNBZCxPQUFPLFlBQVk7QUFFL1IsSUFBTyxpQkFBUSxNQUFNO0FBQ25CLFNBQU8sT0FBTztBQUFBLElBQ1osa0JBQWtCO0FBQUE7QUFBQSxFQUNwQixDQUFDO0FBQ0g7OztBQ05zUixPQUFPLGdCQUFnQjtBQUM3UyxTQUFTLDJCQUEyQjtBQUNwQyxPQUFPLG1CQUFtQjtBQUYxQixJQUFNLG1DQUFtQztBQUl6QyxJQUFPLHNCQUFRLENBQUNBLFVBQWM7QUFDNUIsU0FBTyxXQUFXO0FBQUE7QUFBQSxJQUVoQixTQUFTLENBQUMsT0FBTyxjQUFjLGdCQUFnQixPQUFPO0FBQUEsSUFDdEQsVUFBVTtBQUFBLE1BQ1IsU0FBUztBQUFBLE1BQ1QsVUFBVTtBQUFBLE1BQ1Ysa0JBQWtCO0FBQUEsSUFDcEI7QUFBQSxJQUNBLFdBQVc7QUFBQTtBQUFBLE1BRVQsb0JBQW9CO0FBQUEsTUFDcEIsY0FBYztBQUFBLFFBQ1osUUFBUTtBQUFBLE1BQ1YsQ0FBQztBQUFBLElBQ0g7QUFBQSxJQUNBLGFBQWE7QUFBQTtBQUFBLElBQ2IsS0FBS0EsTUFBSyxRQUFRQSxNQUFLLFFBQVEsa0NBQVcsV0FBVyxHQUFHLFNBQVMsbUJBQW1CO0FBQUEsRUFDdEYsQ0FBQztBQUNIOzs7QUN2Qm9SLE9BQU8sZ0JBQWdCO0FBQzNTLFNBQVMsdUJBQUFDLDRCQUEyQjtBQUNwQyxPQUFPQyxvQkFBbUI7QUFGMUIsSUFBTUMsb0NBQW1DO0FBSXpDLElBQU8scUJBQVEsQ0FBQ0MsVUFBYztBQUM1QixTQUFPLFdBQVc7QUFBQSxJQUNoQixXQUFXO0FBQUE7QUFBQSxNQUVUQyxxQkFBb0I7QUFBQTtBQUFBLE1BRXBCQyxlQUFjO0FBQUEsUUFDWixvQkFBb0IsQ0FBQyxJQUFJO0FBQUEsTUFDM0IsQ0FBQztBQUFBLElBQ0g7QUFBQSxJQUNBLEtBQUtGLE1BQUssUUFBUUEsTUFBSyxRQUFRRyxtQ0FBVyxXQUFXLEdBQUcsU0FBUyxpQkFBaUI7QUFBQSxFQUNwRixDQUFDO0FBQ0g7OztBQ2hCMFEsT0FBTyxXQUFXO0FBRTVSLElBQU8sZ0JBQVEsTUFBTTtBQUNuQixTQUFPLE1BQU07QUFBQTtBQUFBLElBRVgsYUFBYTtBQUFBLEVBQ2YsQ0FBQztBQUNIOzs7QUNQZ1IsU0FBUyw0QkFBNEI7QUFBclQsSUFBTUMsb0NBQW1DO0FBQ3pDLElBQU8sbUJBQVEsQ0FBQ0MsT0FBVyxZQUFxQjtBQUM5QyxTQUFPLHFCQUFxQjtBQUFBO0FBQUEsSUFFMUIsVUFBVSxDQUFDQSxNQUFLLFFBQVFBLE1BQUssUUFBUUMsbUNBQVcsV0FBVyxHQUFHLGtCQUFrQixDQUFDO0FBQUE7QUFBQSxJQUVqRixVQUFVO0FBQUEsSUFDVixhQUFhO0FBQUEsRUFDZixDQUFDO0FBQ0g7OztBQ1RzUixPQUFPLGlCQUFpQjtBQUU5UyxJQUFPLHNCQUFRLENBQUMsUUFBYTtBQUMzQixRQUFNLEVBQUUsb0JBQW9CLElBQUk7QUFDaEMsUUFBTSxTQUFnQixDQUFDO0FBQ3ZCLE1BQUkscUJBQXFCO0FBQ3ZCLFVBQU0sZUFBZSxvQkFBb0IsTUFBTSxHQUFHO0FBQ2xELFFBQUksYUFBYSxTQUFTLE1BQU0sR0FBRztBQUVqQyxhQUFPO0FBQUEsUUFDTCxZQUFZO0FBQUEsVUFDVixLQUFLO0FBQUEsVUFDTCxrQkFBa0I7QUFBQSxRQUNwQixDQUFDO0FBQUEsTUFDSDtBQUFBLElBQ0Y7QUFDQSxRQUFJLGFBQWEsU0FBUyxRQUFRLEdBQUc7QUFDbkMsYUFBTztBQUFBLFFBQ0wsWUFBWTtBQUFBLFVBQ1YsS0FBSztBQUFBLFVBQ0wsV0FBVztBQUFBLFVBQ1gsa0JBQWtCO0FBQUEsUUFDcEIsQ0FBQztBQUFBLE1BQ0g7QUFBQSxJQUNGO0FBQUEsRUFDRjtBQUNBLFNBQU87QUFDVDs7O0FDM0J3UixPQUFPLGlCQUFpQjtBQUVoVCxJQUFPLHVCQUFRLE1BQU07QUFDbkIsU0FBTyxZQUFZLENBQUMsQ0FBQztBQUN2Qjs7O0FQSUEsT0FBTyxVQUFVO0FBRWpCLElBQU8sa0JBQVEsQ0FBQyxTQUFjLFVBQVUsVUFBYztBQUNwRCxRQUFNLGNBQW1CLENBQUM7QUFDMUIsY0FBWSxLQUFLLElBQUksQ0FBQztBQUN0QixjQUFZLEtBQUssZUFBYSxDQUFDO0FBQy9CLGNBQVksS0FBSyxvQkFBaUIsSUFBSSxDQUFDO0FBQ3ZDLGNBQVksS0FBSyxtQkFBaUIsSUFBSSxDQUFDO0FBQ3ZDLGNBQVksS0FBSyxvQkFBa0IsT0FBTyxDQUFDO0FBQzNDLGNBQVksS0FBSyxjQUFZLENBQUM7QUFDOUIsY0FBWSxLQUFLLGlCQUFxQixNQUFNLE9BQU8sQ0FBQztBQUNwRCxjQUFZLEtBQUsscUJBQWtCLENBQUM7QUFDcEMsU0FBTztBQUNUOzs7QURqQkEsT0FBT0MsV0FBVTtBQUpqQixJQUFNQyxvQ0FBbUM7QUFLekMsSUFBTyxzQkFBUSxhQUFhLENBQUMsRUFBRSxNQUFNLFFBQVEsTUFBNkI7QUFDeEUsUUFBTSxNQUFNLFFBQVEsTUFBTSxRQUFRLElBQUksQ0FBQztBQUN2QyxTQUFPO0FBQUE7QUFBQTtBQUFBO0FBQUEsSUFJTCxNQUFNLElBQUk7QUFBQSxJQUNWLFNBQVM7QUFBQSxNQUNQLE9BQU87QUFBQSxRQUNMLEtBQUtDLE1BQUssUUFBUUMsbUNBQVcsSUFBSTtBQUFBLFFBQ2pDLEtBQUtELE1BQUssUUFBUUMsbUNBQVcsT0FBTztBQUFBLE1BQ3RDO0FBQUEsTUFDQSxZQUFZLENBQUMsUUFBUSxPQUFPLE9BQU8sUUFBUSxRQUFRLFNBQVMsTUFBTTtBQUFBLElBQ3BFO0FBQUE7QUFBQSxJQUVBLFNBQVMsZ0JBQWMsS0FBSyxZQUFZLE9BQU87QUFBQSxJQUMvQyxRQUFRO0FBQUEsTUFDTixNQUFNO0FBQUEsTUFDTixNQUFNLE9BQU8sSUFBSSxhQUFhO0FBQUEsTUFDOUIsTUFBTTtBQUFBLE1BQ04sT0FBTztBQUFBLFFBQ0wsQ0FBQyxJQUFJLGlCQUFpQixHQUFHO0FBQUE7QUFBQSxVQUV2QixRQUFRO0FBQUEsVUFDUixjQUFjO0FBQUEsVUFDZCxJQUFJO0FBQUEsVUFDSixTQUFTLENBQUNELFVBQVNBLE1BQUssUUFBUSxJQUFJLE9BQU8sTUFBTSxJQUFJLGlCQUFpQixHQUFHLEVBQUU7QUFBQSxRQUM3RTtBQUFBLE1BQ0Y7QUFBQSxJQUNGO0FBQUEsSUFDQSxLQUFLO0FBQUEsTUFDSCxxQkFBcUI7QUFBQSxRQUNuQixNQUFNO0FBQUEsVUFDSixtQkFBbUI7QUFBQSxRQUNyQjtBQUFBLE1BQ0Y7QUFBQSxNQUNBLFNBQVM7QUFBQSxRQUNQLFNBQVM7QUFBQSxVQUNQO0FBQUEsWUFDRSxlQUFlO0FBQUEsWUFDZixRQUFRO0FBQUEsY0FDTixTQUFTLENBQUMsV0FBVztBQUNuQixvQkFBSSxPQUFPLFNBQVMsV0FBVztBQUM3Qix5QkFBTyxPQUFPO0FBQUEsZ0JBQ2hCO0FBQUEsY0FDRjtBQUFBLFlBQ0Y7QUFBQSxVQUNGO0FBQUEsUUFDRjtBQUFBLE1BQ0Y7QUFBQSxJQUNGO0FBQUE7QUFBQSxJQUVBLGNBQWM7QUFBQSxNQUNaLFNBQVM7QUFBQSxRQUNQO0FBQUEsUUFDQTtBQUFBLFFBQ0E7QUFBQSxRQUNBO0FBQUEsUUFDQTtBQUFBLFFBQ0E7QUFBQSxRQUNBO0FBQUEsUUFDQTtBQUFBLFFBQ0E7QUFBQSxRQUNBO0FBQUEsTUFDRjtBQUFBLElBQ0Y7QUFBQSxFQUNGO0FBQ0YsQ0FBQzsiLAogICJuYW1lcyI6IFsicGF0aCIsICJFbGVtZW50UGx1c1Jlc29sdmVyIiwgIkljb25zUmVzb2x2ZXIiLCAiX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUiLCAicGF0aCIsICJFbGVtZW50UGx1c1Jlc29sdmVyIiwgIkljb25zUmVzb2x2ZXIiLCAiX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUiLCAiX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUiLCAicGF0aCIsICJfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSIsICJwYXRoIiwgIl9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lIiwgInBhdGgiLCAiX192aXRlX2luamVjdGVkX29yaWdpbmFsX2Rpcm5hbWUiXQp9Cg== diff --git a/vite/plugins/auto-import.ts b/vite/plugins/auto-import.ts new file mode 100644 index 0000000..072ef61 --- /dev/null +++ b/vite/plugins/auto-import.ts @@ -0,0 +1,24 @@ +import AutoImport from 'unplugin-auto-import/vite'; +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'; +import IconsResolver from 'unplugin-icons/resolver'; + +export default (path: any) => { + return AutoImport({ + // 自动导入 Vue 相关函数 + imports: ['vue', 'vue-router', '@vueuse/core', 'pinia'], + eslintrc: { + enabled: false, + filepath: './.eslintrc-auto-import.json', + globalsPropValue: true + }, + resolvers: [ + // 自动导入 Element Plus 相关函数ElMessage, ElMessageBox... (带样式) + ElementPlusResolver(), + IconsResolver({ + prefix: 'Icon' + }) + ], + vueTemplate: true, // 是否在 vue 模板中自动导入 + dts: path.resolve(path.resolve(__dirname, '../../src'), 'types', 'auto-imports.d.ts') + }); +}; diff --git a/vite/plugins/components.ts b/vite/plugins/components.ts new file mode 100644 index 0000000..336f5cf --- /dev/null +++ b/vite/plugins/components.ts @@ -0,0 +1,17 @@ +import Components from 'unplugin-vue-components/vite'; +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'; +import IconsResolver from 'unplugin-icons/resolver'; + +export default (path: any) => { + return Components({ + resolvers: [ + // 自动导入 Element Plus 组件 + ElementPlusResolver(), + // 自动注册图标组件 + IconsResolver({ + enabledCollections: ['ep'] + }) + ], + dts: path.resolve(path.resolve(__dirname, '../../src'), 'types', 'components.d.ts') + }); +}; diff --git a/vite/plugins/compression.ts b/vite/plugins/compression.ts new file mode 100644 index 0000000..aa8c779 --- /dev/null +++ b/vite/plugins/compression.ts @@ -0,0 +1,28 @@ +import compression from 'vite-plugin-compression'; + +export default (env: any) => { + const { VITE_BUILD_COMPRESS } = env; + const plugin: any[] = []; + if (VITE_BUILD_COMPRESS) { + const compressList = VITE_BUILD_COMPRESS.split(','); + if (compressList.includes('gzip')) { + // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 + plugin.push( + compression({ + ext: '.gz', + deleteOriginFile: false + }) + ); + } + if (compressList.includes('brotli')) { + plugin.push( + compression({ + ext: '.br', + algorithm: 'brotliCompress', + deleteOriginFile: false + }) + ); + } + } + return plugin; +}; diff --git a/vite/plugins/icons.ts b/vite/plugins/icons.ts new file mode 100644 index 0000000..883f230 --- /dev/null +++ b/vite/plugins/icons.ts @@ -0,0 +1,8 @@ +import Icons from 'unplugin-icons/vite'; + +export default () => { + return Icons({ + // 自动安装图标库 + autoInstall: true + }); +}; diff --git a/vite/plugins/index.ts b/vite/plugins/index.ts new file mode 100644 index 0000000..30b2835 --- /dev/null +++ b/vite/plugins/index.ts @@ -0,0 +1,22 @@ +import vue from '@vitejs/plugin-vue'; +import createUnoCss from './unocss'; +import createAutoImport from './auto-import'; +import createComponents from './components'; +import createIcons from './icons'; +import createSvgIconsPlugin from './svg-icon'; +import createCompression from './compression'; +import createSetupExtend from './setup-extend'; +import path from 'path'; + +export default (viteEnv: any, isBuild = false): [] => { + const vitePlugins: any = []; + vitePlugins.push(vue()); + vitePlugins.push(createUnoCss()); + vitePlugins.push(createAutoImport(path)); + vitePlugins.push(createComponents(path)); + vitePlugins.push(createCompression(viteEnv)); + vitePlugins.push(createIcons()); + vitePlugins.push(createSvgIconsPlugin(path, isBuild)); + vitePlugins.push(createSetupExtend()); + return vitePlugins; +}; diff --git a/vite/plugins/setup-extend.ts b/vite/plugins/setup-extend.ts new file mode 100644 index 0000000..ed3423f --- /dev/null +++ b/vite/plugins/setup-extend.ts @@ -0,0 +1,5 @@ +import setupExtend from 'unplugin-vue-setup-extend-plus/vite'; + +export default () => { + return setupExtend({}); +}; diff --git a/vite/plugins/svg-icon.ts b/vite/plugins/svg-icon.ts new file mode 100644 index 0000000..70296da --- /dev/null +++ b/vite/plugins/svg-icon.ts @@ -0,0 +1,10 @@ +import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'; +export default (path: any, isBuild: boolean) => { + return createSvgIconsPlugin({ + // 指定需要缓存的图标文件夹 + iconDirs: [path.resolve(path.resolve(__dirname, '../../src'), 'assets/icons/svg')], + // 指定symbolId格式 + symbolId: 'icon-[dir]-[name]', + svgoOptions: isBuild + }); +}; diff --git a/vite/plugins/unocss.ts b/vite/plugins/unocss.ts new file mode 100644 index 0000000..08e186b --- /dev/null +++ b/vite/plugins/unocss.ts @@ -0,0 +1,7 @@ +import UnoCss from 'unocss/vite'; + +export default () => { + return UnoCss({ + hmrTopLevelAwait: false // unocss默认是true,低版本浏览器是不支持的,启动后会报错 + }); +};