commit 6c871cbe9d39adf42716f9dc4f3658b59dfa025d Author: 19046 <1904619592@qq.com> Date: Tue Sep 15 10:54:51 2026 +0800 first commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..79a12ff --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true +[*.{js,ts,vue}] +charset = utf-8 # 设置文件字符集为 utf-8 +end_of_line = lf # 控制换行类型(lf | cr | crlf) +insert_final_newline = true # 始终在文件末尾插入一个新行 +indent_style = space # 缩进风格(tab | space) +indent_size = 2 # 缩进大小 +max_line_length = 100 # 最大行长度 + +[*.md] # 仅 md 文件适用以下规则 +max_line_length = off # 关闭最大行长度限制 +trim_trailing_whitespace = false # 关闭末尾空格修剪 diff --git a/.env b/.env new file mode 100644 index 0000000..9de3e23 --- /dev/null +++ b/.env @@ -0,0 +1,26 @@ +# 标题 +VITE_APP_TITLE=金智桥药品注册管理系统 +VITE_APP_SUB_TITLE=药品注册管理系统 + +# 项目本地运行端口号 +VITE_PORT=80 + +# open 运行 npm run dev 时自动打开浏览器 +VITE_OPEN=true + +# 租户开关 +VITE_APP_TENANT_ENABLE=true + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=true + +# 文档地址的开关 +VITE_APP_DOCALERT_ENABLE=false + +# 百度统计 +VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc + +# 默认账户密码 +VITE_APP_DEFAULT_LOGIN_TENANT = '' +VITE_APP_DEFAULT_LOGIN_USERNAME = '' +VITE_APP_DEFAULT_LOGIN_PASSWORD = '' diff --git a/.env.dev b/.env.dev new file mode 100644 index 0000000..e61291c --- /dev/null +++ b/.env.dev @@ -0,0 +1,37 @@ +# 开发环境:本地只启动前端项目,依赖开发环境(后端、APP) +NODE_ENV=production + +VITE_DEV=true + +# 请求路径 +VITE_BASE_URL='http://test.jinzhiqiaotech.com:48080' + +# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 +VITE_UPLOAD_TYPE=server + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=false + +# 是否删除console.log +VITE_DROP_CONSOLE=false + +# 是否sourcemap +VITE_SOURCEMAP=true + +# 打包路径 +VITE_BASE_PATH=/ + +# 输出路径 +VITE_OUT_DIR=dist + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=true + +# GoView域名 +VITE_GOVIEW_URL='http://127.0.0.1:3000' \ No newline at end of file diff --git a/.env.local b/.env.local new file mode 100644 index 0000000..9830aa0 --- /dev/null +++ b/.env.local @@ -0,0 +1,36 @@ +# 本地开发环境:本地启动所有项目(前端、后端、APP)时使用,不依赖外部环境 +NODE_ENV=development + +VITE_DEV=true + +# 请求路径 +VITE_BASE_URL='http://localhost:48081' + +VITE_ONLYOFFICE_API_JS_URL='http://localhost:8082' + +# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务 +VITE_UPLOAD_TYPE=server + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=false + +# 是否删除console.log +VITE_DROP_CONSOLE=false + +# 是否sourcemap +VITE_SOURCEMAP=false + +# 打包路径 +VITE_BASE_PATH=/ + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://localhost:3000' + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=true + +# GoView域名 +VITE_GOVIEW_URL='http://127.0.0.1:3000' diff --git a/.env.mydev b/.env.mydev new file mode 100644 index 0000000..4d92755 --- /dev/null +++ b/.env.mydev @@ -0,0 +1,37 @@ +# 开发环境:本地只启动前端项目,依赖开发环境(后端、APP) +NODE_ENV=production + +VITE_DEV=true + +# 请求路径 +VITE_BASE_URL='http://1.95.202.243:48080' + +# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 +VITE_UPLOAD_TYPE=server + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=false + +# 是否删除console.log +VITE_DROP_CONSOLE=false + +# 是否sourcemap +VITE_SOURCEMAP=true + +# 打包路径 +VITE_BASE_PATH=/ + +# 输出路径 +VITE_OUT_DIR=dist + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=true + +# GoView域名 +VITE_GOVIEW_URL='http://127.0.0.1:3000' \ No newline at end of file diff --git a/.env.prod b/.env.prod new file mode 100644 index 0000000..0f29eca --- /dev/null +++ b/.env.prod @@ -0,0 +1,37 @@ +# 生产环境:只在打包时使用 +NODE_ENV=production + +VITE_DEV=false + +# 请求路径 +VITE_BASE_URL='http://test.jinzhiqiaotech.com:48080' + +# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 +VITE_UPLOAD_TYPE=server + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=true + +# 是否删除console.log +VITE_DROP_CONSOLE=true + +# 是否sourcemap +VITE_SOURCEMAP=false + +# 打包路径 +VITE_BASE_PATH=/ + +# 输出路径 +VITE_OUT_DIR=dist + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' + +# GoView域名 +VITE_GOVIEW_URL='http://127.0.0.1:3000' + +# 验证码的开关 +VITE_APP_CAPTCHA_ENABLE=true \ No newline at end of file diff --git a/.env.stage b/.env.stage new file mode 100644 index 0000000..084337c --- /dev/null +++ b/.env.stage @@ -0,0 +1,34 @@ +# 预发布环境:只在打包时使用 +NODE_ENV=production + +VITE_DEV=false + +# 请求路径 +VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' + +# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 +VITE_UPLOAD_TYPE=server + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=true + +# 是否删除console.log +VITE_DROP_CONSOLE=true + +# 是否sourcemap +VITE_SOURCEMAP=false + +# 打包路径 +VITE_BASE_PATH='http://static-vue3.yudao.iocoder.cn/' + +# 输出路径 +VITE_OUT_DIR=dist-stage + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' + +# GoView域名 +VITE_GOVIEW_URL='http://127.0.0.1:3000' \ No newline at end of file diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..2252e14 --- /dev/null +++ b/.env.test @@ -0,0 +1,34 @@ +# 测试环境:只在打包时使用 +NODE_ENV=production + +VITE_DEV=false + +# 请求路径 +VITE_BASE_URL='http://localhost:48080' + +# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务 +VITE_UPLOAD_TYPE=server + +# 接口地址 +VITE_API_URL=/admin-api + +# 是否删除debugger +VITE_DROP_DEBUGGER=true + +# 是否删除console.log +VITE_DROP_CONSOLE=true + +# 是否sourcemap +VITE_SOURCEMAP=false + +# 打包路径 +VITE_BASE_PATH=/admin-ui-vue3/ + +# 输出路径 +VITE_OUT_DIR=dist-test + +# 商城H5会员端域名 +VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' + +# GoView域名 +VITE_GOVIEW_URL='http://127.0.0.1:3000' \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..1e85c0f --- /dev/null +++ b/.eslintignore @@ -0,0 +1,8 @@ +/build/ +/config/ +/dist/ +/*.js +/test/unit/coverage/ +/node_modules/* +/dist* +/src/main.ts diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json new file mode 100644 index 0000000..024c96a --- /dev/null +++ b/.eslintrc-auto-import.json @@ -0,0 +1,259 @@ +{ + "globals": { + "EffectScope": true, + "ElMessage": true, + "ElMessageBox": true, + "ElTag": 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, + "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, + "useArrayJoin": true, + "useArrayMap": true, + "useArrayReduce": true, + "useArraySome": true, + "useAsyncQueue": true, + "useAsyncState": true, + "useAttrs": true, + "useBase64": true, + "useBattery": true, + "useBluetooth": true, + "useBreakpoints": true, + "useBroadcastChannel": true, + "useBrowserLocation": true, + "useCached": true, + "useClipboard": 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, + "usePointerSwipe": true, + "usePreferredColorScheme": true, + "usePreferredDark": true, + "usePreferredLanguages": true, + "useRafFn": true, + "useRefHistory": true, + "useResizeObserver": true, + "useRoute": true, + "useRouter": true, + "useScreenOrientation": true, + "useScreenSafeArea": true, + "useScriptTag": true, + "useScroll": true, + "useScrollLock": true, + "useSessionStorage": true, + "useShare": true, + "useSlots": 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, + "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 + } +} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..cb691db --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,76 @@ +// @ts-check +const { defineConfig } = require('eslint-define-config') +module.exports = defineConfig({ + root: true, + env: { + browser: true, + node: true, + es6: true + }, + parser: 'vue-eslint-parser', + parserOptions: { + parser: '@typescript-eslint/parser', + ecmaVersion: 2020, + sourceType: 'module', + jsxPragma: 'React', + ecmaFeatures: { + jsx: true + } + }, + extends: [ + 'plugin:vue/vue3-recommended', + 'plugin:@typescript-eslint/recommended', + 'prettier', + 'plugin:prettier/recommended', + '@unocss' + ], + rules: { + 'vue/no-setup-props-destructure': 'off', + 'vue/script-setup-uses-vars': 'error', + 'vue/no-reserved-component-names': 'off', + '@typescript-eslint/ban-ts-ignore': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-empty-function': 'off', + 'vue/custom-event-name-casing': 'off', + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/vue-super-flow': 'off', + 'no-unused-vars': 'off', + 'space-before-function-paren': 'off', + + 'vue/attributes-order': 'off', + 'vue/one-component-per-file': 'off', + 'vue/html-closing-bracket-newline': 'off', + 'vue/max-attributes-per-line': 'off', + 'vue/multiline-html-element-content-newline': 'off', + 'vue/singleline-html-element-content-newline': 'off', + 'vue/attribute-hyphenation': 'off', + 'vue/require-default-prop': 'off', + 'vue/require-explicit-emits': 'off', + 'vue/require-toggle-inside-transition': 'off', + 'vue/html-self-closing': [ + 'error', + { + html: { + void: 'always', + normal: 'never', + component: 'always' + }, + svg: 'always', + math: 'always' + } + ], + 'vue/multi-word-component-names': 'off', + 'vue/no-v-html': 'off', + 'prettier/prettier': 'off', // 芋艿:默认关闭 prettier 的 ESLint 校验,因为我们使用的是 IDE 的 Prettier 插件 + '@unocss/order': 'off', // 芋艿:禁用 unocss 【css】顺序的提示,因为暂时不需要这么严格,警告也有点繁琐 + '@unocss/order-attributify': 'off' // 芋艿:禁用 unocss 【属性】顺序的提示,因为暂时不需要这么严格,警告也有点繁琐 + } +}) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..848638a --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +node_modules +.DS_Store +dist +dist-ssr +/dist* +pnpm-debug +auto-*.d.ts +.idea +.history diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..f68ea86 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +/node_modules/** +/dist/ +/dist* +/public/* +/docs/* +/vite.config.ts +/src/types/env.d.ts +/src/types/auto-components.d.ts +/src/types/auto-imports.d.ts +/docs/**/* +CHANGELOG diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 0000000..aa605b4 --- /dev/null +++ b/.stylelintignore @@ -0,0 +1,6 @@ +/dist/* +/public/* +public/* +/dist* +/src/types/env.d.ts +/docs/**/* diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..65288b5 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,18 @@ +{ + "recommendations": [ + "christian-kohler.path-intellisense", + "vscode-icons-team.vscode-icons", + "davidanson.vscode-markdownlint", + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "mrmlnc.vscode-less", + "lokalise.i18n-ally", + "redhat.vscode-yaml", + "csstools.postcss", + "mikestead.dotenv", + "eamodio.gitlens", + "antfu.iconify", + "antfu.unocss", + "Vue.volar" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..f43edc0 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "msedge", + "request": "launch", + "name": "Launch Edge against localhost", + "url": "http://localhost", + "webRoot": "${workspaceFolder}/src", + "sourceMaps": true + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f145f38 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,145 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib", + "npm.packageManager": "pnpm", + "editor.tabSize": 2, + "prettier.printWidth": 100, // 超过最大值换行 + "editor.defaultFormatter": "esbenp.prettier-vscode", + "files.eol": "\n", + "search.exclude": { + "**/node_modules": true, + "**/*.log": true, + "**/*.log*": true, + "**/bower_components": true, + "**/dist": true, + "**/elehukouben": true, + "**/.git": true, + "**/.gitignore": true, + "**/.svn": true, + "**/.DS_Store": true, + "**/.idea": true, + "**/.vscode": false, + "**/yarn.lock": true, + "**/tmp": true, + "out": true, + "dist": true, + "node_modules": true, + "CHANGELOG.md": true, + "examples": true, + "res": true, + "screenshots": true, + "yarn-error.log": true, + "**/.yarn": true + }, + "files.exclude": { + "**/.cache": true, + "**/.editorconfig": true, + "**/.eslintcache": true, + "**/bower_components": true, + "**/.idea": true, + "**/tmp": true, + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true + }, + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/.git/subtree-cache/**": true, + "**/.vscode/**": true, + "**/node_modules/**": true, + "**/tmp/**": true, + "**/bower_components/**": true, + "**/dist/**": true, + "**/yarn.lock": true + }, + "stylelint.enable": true, + "stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"], + "path-intellisense.mappings": { + "@/": "${workspaceRoot}/src" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescript]": { + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" + }, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[css]": { + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" + }, + "[less]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[scss]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[markdown]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit", + "source.fixAll.stylelint": "explicit" + }, + "[vue]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "i18n-ally.localesPaths": ["src/locales"], + "i18n-ally.keystyle": "nested", + "i18n-ally.sortKeys": true, + "i18n-ally.namespace": false, + "i18n-ally.enabledParsers": ["ts"], + "i18n-ally.sourceLanguage": "en", + "i18n-ally.displayLanguage": "zh-CN", + "i18n-ally.enabledFrameworks": ["vue", "react"], + "cSpell.words": [ + "brotli", + "browserslist", + "codemirror", + "commitlint", + "cropperjs", + "echart", + "echarts", + "esnext", + "esno", + "iconify", + "INTLIFY", + "lintstagedrc", + "logicflow", + "nprogress", + "pinia", + "pnpm", + "qrcode", + "sider", + "sortablejs", + "stylelint", + "svgs", + "unocss", + "unplugin", + "unref", + "videojs", + "VITE", + "vitejs", + "vueuse", + "wangeditor", + "xingyu", + "yudao", + "zxcvbn" + ], + // 控制相关文件嵌套展示 + "explorer.fileNesting.enabled": true, + "explorer.fileNesting.expand": false, + "explorer.fileNesting.patterns": { + "*.ts": "$(capture).test.ts, $(capture).test.tsx", + "*.tsx": "$(capture).test.ts, $(capture).test.tsx", + "*.env": "$(capture).env.*", + "package.json": "pnpm-lock.yaml,yarn.lock,LICENSE,README*,CHANGELOG*,CNAME,.gitattributes,.eslintrc-auto-import.json,.gitignore,prettier.config.js,stylelint.config.js,commitlint.config.js,.stylelintignore,.prettierignore,.gitpod.yml,.eslintrc.js,.eslintignore" + }, + "terminal.integrated.scrollback": 10000, + "nuxt.isNuxtApp": false +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9861118 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-present Archer + +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/build/vite/index.ts b/build/vite/index.ts new file mode 100644 index 0000000..585759f --- /dev/null +++ b/build/vite/index.ts @@ -0,0 +1,100 @@ +import { resolve } from 'path' +import Vue from '@vitejs/plugin-vue' +import VueJsx from '@vitejs/plugin-vue-jsx' +import progress from 'vite-plugin-progress' +import EslintPlugin from 'vite-plugin-eslint' +import PurgeIcons from 'vite-plugin-purge-icons' +import { ViteEjsPlugin } from 'vite-plugin-ejs' +// @ts-ignore +import ElementPlus from 'unplugin-element-plus/vite' +import AutoImport from 'unplugin-auto-import/vite' +import Components from 'unplugin-vue-components/vite' +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' +import viteCompression from 'vite-plugin-compression' +import topLevelAwait from 'vite-plugin-top-level-await' +import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' +import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' +import UnoCSS from 'unocss/vite' + +export function createVitePlugins() { + const root = process.cwd() + + // 路径查找 + function pathResolve(dir: string) { + return resolve(root, '.', dir) + } + + return [ + Vue(), + VueJsx(), + UnoCSS(), + progress(), + PurgeIcons(), + ElementPlus({}), + AutoImport({ + include: [ + /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx + /\.vue$/, + /\.vue\?vue/, // .vue + /\.md$/ // .md + ], + imports: [ + 'vue', + 'vue-router', + // 可额外添加需要 autoImport 的组件 + { + '@/hooks/web/useI18n': ['useI18n'], + '@/hooks/web/useMessage': ['useMessage'], + '@/hooks/web/useTable': ['useTable'], + '@/hooks/web/useCrudSchemas': ['useCrudSchemas'], + '@/utils/formRules': ['required'], + '@/utils/dict': ['DICT_TYPE'] + } + ], + dts: 'src/types/auto-imports.d.ts', + resolvers: [ElementPlusResolver()], + eslintrc: { + enabled: false, // Default `false` + filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json` + globalsPropValue: true // Default `true`, (true | false | 'readonly' | 'readable' | 'writable' | 'writeable') + } + }), + Components({ + // 生成自定义 `auto-components.d.ts` 全局声明 + dts: 'src/types/auto-components.d.ts', + // 自定义组件的解析器 + resolvers: [ElementPlusResolver()], + globs: ["src/components/**/**.{vue, md}", '!src/components/DiyEditor/components/mobile/**'] + }), + EslintPlugin({ + cache: false, + include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件 + }), + VueI18nPlugin({ + runtimeOnly: true, + compositionOnly: true, + include: [resolve(__dirname, 'src/locales/**')] + }), + createSvgIconsPlugin({ + iconDirs: [pathResolve('src/assets/svgs')], + symbolId: 'icon-[dir]-[name]', + svgoOptions: true + }), + viteCompression({ + verbose: true, // 是否在控制台输出压缩结果 + disable: false, // 是否禁用 + threshold: 10240, // 体积大于 threshold 才会被压缩,单位 b + algorithm: 'gzip', // 压缩算法,可选 [ 'gzip' , 'brotliCompress' ,'deflate' , 'deflateRaw'] + ext: '.gz', // 生成的压缩包后缀 + deleteOriginFile: false //压缩后是否删除源文件 + }), + ViteEjsPlugin(), + topLevelAwait({ + // https://juejin.cn/post/7152191742513512485 + // The export name of top-level await promise for each chunk module + promiseExportName: '__tla', + // The function to generate import names of top-level await promise in each chunk module + promiseImportName: (i) => `__tla_${i}` + }) + ] +} diff --git a/build/vite/optimize.ts b/build/vite/optimize.ts new file mode 100644 index 0000000..ee411d8 --- /dev/null +++ b/build/vite/optimize.ts @@ -0,0 +1,122 @@ +const include = [ + 'qs', + 'url', + 'vue', + 'sass', + 'mitt', + 'axios', + 'pinia', + 'dayjs', + 'qrcode', + 'unocss', + 'vue-router', + 'vue-types', + 'vue-i18n', + 'crypto-js', + 'cropperjs', + 'lodash-es', + 'nprogress', + 'web-storage-cache', + '@vueuse/core', + '@zxcvbn-ts/core', + 'echarts/core', + 'echarts/charts', + 'echarts/components', + 'echarts/renderers', + 'echarts-wordcloud', + '@wangeditor/editor', + '@wangeditor/editor-for-vue', + '@microsoft/fetch-event-source', + 'markdown-it', + 'markmap-view', + 'markmap-lib', + 'markmap-toolbar', + 'highlight.js', + 'element-plus', + 'element-plus/es', + 'element-plus/es/locale/lang/zh-cn', + 'element-plus/es/locale/lang/en', + 'element-plus/es/components/avatar/style/css', + 'element-plus/es/components/space/style/css', + 'element-plus/es/components/backtop/style/css', + 'element-plus/es/components/form/style/css', + 'element-plus/es/components/radio-group/style/css', + 'element-plus/es/components/radio/style/css', + 'element-plus/es/components/checkbox/style/css', + 'element-plus/es/components/checkbox-group/style/css', + 'element-plus/es/components/switch/style/css', + 'element-plus/es/components/time-picker/style/css', + 'element-plus/es/components/date-picker/style/css', + 'element-plus/es/components/descriptions/style/css', + 'element-plus/es/components/descriptions-item/style/css', + 'element-plus/es/components/link/style/css', + 'element-plus/es/components/tooltip/style/css', + 'element-plus/es/components/drawer/style/css', + 'element-plus/es/components/dialog/style/css', + 'element-plus/es/components/checkbox-button/style/css', + 'element-plus/es/components/option-group/style/css', + 'element-plus/es/components/radio-button/style/css', + 'element-plus/es/components/cascader/style/css', + 'element-plus/es/components/color-picker/style/css', + 'element-plus/es/components/input-number/style/css', + 'element-plus/es/components/rate/style/css', + 'element-plus/es/components/select-v2/style/css', + 'element-plus/es/components/tree-select/style/css', + 'element-plus/es/components/slider/style/css', + 'element-plus/es/components/time-select/style/css', + 'element-plus/es/components/autocomplete/style/css', + 'element-plus/es/components/image-viewer/style/css', + 'element-plus/es/components/upload/style/css', + 'element-plus/es/components/col/style/css', + 'element-plus/es/components/form-item/style/css', + 'element-plus/es/components/alert/style/css', + 'element-plus/es/components/breadcrumb/style/css', + 'element-plus/es/components/select/style/css', + 'element-plus/es/components/input/style/css', + 'element-plus/es/components/breadcrumb-item/style/css', + 'element-plus/es/components/tag/style/css', + 'element-plus/es/components/pagination/style/css', + 'element-plus/es/components/table/style/css', + 'element-plus/es/components/table-v2/style/css', + 'element-plus/es/components/table-column/style/css', + 'element-plus/es/components/card/style/css', + 'element-plus/es/components/row/style/css', + 'element-plus/es/components/button/style/css', + 'element-plus/es/components/menu/style/css', + 'element-plus/es/components/sub-menu/style/css', + 'element-plus/es/components/menu-item/style/css', + 'element-plus/es/components/option/style/css', + 'element-plus/es/components/dropdown/style/css', + 'element-plus/es/components/dropdown-menu/style/css', + 'element-plus/es/components/dropdown-item/style/css', + 'element-plus/es/components/skeleton/style/css', + 'element-plus/es/components/skeleton/style/css', + 'element-plus/es/components/backtop/style/css', + 'element-plus/es/components/menu/style/css', + 'element-plus/es/components/sub-menu/style/css', + 'element-plus/es/components/menu-item/style/css', + 'element-plus/es/components/dropdown/style/css', + 'element-plus/es/components/tree/style/css', + 'element-plus/es/components/dropdown-menu/style/css', + 'element-plus/es/components/dropdown-item/style/css', + 'element-plus/es/components/badge/style/css', + 'element-plus/es/components/breadcrumb/style/css', + 'element-plus/es/components/breadcrumb-item/style/css', + 'element-plus/es/components/image/style/css', + 'element-plus/es/components/collapse-transition/style/css', + 'element-plus/es/components/timeline/style/css', + 'element-plus/es/components/timeline-item/style/css', + 'element-plus/es/components/collapse/style/css', + 'element-plus/es/components/collapse-item/style/css', + 'element-plus/es/components/button-group/style/css', + 'element-plus/es/components/text/style/css', + 'element-plus/es/components/segmented/style/css', + '@element-plus/icons-vue', + 'element-plus/es/components/footer/style/css', + 'element-plus/es/components/empty/style/css' +] + +// @iconify/iconify:预构建拆 chunk 时偶发异常(浏览器报 @iconify_iconify.js:1:1 SyntaxError),改为走包内 ESM +const exclude = ['@iconify/json', '@iconify/iconify'] + +export { include, exclude } diff --git a/depley.sh b/depley.sh new file mode 100644 index 0000000..bde407d --- /dev/null +++ b/depley.sh @@ -0,0 +1,2 @@ +运行build:dev +scp -r ./dist root@1.95.202.243:/work/projects/yudao-ui-admin \ No newline at end of file diff --git a/eCTD3.2.2-权限说明.md b/eCTD3.2.2-权限说明.md new file mode 100644 index 0000000..72c254d --- /dev/null +++ b/eCTD3.2.2-权限说明.md @@ -0,0 +1,371 @@ +# ECTD3.2.2 套餐功能说明 + +本文档说明:**系统里有哪些功能,以及每个功能具体能做什么。** + +适合给客户、业务负责人阅读,用于了解「开什么、关什么、对用户有什么影响」。 + +--- + +## 一、先搞懂三件事 + +### 1. 角色决定「每个人能用到哪一步」 + +同一家公司里,不同岗位看到的功能可以不一样。 +例如:有人只能看文档,有人还能删文档、发版。 + +**最终效果** = 公司套餐里有的功能 ∩ 这个人角色里开放的功能。 + +### 2. 关掉「大功能」,下面全部跟着没有 + +系统里功能是分层的,像文件夹套文件夹: + +``` +大模块(左侧菜单分组) + └── 具体页面 + └── 页面上的按钮(新建、删除、下载等) +``` + +**重要规则:关掉上一级,下面所有相关功能都会消失。** + +**举例:** + + +| 如果关闭 | 用户会看到什么 | +| ------------------- | ------------------------------------------------ | +| **eCTD申报系统** 整个模块 | 左侧没有 eCTD 入口;中国/欧盟项目、新建序列、导入、下载、归档、发布等 **全部不能用** | +| **用户管理** 页面,但保留「查看」 | 能打开用户列表,但不能新建、改资料、删用户、导入、分配岗位 | +| 只关闭「删除序列」 | 其他 eCTD 操作正常,只是不能删序列 | + + +--- + + + +## 二、本套餐包含的五大模块 + +``` +├─ 系统管理 … 管账号、岗位、通知、操作记录 +├─ eCTD申报系统 … 药品电子申报(中国/欧盟等) +├─ 文档管理系统 … 写文档、传文件、做任务 +├─ 文档管理设置 … 审批流程、模板、历史版本(偏管理配置) +└─ 电子申报系统 … 另一类电子申报业务(与 eCTD 分开) +``` + +--- + + + +## 三、各模块详细说明 + + + +### 模块一:系统管理 + +**这是干什么的:** +公司管理员用来管人、管岗位、发通知、查谁什么时候登录/操作过系统。 + +**如果整个「系统管理」都不开:** +没人能管账号和岗位,也看不到通知、操作记录等后台管理功能。 + +--- + + + +#### 1.1 用户管理 + +**这是干什么的:** +维护公司里的登录账号(谁可以登录、基本信息、密码等)。 + + +| 功能 | 用户能做什么 | +| ------ | ------------------------------------------ | +| 查看用户 | 打开用户列表,看有哪些同事、各自信息 | +| 新增用户 | 给新同事开账号 | +| 修改 | 改姓名、邮箱、手机号等资料 | +| 删除 | 删掉不再使用的账号 | +| 导出列表 | 把用户名单导出成表格文件 | +| 批量导入 | 一次导入很多账号(适合 onboarding) | +| 重置密码 | 同事忘记密码时,管理员帮重置 | +| 设置用户岗位 | 决定这个人是 RA、Author 还是管理员等(**非常关键,决定他能干什么活**) | + + +--- + + + +#### 1.2 角色管理(岗位权限设置) + +**这是干什么的:** +定义「RA」「Author」「管理员」等岗位,并勾选每个岗位能进哪些页面、能点哪些按钮。 + + +| 功能 | 用户能做什么 | +| ---------- | -------------------------------- | +| 查看 | 看有哪些岗位 | +| 新增岗位 | 新建一种岗位类型 | +| 修改 | 改岗位名称等 | +| 删除 | 删掉不再用的岗位 | +| 导出列表 | 导出岗位清单 | +| **设置岗位功能** | 勾选这个岗位能用的菜单和操作(**给同事分配能力的主要入口**) | + + +--- + + + +#### 1.3 消息中心 + +**这是干什么的:** +发公告、配邮件、发站内消息。 + +**如果整个「消息中心」都不开:** +公告、邮件、站内信相关功能全部不可用。 + +**通知公告** + + +| 功能 | 用户能做什么 | +| ---- | -------- | +| 查看公告 | 看已发布的通知 | +| 发公告 | 写新通知给同事看 | +| 改公告 | 修改已发内容 | +| 删公告 | 删除通知 | + + +**邮箱管理** + + +| 页面 | 干什么用 | +| ---- | ------------------------- | +| 邮箱账号 | 配置系统发邮件用的邮箱(如通知邮件从哪个地址发出) | +| 邮件模板 | 维护邮件正文模板 | +| 邮件记录 | 查看系统发过哪些邮件 | + + +每个页面通常还有:查看、新建、修改、删除;模板页还可「发一封测试邮件」试一下效果。 + +**站内信管理** + + +| 页面 | 干什么用 | +| ---- | --------- | +| 消息模板 | 系统内消息的模板 | +| 消息记录 | 查已发送的站内消息 | + + +--- + + + +#### 1.4 审计日志(操作记录) + +**这是干什么的:** +留痕——谁什么时候登录过、谁改过什么重要数据。 + +**如果不开:** +无法追溯操作和登录历史(合规、排查问题时会有影响)。 + + +| 页面 | 干什么用 | +| ---- | ------------- | +| 操作日志 | 看同事在系统里做过哪些操作 | +| 登录日志 | 看谁在什么时间登录/退出 | + + +每个页面支持:查看记录、导出成文件。 + +--- + + + +### 模块二:eCTD申报系统 + +**这是干什么的:** +做药品 **eCTD 电子申报** 的核心模块——管理申报项目、序列(一次递交的内容包),以及导入、编辑、发布、下载、归档等全流程。 + +**如果整个「eCTD申报系统」都不开:** + +- 左侧菜单里 **没有 eCTD 入口** +- 中国/欧盟项目、序列、在线查看器、格式说明等 **全部不可用** +- 适合:公司只用文档协作、不做 eCTD 递交的场景 + +**本模块下的主要页面:** + + +| 页面 | 干什么用 | +| ------- | ---------------------------------------------- | +| 中国 | 管理 **中国区域** 的 eCTD 项目和序列 | +| 欧盟 | 管理 **欧盟区域** 的 eCTD 项目和序列 | +| 格式规范 | 上传电脑上的某个PDF文件,然后查看其是否符合eCTD的规范,还可以一键格式规范并下载到本地 | +| eCTD查看器 | 在线打开、浏览 eCTD 序列包结构 | + + +**序列相关操作(在中国/欧盟项目里都会用到):** + + +| 功能 | 业务上是什么意思 | +| --------------- | ----------------------------------------- | +| 查看 | 打开项目列表,看序列详情 | +| 新增序列 | 开始一个新的申报序列 | +| 编辑 | 改序列里的内容和信息 | +| 删除 | 删掉不需要的序列 | +| 导出列表 | 把序列清单导出 | +| 导入序列包 | 把已有的 eCTD 包导入系统 | +| 归档 | 序列定稿封存,一般变为只读、作历史留存 | +| 撤销归档 | 把已归档的序列重新放开编辑 | +| 发布 | 序列定稿发布,供后续递交或下游使用 | +| 下载序列包 | 把 eCTD 包下载到本地 | +| 锁定 | 不让别人改这个序列 | +| 解锁 | 取消锁定,允许编辑 | +| 升级序列 | 按新版本规范升级序列 | +| **协作(可操作他人序列)** | **高权限**:不仅能管自己的,还能查看、编辑、发布、下载 **同事负责的序列** | +| 递交处理 | 与正式递交流程相关的处理步骤 | + + +--- + + + +### 模块三:文档管理系统 + +**这是干什么的:** +日常写文档、传文件、领任务、跟进度——和申报配套的文档协作。 + +**如果整个「文档管理系统」都不开:** +看不到文档和任务相关菜单,不能新建/上传文档,文档协作流程不可用。 + +**本模块下的主要入口:** + + +| 入口 | 干什么用 | +| ---- | ---------------------------------------------- | +| 任务管理 | 看自己要做的文档任务、待办、逾期项 | +| 文档管理 | 我的文档、全部文档、收藏、回收站 | +| 创建文档 | 在系统里新建一份文档 | +| 上传文档 | 从电脑上传文件 | +| 格式规范 | 上传电脑上的某个PDF文件,然后查看其是否符合eCTD的规范,还可以一键格式规范并下载到本地 | + + + + +#### 任务管理 + + +| 页面 | 干什么用 | +| ----- | ----------------- | +| 我的任务 | 只看我负责的任务 | +| 待处理任务 | 还没处理完的任务 | +| 逾期任务 | 已经超过截止日期的任务 | +| 所有任务 | 看公司里所有人的任务(管理者视角) | + + +常见操作:查看任务、删除任务、导出任务列表。 + +#### 文档管理 + + +| 页面 | 干什么用 | +| ---- | -------------- | +| 我的文档 | 我自己创建/负责的文档 | +| 所有文档 | 公司里全部文档 | +| 我的收藏 | 我标记收藏的文档 | +| 回收站 | 删掉的文档,可恢复或彻底清理 | + + +**我的文档** 一般可以:查看、编辑、删除、导出列表。 +**所有文档** 一般可以:查看全公司文档、编辑/删除他人文档(管理者或高权限岗位)。 + +其他:从回收站 **恢复文档**;**废弃文档**(彻底清理)。 + +--- + + + +### 模块四:文档管理系统设置 + +**这是干什么的:** +偏「管理员配置」——审批怎么流转、文档模板库、历史版本怎么查。 +**不影响** 同事日常打开文档写字,但影响公司级规范与管控。 + +**如果整个模块都不开:** +不能配审批流程、模板库、查全站历史版本。 + + +| 页面 | 干什么用 | +| -------- | ------------------------- | +| 文档审批流程配置 | 设置文档要经过哪些人审批、如何审批、审批过期时间等 | +| 文档历史版本管理 | 看一份文档改过哪些版本 | +| 文档创建模板库 | 维护文档管理系统中「新建文档时可选的模板」 | + + +各页面通常支持:查看、新建、修改、删除、导出;模板库还可 **审核** 模板后再给全员使用。 + +--- + + + +### 模块五:电子申报系统 + +**这是干什么的:** +另一套 **电子申报** 业务(与上面的 eCTD申报系统 **不是同一个东西**)。 +管理「电子申报项目/申请」的创建、编辑、导入、发布、下载、归档、递交等。 + +**如果整个「电子申报系统」都不开:** +左侧没有该入口,电子申报相关功能 **全部不可用**。 + +**电子申报项目** 下常见操作: + + +| 功能 | 业务上是什么意思 | +| --------------- | ------------------------ | +| 查看 | 看有哪些申报项目 | +| 新增申请 | 新建一份电子申报 | +| 编辑 | 修改申请内容 | +| 删除申请 | 删掉不需要的申请 | +| 导出列表 | 导出项目清单 | +| 导入数据包 | 从外部导入申报数据 | +| 发布 | 定稿发布申报数据 | +| 下载 | 下载申报包 | +| 归档 | 封存已完成申请 | +| 撤销归档 | 重新打开已归档申请 | +| **协作(可操作他人申请)** | **高权限**:能处理 **同事名下** 的申报 | +| 递交处理 | 正式递交相关步骤 | + + +--- + + + +## 四、关功能速查表(给客户看) + + +| 关闭这一项 | 同事会少什么 | +| --------------------- | ----------------------------- | +| 系统管理(整块) | 管账号、管岗位、公告、邮件、操作记录等后台能力 | +| eCTD申报系统(整块) | 所有 eCTD 申报相关功能 | +| 文档管理系统(整块) | 文档、任务、上传/新建文档 | +| 文档管理设置(整块) | 审批配置、模板库、历史版本管理 | +| 电子申报系统(整块) | 所有电子申报(DZ)功能 | +| 用户管理 | 不能维护同事账号(含分配岗位) | +| 角色管理 | 不能调整各岗位能用的功能 | +| 「协作」类功能(eCTD 或电子申报里的) | 只能管 **自己的** 项目/序列,不能动 **别人的** | + + +--- + + + +## 五、常见岗位怎么配(建议) + + +| 岗位 | 建议开放的功能 | 说明 | +| ------------ | ----------------------- | ---------------- | +| 公司管理员 | 系统管理 + 需要的业务模块 | 管人、管岗位、管公司级配置 | +| RA(注册事务) | eCTD申报 + 文档管理 | 做申报序列、配合文档协作 | +| RO(审评/只读为主) | eCTD 以 **查看** 为主 + 部分文档 | 少给删除、发布、归档等敏感操作 | +| Author(撰写人员) | 文档管理 + 任务 | 写文档、完成分配的任务 | +| 普通业务同事 | 按实际分工勾选 | **只给工作需要的**,不要多给 | + + +--- + diff --git a/fda-api.md b/fda-api.md new file mode 100644 index 0000000..e88329c --- /dev/null +++ b/fda-api.md @@ -0,0 +1,644 @@ +下面我帮你整理成: + +# FDA ESG NextGen 完整 API 请求规范(适合直接开发) + +包括: + +* 请求 URL +* Method +* Header +* Request Body +* Response +* 状态说明 +* 业务用途 +* 你的系统该怎么用 + +基于你上传的 ESG NextGen API Guide v1.2。 + +--- + +# 一、整体 API 调用顺序 + +建议你后端固定流程: + +```text id="g1u6ot" +1. 获取 OAuth Token +2. 获取 User/Company 信息 +3. 生成 Core ID + 临时上传凭证 +4. 创建 Payload +5. 上传 ZIP +6. 提交 Payload +7. 查询 Submission Status +8. 查询 ACK +``` + +--- + +# 二、统一基础地址 + +## ESG API + +```http id="z5c4m6" +https://external-api-esgng.fda.gov +``` + +--- + +## Upload API + +```http id="7pl3wf" +https://upload-api-esgng.fda.gov +``` + +--- + +# 三、OAuth Token API + +# 1. 获取 Access Token + +--- + +## Request + +```http id="wl7g0j" +POST https://external-api-esgng.fda.gov/as/token.oauth2?grant_type=client_credentials&scope=openid%20profile +``` + + + +--- + +## Headers + +```http id="t7tx8k" +Content-Type: application/x-www-form-urlencoded +``` + +--- + +## Body + +```x-www-form-urlencoded id="t3h5gm" +client_id=dc-7n2sdxk75a1viyutycu6205s5 +client_secret=CYufpEbz4lamjwixerj0Ka +``` + +--- + +## Response + +```json id="ny1y0j" +{ + "access_token": "aZl2hNYnbuOikJZEhmyA", + "token_type": "Bearer", + "expires_in": 3600 +} +``` + + + +--- + +# 四、获取用户与公司信息 API + +# 2. 获取 User/Company + +这个接口很重要。 + +因为后续: + +* user_id +* company_id +* authorizing_company_id + +都来自这里。 + +--- + +## Request + +```http id="yrgofn" +GET https://external-api-esgng.fda.gov/api/esgng/v1/companies?user_email=test@test.com +``` + + + +--- + +## Headers + +```http id="0m4h3m" +accesstoken: {access_token} +``` + +--- + +## Query Parameters + +| 参数 | 必填 | 说明 | +| ---------- | -- | -------- | +| user_email | 是 | ESG 注册邮箱 | + +--- + +## Response + +```json id="4f6zpc" +{ + "user_id": 55, + "user_email": "testagent5@test.com", + "company_id": 30, + "company_name": "Actual Agency", + "company_status": "Approved", + "authorizing_companies": [ + { + "authorizing_company_id": 2, + "authorizing_company_name": "Oldio Corp" + } + ], + "esgngcode": "ESGNG390", + "esgngdescription": "Company Information retrieved successfully from ESGNG." +} +``` + + + +--- + +# 五、生成 FDA Submission Core ID + +# 3. Generate Submission ID + +这是核心接口。 + +--- + +# 测试环境 + +```http id="4lf9kp" +GET https://external-api-esgng.fda.gov/api/esgng/v1/credentials/api/test +``` + +--- + +# 正式环境 + +```http id="5b3u2e" +GET https://external-api-esgng.fda.gov/api/esgng/v1/credentials/api +``` + + + +--- + +## Headers + +```http id="vgkz4s" +Content-Type: application/json +accesstoken: {access_token} +``` + +--- + +## Request Body + +```json id="2q6qvr" +{ + "user_id": "2", + "fda_center": "CBER", + "company_id": "2", + "authorizing_company_id": "2", + "submission_type": "510K", + "file_count": 1, + "description": "eCTD Sequence 0001", + "submission_protocol": "API" +} +``` + + + +--- + +# 参数说明 + +| 字段 | 必填 | 说明 | +| ---------------------- | -- | --------------- | +| user_id | 是 | 用户 ID | +| fda_center | 是 | FDA Center | +| company_id | 是 | 公司 ID | +| authorizing_company_id | 是 | 授权公司 ID | +| submission_type | 是 | Submission Type | +| file_count | 是 | 文件数量 | +| description | 否 | 描述 | +| submission_protocol | 是 | 固定 API | + +--- + +# FDA Center 示例 + +| 值 | Center | +| ----- | ------ | +| CBER | 生物制品 | +| CDER | 药品 | +| CDRH | 医疗器械 | +| CVM | 动物药 | +| CFSAN | 食品 | + +--- + +# Response + +```json id="bx0tqr" +{ + "core_id": "CmpAssociatesInc_2023110733023", + "temp_user": "1-CmpAssociatesInc_2023110733023", + "temp_password": "17948854-108c-4831-9000-0859c52fefc0", + "esgngcode": "ESGNG210", + "esgngdescription": "Core Id and Temporary Credentials generated and stored successfully." +} +``` + + + +--- + +# 六、创建 Upload Payload + +# 4. Create Payload + +--- + +## Request + +```http id="j4fjlwm" +GET https://upload-api-esgng.fda.gov/rest/forms/v1/fileupload/payload +``` + + + +--- + +## Headers + +```http id="jz3dk9" +Content-Type: application/json +``` + +--- + +## Body + +无。 + +--- + +## Response + +```json id="4g8d1r" +{ + "data": { + "payloadId": "123456", + "uploadFileLink": "https://...", + "submitFormLink": "https://..." + } +} +``` + + + +--- + +# 七、上传 eCTD ZIP 文件 + +# 5. Upload ZIP + +--- + +## Request + +```http id="jlwmhx" +POST https://upload-api-esgng.fda.gov/rest/forms/v1/fileupload/payload/{payloadId}/file +``` + + + +--- + +## Headers + +```http id="1l5xj4" +Content-Type: multipart/form-data +``` + +--- + +## Path Parameters + +| 参数 | 说明 | +| --------- | ---------- | +| payloadId | Payload ID | + +--- + +## FormData + +```text id="8l8j9f" +file: 0001.zip +``` + +--- + +## Response + +```json id="m0nd7l" +{ + "data": { + "status": "SUCCESS", + "message": "File uploaded successfully" + } +} +``` + + + +--- + +# 八、提交 Payload + +# 6. Submit Payload + +真正递交。 + +--- + +## Request + +```http id="w1i4b6" +POST https://upload-api-esgng.fda.gov/rest/forms/v1/fileupload/payload/{payloadId}/submit +``` + + + +--- + +## Headers + +```http id="n52hxm" +Content-Type: application/json +``` + +--- + +## Request Body + +```json id="7d0qmy" +{ + "username": "1-CmpAssociatesInc_2023110733023", + "password": "17948854-108c-4831-9000-0859c52fefc0", + "sha256_checksum": "xxxxxxxxxxxxxxxx" +} +``` + + + +--- + +# SHA256 说明 + +FDA 会校验: + +```text id="5v3p2u" +ZIP 文件完整性 +``` + +所以: + +必须: + +```text id="q4n1z0" +本地计算 ZIP SHA256 +``` + +--- + +# Response + +```json id="v0i0vw" +{ + "data": { + "message": "Payload submitted successfully", + "files": [ + { + "id": "111", + "name": "0001.zip", + "size": "1024000", + "link": "https://..." + } + ] + } +} +``` + + + +--- + +# 九、查询 Submission Status + +# 7. Get Submission Status + +--- + +## Request + +```http id="12c7g8" +GET https://external-api-esgng.fda.gov/api/esgng/v1/submissions/{core_id} +``` + + + +--- + +## Headers + +```http id="h1h6fz" +accesstoken: {access_token} +``` + +--- + +## Path Parameters + +| 参数 | 说明 | +| ------- | ------------------ | +| core_id | Submission Core ID | + +--- + +## Response + +```json id="j56q1y" +{ + "core_id": "CmpAssociatesInc_2023110733023", + "status": "Upload Initiated", + "submission_protocol": "API", + "esgngcode": "ESGNG270", + "esgngdescription": "Submission status retrieved successfully." +} +``` + + + +--- + +# 十、获取 ACK 信息(重点) + +# 8. Get ACKs + +这个最重要。 + +--- + +## Request + +```http id="lqvz0x" +GET https://external-api-esgng.fda.gov/api/esgng/v1/acknowledgements/{core_id} +``` + + + +--- + +## Headers + +```http id="m5g1bo" +accesstoken: {access_token} +``` + +--- + +## Response + +```json id="4m2f9l" +{ + "core_id": "ci241211033255.xxx", + "acknowledgements": [ + { + "acknowledgement": "ACK1", + "status": "Upload Received", + "message": "Submission successfully received by ESG", + "created_date": "12-11-2024, 03:34:10" + }, + { + "acknowledgement": "ACK2", + "status": "Submitted to Center", + "message": "Submission successfully submitted to HFP", + "created_date": "12-11-2024, 03:34:17" + } + ], + "esgngcode": "ESGNG360", + "esgngdescription": "Retrieved all acknowledgements for the given submission." +} +``` + + + +--- + +# 十一、ACK 业务含义 + +| ACK | 含义 | +| ---- | ------------- | +| ACK1 | ESG 收到文件 | +| ACK2 | FDA Center 收到 | +| ACK3 | 技术验证结果 | + +--- + +# 十二、推荐你的后端接口封装 + +建议: + +# 1. FDAAuthService + +负责: + +* token缓存 +* token刷新 + +--- + +# 2. ESGSubmissionService + +负责: + +* 创建 CoreID +* 创建 Payload +* 上传 ZIP +* 提交 Payload + +--- + +# 3. ESGAckService + +负责: + +* 查询 ACK +* 更新状态 +* ACK 下载 + +--- + +# 十三、推荐数据库设计 + +## submission_record + +| 字段 | 类型 | +| ------------ | -------- | +| id | bigint | +| sequence_id | bigint | +| core_id | varchar | +| payload_id | varchar | +| status | varchar | +| ack1_status | varchar | +| ack2_status | varchar | +| ack3_status | varchar | +| ack3_message | text | +| submit_time | datetime | +| archive_time | datetime | + +--- + +# 十四、推荐状态流转 + +```text id="z0n8j4" +Published + ↓ +Submitting + ↓ +Uploaded + ↓ +Submitted + ↓ +ACK1 + ↓ +ACK2 + ↓ +ACK3 + ↓ +Archived +``` + +--- + +# 十五、失败状态建议 + +| 场景 | 状态 | +| ----------- | ----------------- | +| OAuth失败 | AuthFailed | +| CoreID失败 | MetadataFailed | +| ZIP上传失败 | UploadFailed | +| Checksum失败 | SubmitFailed | +| ACK3 Reject | TechnicalRejected | + +--- diff --git a/index.html b/index.html new file mode 100644 index 0000000..c1f727c --- /dev/null +++ b/index.html @@ -0,0 +1,153 @@ + + +
+ + + + + + +
+ >>0}function expectString(e){if("string"!=typeof e)throw new a.FormatError("Malformed CMap: expected string.")}function expectInt(e){if(!Number.isInteger(e))throw new a.FormatError("Malformed CMap: expected int.")}function parseBfChar(e,t){for(;;){let r=t.getObj();if(r===n.EOF)break;if((0,n.isCmd)(r,"endbfchar"))return;expectString(r);const a=strToInt(r);r=t.getObj();expectString(r);const i=r;e.mapOne(a,i)}}function parseBfRange(e,t){for(;;){let r=t.getObj();if(r===n.EOF)break;if((0,n.isCmd)(r,"endbfrange"))return;expectString(r);const a=strToInt(r);r=t.getObj();expectString(r);const i=strToInt(r);r=t.getObj();if(Number.isInteger(r)||"string"==typeof r){const t=Number.isInteger(r)?String.fromCharCode(r):r;e.mapBfRange(a,i,t)}else{if(!(0,n.isCmd)(r,"["))break;{r=t.getObj();const s=[];for(;!(0,n.isCmd)(r,"]")&&r!==n.EOF;){s.push(r);r=t.getObj()}e.mapBfRangeToArray(a,i,s)}}}throw new a.FormatError("Invalid bf range.")}function parseCidChar(e,t){for(;;){let r=t.getObj();if(r===n.EOF)break;if((0,n.isCmd)(r,"endcidchar"))return;expectString(r);const a=strToInt(r);r=t.getObj();expectInt(r);const i=r;e.mapOne(a,i)}}function parseCidRange(e,t){for(;;){let r=t.getObj();if(r===n.EOF)break;if((0,n.isCmd)(r,"endcidrange"))return;expectString(r);const a=strToInt(r);r=t.getObj();expectString(r);const i=strToInt(r);r=t.getObj();expectInt(r);const s=r;e.mapCidRange(a,i,s)}}function parseCodespaceRange(e,t){for(;;){let r=t.getObj();if(r===n.EOF)break;if((0,n.isCmd)(r,"endcodespacerange"))return;if("string"!=typeof r)break;const a=strToInt(r);r=t.getObj();if("string"!=typeof r)break;const i=strToInt(r);e.addCodespaceRange(r.length,a,i)}throw new a.FormatError("Invalid codespace range.")}function parseWMode(e,t){const r=t.getObj();Number.isInteger(r)&&(e.vertical=!!r)}function parseCMapName(e,t){const r=t.getObj();r instanceof n.Name&&(e.name=r.name)}async function parseCMap(e,t,r,i){let s,c;e:for(;;)try{const r=t.getObj();if(r===n.EOF)break;if(r instanceof n.Name){"WMode"===r.name?parseWMode(e,t):"CMapName"===r.name&&parseCMapName(e,t);s=r}else if(r instanceof n.Cmd)switch(r.cmd){case"endcmap":break e;case"usecmap":s instanceof n.Name&&(c=s.name);break;case"begincodespacerange":parseCodespaceRange(e,t);break;case"beginbfchar":parseBfChar(e,t);break;case"begincidchar":parseCidChar(e,t);break;case"beginbfrange":parseBfRange(e,t);break;case"begincidrange":parseCidRange(e,t)}}catch(e){if(e instanceof o.MissingDataException)throw e;(0,a.warn)("Invalid cMap data: "+e);continue}!i&&c&&(i=c);return i?extendCMap(e,r,i):e}async function extendCMap(e,t,r){e.useCMap=await createBuiltInCMap(r,t);if(0===e.numCodespaceRanges){const t=e.useCMap.codespaceRanges;for(let r=0;r>15&1;this.clow=this.clow<<1&65535;this.ct--}while(0==(32768&c));this.a=c;e[t]=a<<1|n;return o}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.JpegStream=void 0;var a=r(150),n=r(137),i=r(159),s=r(2);class JpegStream extends a.DecodeStream{constructor(e,t,r){let a;for(;-1!==(a=e.getByte());)if(255===a){e.skip(-1);break}super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=r}get bytes(){return(0,s.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray("D","Decode");if(this.forceRGB&&Array.isArray(t)){const r=this.dict.get("BPC","BitsPerComponent")||8,a=t.length,n=new Int32Array(a);let i=!1;const s=(1<>4;if(0===n)if(o<15){y=receive(o)+(1<>4==0)for(m=0;m<64;m++){x=i[m];r[x]=e[o++]}else{if(t>>4!=1)throw new JpegError("DQT - invalid table spec");for(m=0;m<64;m++){x=i[m];r[x]=(0,n.readUint16)(e,o);o+=2}}u[15&t]=r}break;case 65472:case 65473:case 65474:if(r)throw new JpegError("Only single frame JPEGs supported");o+=2;r={};r.extended=65473===g;r.progressive=65474===g;r.precision=e[o++];const k=(0,n.readUint16)(e,o);o+=2;r.scanLines=t||k;r.samplesPerLine=(0,n.readUint16)(e,o);o+=2;r.components=[];r.componentIds={};const C=e[o++];let v=0,O=0;for(p=0;p0?Math.min(a.xcb,n.PPx-1):Math.min(a.xcb,n.PPx);n.ycb_=r>0?Math.min(a.ycb,n.PPy-1):Math.min(a.ycb,n.PPy);return n}function buildPrecincts(e,t,r){const a=1<=0;t--){d[t]=o[r];r=l[r]}}else d[f++]=d[0]}if(n){l[s]=u;c[s]=c[u]+1;o[s]=d[0];s++;h=s+i&s+i-1?h:0|Math.min(Math.log(s+i)/.6931471805599453+1,12)}u=e;g+=f;if(a