@ -0,0 +1,15 @@ |
||||
# http://editorconfig.org |
||||
root = true |
||||
|
||||
# 表示所有文件适用 |
||||
[*] |
||||
charset = utf-8 # 设置文件字符集为 utf-8 |
||||
end_of_line = lf # 控制换行类型(lf | cr | crlf) |
||||
indent_style = space # 缩进风格(tab | space) |
||||
indent_size = 2 # 缩进大小 |
||||
insert_final_newline = true # 始终在文件末尾插入一个新行 |
||||
|
||||
# 表示仅 md 文件适用以下规则 |
||||
[*.md] |
||||
max_line_length = off # 关闭最大行长度限制 |
||||
trim_trailing_whitespace = false # 关闭末尾空格修剪 |
@ -0,0 +1,16 @@ |
||||
## 开发环境 |
||||
NODE_ENV='development' |
||||
|
||||
# 应用端口 |
||||
VITE_APP_PORT = 3000 |
||||
|
||||
# 代理前缀 |
||||
VITE_APP_BASE_API = '/dev-api' |
||||
|
||||
# 线上接口地址 |
||||
#VITE_APP_API_URL = http://vapi.youlai.tech |
||||
# 开发接口地址 |
||||
VITE_APP_API_URL = http://localhost:8989 |
||||
|
||||
# 是否启用 Mock 服务 |
||||
VITE_MOCK_DEV_SERVER = false |
@ -0,0 +1,6 @@ |
||||
## 生产环境 |
||||
NODE_ENV='production' |
||||
|
||||
# 代理前缀 |
||||
VITE_APP_BASE_API = '/prod-api' |
||||
|
@ -0,0 +1,14 @@ |
||||
dist |
||||
node_modules |
||||
public |
||||
.husky |
||||
.vscode |
||||
.idea |
||||
*.sh |
||||
*.md |
||||
|
||||
src/assets |
||||
|
||||
.eslintrc.cjs |
||||
.prettierrc.cjs |
||||
.stylelintrc.cjs |
@ -0,0 +1,284 @@ |
||||
{ |
||||
"globals": { |
||||
"Component": true, |
||||
"ComponentPublicInstance": true, |
||||
"ComputedRef": true, |
||||
"EffectScope": true, |
||||
"ElMessage": true, |
||||
"ElMessageBox": true, |
||||
"ElNotification": true, |
||||
"InjectionKey": true, |
||||
"PropType": true, |
||||
"Ref": true, |
||||
"VNode": 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, |
||||
"createReusableTemplate": true, |
||||
"createSharedComposable": true, |
||||
"createTemplatePromise": 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, |
||||
"toValue": true, |
||||
"triggerRef": true, |
||||
"tryOnBeforeMount": true, |
||||
"tryOnBeforeUnmount": true, |
||||
"tryOnMounted": true, |
||||
"tryOnScopeDispose": true, |
||||
"tryOnUnmounted": true, |
||||
"unref": true, |
||||
"unrefElement": true, |
||||
"until": true, |
||||
"useActiveElement": true, |
||||
"useAnimate": true, |
||||
"useArrayDifference": true, |
||||
"useArrayEvery": true, |
||||
"useArrayFilter": true, |
||||
"useArrayFind": true, |
||||
"useArrayFindIndex": true, |
||||
"useArrayFindLast": true, |
||||
"useArrayIncludes": 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, |
||||
"useParentElement": true, |
||||
"usePerformanceObserver": 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, |
||||
"watchDeep": true, |
||||
"watchEffect": true, |
||||
"watchIgnorable": true, |
||||
"watchImmediate": true, |
||||
"watchOnce": true, |
||||
"watchPausable": true, |
||||
"watchPostEffect": true, |
||||
"watchSyncEffect": true, |
||||
"watchThrottled": true, |
||||
"watchTriggerable": true, |
||||
"watchWithFilter": true, |
||||
"whenever": true |
||||
} |
||||
} |
@ -0,0 +1,88 @@ |
||||
module.exports = { |
||||
root: true, |
||||
env: { |
||||
browser: true, |
||||
es2021: true, |
||||
node: true, |
||||
}, |
||||
parser: "vue-eslint-parser", |
||||
extends: [ |
||||
// https://eslint.vuejs.org/user-guide/#usage |
||||
"plugin:vue/vue3-recommended", |
||||
"./.eslintrc-auto-import.json", |
||||
"prettier", |
||||
"plugin:@typescript-eslint/recommended", |
||||
"plugin:prettier/recommended", |
||||
], |
||||
parserOptions: { |
||||
ecmaVersion: "latest", |
||||
sourceType: "module", |
||||
parser: "@typescript-eslint/parser", |
||||
project: "./tsconfig.*?.json", |
||||
createDefaultProgram: false, |
||||
extraFileExtensions: [".vue"], |
||||
}, |
||||
plugins: ["vue", "@typescript-eslint"], |
||||
rules: { |
||||
// https://eslint.vuejs.org/rules/#priority-a-essential-error-prevention |
||||
"vue/multi-word-component-names": "off", |
||||
"vue/no-v-model-argument": "off", |
||||
"vue/script-setup-uses-vars": "error", |
||||
"vue/no-reserved-component-names": "off", |
||||
"vue/custom-event-name-casing": "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/html-self-closing": [ |
||||
"error", |
||||
{ |
||||
html: { |
||||
void: "always", |
||||
normal: "never", |
||||
component: "always", |
||||
}, |
||||
svg: "always", |
||||
math: "always", |
||||
}, |
||||
], |
||||
|
||||
"@typescript-eslint/no-empty-function": "off", // 关闭空方法检查 |
||||
"@typescript-eslint/no-explicit-any": "off", // 关闭any类型的警告 |
||||
"@typescript-eslint/no-non-null-assertion": "off", |
||||
"@typescript-eslint/ban-ts-ignore": "off", |
||||
"@typescript-eslint/ban-ts-comment": "off", |
||||
"@typescript-eslint/ban-types": "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", |
||||
"@typescript-eslint/no-use-before-define": "off", |
||||
"@typescript-eslint/no-non-null-assertion": "off", |
||||
"@typescript-eslint/explicit-module-boundary-types": "off", |
||||
"@typescript-eslint/no-unused-vars": "off", |
||||
|
||||
"prettier/prettier": [ |
||||
"error", |
||||
{ |
||||
useTabs: false, // 不使用制表符 |
||||
}, |
||||
], |
||||
}, |
||||
// eslint不能对html文件生效 |
||||
overrides: [ |
||||
{ |
||||
files: ["*.html"], |
||||
processor: "vue/.vue", |
||||
}, |
||||
], |
||||
// https://eslint.org/docs/latest/use/configure/language-options#specifying-globals |
||||
globals: { |
||||
OptionType: "readonly", |
||||
}, |
||||
}; |
@ -0,0 +1,18 @@ |
||||
node_modules |
||||
.DS_Store |
||||
dist |
||||
dist-ssr |
||||
*.local |
||||
.history |
||||
|
||||
# Editor directories and files |
||||
.idea |
||||
*.suo |
||||
*.ntvs* |
||||
*.njsproj |
||||
*.sln |
||||
*.local |
||||
|
||||
package-lock.json |
||||
pnpm-lock.yaml |
||||
stats.html |
@ -0,0 +1,4 @@ |
||||
#!/bin/sh |
||||
. "$(dirname "$0")/_/husky.sh" |
||||
|
||||
npx --no-install commitlint --edit $1 |
@ -0,0 +1,4 @@ |
||||
#!/bin/sh |
||||
. "$(dirname "$0")/_/husky.sh" |
||||
|
||||
npm run lint:lint-staged |
@ -0,0 +1,11 @@ |
||||
dist |
||||
node_modules |
||||
public |
||||
.husky |
||||
.vscode |
||||
.idea |
||||
*.sh |
||||
*.md |
||||
|
||||
src/assets |
||||
stats.html |
@ -0,0 +1,46 @@ |
||||
module.exports = { |
||||
// (x)=>{},单个参数箭头函数是否显示小括号。(always:始终显示;avoid:省略括号。默认:always) |
||||
arrowParens: "always", |
||||
// 开始标签的右尖括号是否跟随在最后一行属性末尾,默认false |
||||
bracketSameLine: false, |
||||
// 对象字面量的括号之间打印空格 (true - Example: { foo: bar } ; false - Example: {foo:bar}) |
||||
bracketSpacing: true, |
||||
// 是否格式化一些文件中被嵌入的代码片段的风格(auto|off;默认auto) |
||||
embeddedLanguageFormatting: "auto", |
||||
// 指定 HTML 文件的空格敏感度 (css|strict|ignore;默认css) |
||||
htmlWhitespaceSensitivity: "css", |
||||
// 当文件已经被 Prettier 格式化之后,是否会在文件顶部插入一个特殊的 @format 标记,默认false |
||||
insertPragma: false, |
||||
// 在 JSX 中使用单引号替代双引号,默认false |
||||
jsxSingleQuote: false, |
||||
// 每行最多字符数量,超出换行(默认80) |
||||
printWidth: 80, |
||||
// 超出打印宽度 (always | never | preserve ) |
||||
proseWrap: "preserve", |
||||
// 对象属性是否使用引号(as-needed | consistent | preserve;默认as-needed:对象的属性需要加引号才添加;) |
||||
quoteProps: "as-needed", |
||||
// 是否只格式化在文件顶部包含特定注释(@prettier| @format)的文件,默认false |
||||
requirePragma: false, |
||||
// 结尾添加分号 |
||||
semi: true, |
||||
// 使用单引号 (true:单引号;false:双引号) |
||||
singleQuote: false, |
||||
// 缩进空格数,默认2个空格 |
||||
tabWidth: 2, |
||||
// 元素末尾是否加逗号,默认es5: ES5中的 objects, arrays 等会添加逗号,TypeScript 中的 type 后不加逗号 |
||||
trailingComma: "es5", |
||||
// 指定缩进方式,空格或tab,默认false,即使用空格 |
||||
useTabs: false, |
||||
// vue 文件中是否缩进 <style> 和 <script> 标签,默认 false |
||||
vueIndentScriptAndStyle: false, |
||||
|
||||
endOfLine: "auto", |
||||
overrides: [ |
||||
{ |
||||
files: "*.html", |
||||
options: { |
||||
parser: "html", |
||||
}, |
||||
}, |
||||
], |
||||
}; |
@ -0,0 +1,11 @@ |
||||
dist |
||||
node_modules |
||||
public |
||||
.husky |
||||
.vscode |
||||
.idea |
||||
*.sh |
||||
*.md |
||||
|
||||
src/assets |
||||
stats.html |
@ -0,0 +1,51 @@ |
||||
module.exports = { |
||||
// 继承推荐规范配置 |
||||
extends: [ |
||||
"stylelint-config-standard", |
||||
"stylelint-config-recommended-scss", |
||||
"stylelint-config-recommended-vue/scss", |
||||
"stylelint-config-html/vue", |
||||
"stylelint-config-recess-order", |
||||
], |
||||
// 指定不同文件对应的解析器 |
||||
overrides: [ |
||||
{ |
||||
files: ["**/*.{vue,html}"], |
||||
customSyntax: "postcss-html", |
||||
}, |
||||
{ |
||||
files: ["**/*.{css,scss}"], |
||||
customSyntax: "postcss-scss", |
||||
}, |
||||
], |
||||
// 自定义规则 |
||||
rules: { |
||||
"import-notation": "string", // 指定导入CSS文件的方式("string"|"url") |
||||
"selector-class-pattern": null, // 选择器类名命名规则 |
||||
"custom-property-pattern": null, // 自定义属性命名规则 |
||||
"keyframes-name-pattern": null, // 动画帧节点样式命名规则 |
||||
"no-descending-specificity": null, // 允许无降序特异性 |
||||
"no-empty-source": null, // 允许空样式 |
||||
// 允许 global 、export 、deep伪类 |
||||
"selector-pseudo-class-no-unknown": [ |
||||
true, |
||||
{ |
||||
ignorePseudoClasses: ["global", "export", "deep"], |
||||
}, |
||||
], |
||||
// 允许未知属性 |
||||
"property-no-unknown": [ |
||||
true, |
||||
{ |
||||
ignoreProperties: [], |
||||
}, |
||||
], |
||||
// 允许未知规则 |
||||
"at-rule-no-unknown": [ |
||||
true, |
||||
{ |
||||
ignoreAtRules: ["apply", "use"], |
||||
}, |
||||
], |
||||
}, |
||||
}; |
@ -0,0 +1,11 @@ |
||||
{ |
||||
"recommendations": [ |
||||
"vue.volar", |
||||
"antfu.unocss", |
||||
"lokalise.i18n-ally", |
||||
"dbaeumer.vscode-eslint", |
||||
"esbenp.prettier-vscode", |
||||
"stylelint.vscode-stylelint", |
||||
"editorconfig.editorconfig" |
||||
] |
||||
} |
@ -0,0 +1,80 @@ |
||||
{ |
||||
"typescript.tsdk": "./node_modules/typescript/lib", |
||||
"npm.packageManager": "pnpm", |
||||
"editor.tabSize": 2, |
||||
"editor.formatOnSave": true, |
||||
"editor.defaultFormatter": "esbenp.prettier-vscode", |
||||
"editor.quickSuggestions": { |
||||
"other": true, |
||||
"comments": true, |
||||
"strings": true |
||||
}, |
||||
"editor.codeActionsOnSave": { |
||||
"source.fixAll": "explicit", |
||||
"source.fixAll.eslint": "explicit", |
||||
"source.fixAll.stylelint": "explicit" |
||||
}, |
||||
"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 |
||||
}, |
||||
"i18n-ally.keystyle": "nested", |
||||
"i18n-ally.sortKeys": true, |
||||
"i18n-ally.namespace": false, |
||||
"i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}", |
||||
"i18n-ally.enabledParsers": ["ts"], |
||||
"i18n-ally.sourceLanguage": "en", |
||||
"i18n-ally.displayLanguage": "zh-CN", |
||||
"i18n-ally.enabledFrameworks": [ |
||||
"vue", |
||||
"react" |
||||
], |
||||
"i18n-ally.localesPaths": [ |
||||
"src/lang" |
||||
], |
||||
} |
@ -0,0 +1,49 @@ |
||||
|
||||
## 项目启动 |
||||
|
||||
```bash |
||||
|
||||
# 安装依赖 |
||||
pnpm install |
||||
|
||||
# 启动运行 |
||||
pnpm run dev |
||||
``` |
||||
|
||||
|
||||
|
||||
## 项目部署 |
||||
|
||||
```bash |
||||
# 项目打包 |
||||
pnpm run build:prod |
||||
|
||||
# 上传文件至远程服务器 |
||||
将打包生成在 `dist` 目录下的文件拷贝至 `/usr/share/nginx/html` 目录 |
||||
|
||||
# nginx.cofig 配置 |
||||
server { |
||||
listen 80; |
||||
server_name localhost; |
||||
location / { |
||||
root /usr/share/nginx/html; |
||||
index index.html index.htm; |
||||
} |
||||
# 反向代理配置 |
||||
location /prod-api/ { |
||||
proxy_pass http://vapi.youlai.tech/; # vapi.youlai.tech替换成你的后端API地址 |
||||
} |
||||
} |
||||
``` |
||||
|
||||
## 注意事项 |
||||
|
||||
- **自动导入插件自动生成默认关闭** |
||||
|
||||
模板项目的组件类型声明已自动生成。如果添加和使用新的组件,请按照图示方法开启自动生成。在自动生成完成后,记得将其设置为 `false`,避免重复执行引发冲突。 |
||||
|
||||
 |
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,62 @@ |
||||
<!doctype html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<link rel="icon" href="/favicon.ico" /> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||
<meta |
||||
name="description" |
||||
content="bellmann" |
||||
/> |
||||
<title>ITMS终端综合管理系统</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<div id="app"> |
||||
<div class="loader"></div> |
||||
</div> |
||||
</body> |
||||
<script type="module" src="/src/main.ts"></script> |
||||
|
||||
<style> |
||||
html, |
||||
body, |
||||
#app { |
||||
position: relative; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
|
||||
.loader { |
||||
position: relative; |
||||
width: 40px; |
||||
aspect-ratio: 0.577; |
||||
overflow: hidden; |
||||
clip-path: polygon(0 0, 100% 100%, 0 100%, 100% 0); |
||||
animation: l19 2s infinite linear; |
||||
} |
||||
|
||||
.loader::before { |
||||
position: absolute; |
||||
inset: -150%; |
||||
content: ""; |
||||
background: repeating-conic-gradient( |
||||
from 30deg, |
||||
#ffabab 0 60deg, |
||||
#abe4ff 0 120deg, |
||||
#ff7373 0 180deg |
||||
); |
||||
animation: inherit; |
||||
animation-direction: reverse; |
||||
} |
||||
|
||||
@keyframes l19 { |
||||
100% { |
||||
transform: rotate(360deg); |
||||
} |
||||
} |
||||
</style> |
||||
</html> |
@ -0,0 +1,120 @@ |
||||
{ |
||||
"name": "ITMS终端综合管理系统", |
||||
"version": "2.9.2", |
||||
"private": true, |
||||
"type": "module", |
||||
"scripts": { |
||||
"preinstall": "npx only-allow pnpm", |
||||
"dev": "vite serve --mode development", |
||||
"build:prod": "vite build --mode production && vue-tsc --noEmit", |
||||
"prepare": "husky install", |
||||
"lint:eslint": "eslint --fix --ext .ts,.js,.vue ./src ", |
||||
"lint:prettier": "prettier --write \"**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}\"", |
||||
"lint:stylelint": "stylelint \"**/*.{css,scss,vue}\" --fix", |
||||
"lint:lint-staged": "lint-staged", |
||||
"commit": "git-cz" |
||||
}, |
||||
"config": { |
||||
"commitizen": { |
||||
"path": "node_modules/cz-git" |
||||
} |
||||
}, |
||||
"lint-staged": { |
||||
"*.{js,ts}": [ |
||||
"eslint --fix", |
||||
"prettier --write" |
||||
], |
||||
"*.{cjs,json}": [ |
||||
"prettier --write" |
||||
], |
||||
"*.{vue,html}": [ |
||||
"eslint --fix", |
||||
"prettier --write", |
||||
"stylelint --fix" |
||||
], |
||||
"*.{scss,css}": [ |
||||
"stylelint --fix", |
||||
"prettier --write" |
||||
], |
||||
"*.md": [ |
||||
"prettier --write" |
||||
] |
||||
}, |
||||
"dependencies": { |
||||
"@element-plus/icons-vue": "^2.3.1", |
||||
"@vueuse/core": "^10.9.0", |
||||
"@wangeditor/editor": "^5.1.23", |
||||
"@wangeditor/editor-for-vue": "5.1.10", |
||||
"animate.css": "^4.1.1", |
||||
"axios": "^1.6.7", |
||||
"echarts": "^5.5.0", |
||||
"element-plus": "^2.6.0", |
||||
"lodash-es": "^4.17.21", |
||||
"net": "^1.0.2", |
||||
"nprogress": "^0.2.0", |
||||
"path-browserify": "^1.0.1", |
||||
"path-to-regexp": "^6.2.1", |
||||
"pinia": "^2.1.7", |
||||
"sockjs-client": "1.6.1", |
||||
"sortablejs": "^1.15.2", |
||||
"stompjs": "^2.3.3", |
||||
"vue": "^3.4.21", |
||||
"vue-i18n": "9.9.1", |
||||
"vue-router": "^4.3.0", |
||||
"xlsx": "^0.18.5" |
||||
}, |
||||
"devDependencies": { |
||||
"@commitlint/cli": "^18.6.1", |
||||
"@commitlint/config-conventional": "^18.6.2", |
||||
"@iconify-json/ep": "^1.1.14", |
||||
"@types/lodash": "^4.14.202", |
||||
"@types/node": "^20.11.24", |
||||
"@types/nprogress": "^0.2.3", |
||||
"@types/path-browserify": "^1.0.2", |
||||
"@types/sockjs-client": "^1.5.4", |
||||
"@types/sortablejs": "^1.15.8", |
||||
"@types/stompjs": "^2.3.9", |
||||
"@typescript-eslint/eslint-plugin": "^7.1.1", |
||||
"@typescript-eslint/parser": "^7.1.1", |
||||
"@vitejs/plugin-vue": "^5.0.4", |
||||
"@vitejs/plugin-vue-jsx": "^3.1.0", |
||||
"autoprefixer": "^10.4.18", |
||||
"commitizen": "^4.3.0", |
||||
"cz-git": "^1.9.0", |
||||
"eslint": "^8.57.0", |
||||
"eslint-config-prettier": "^9.1.0", |
||||
"eslint-plugin-import": "^2.29.1", |
||||
"eslint-plugin-prettier": "^5.1.3", |
||||
"eslint-plugin-vue": "^9.22.0", |
||||
"fast-glob": "^3.3.2", |
||||
"husky": "^9.0.11", |
||||
"lint-staged": "^15.2.2", |
||||
"postcss": "^8.4.35", |
||||
"postcss-html": "^1.6.0", |
||||
"postcss-scss": "^4.0.9", |
||||
"prettier": "^3.2.5", |
||||
"sass": "^1.71.1", |
||||
"stylelint": "^16.2.1", |
||||
"stylelint-config-html": "^1.1.0", |
||||
"stylelint-config-recess-order": "^4.6.0", |
||||
"stylelint-config-recommended-scss": "^14.0.0", |
||||
"stylelint-config-recommended-vue": "^1.5.0", |
||||
"stylelint-config-standard": "^36.0.0", |
||||
"terser": "^5.28.1", |
||||
"typescript": "^5.3.3", |
||||
"unocss": "^0.58.5", |
||||
"unplugin-auto-import": "^0.17.5", |
||||
"unplugin-icons": "^0.18.5", |
||||
"unplugin-vue-components": "^0.26.0", |
||||
"vite": "^5.1.5", |
||||
"vite-plugin-mock-dev-server": "^1.4.7", |
||||
"vite-plugin-svg-icons": "^2.0.1", |
||||
"vue-tsc": "^2.0.4" |
||||
}, |
||||
"repository": "https://bellmann.com", |
||||
"author": "bellmann", |
||||
"license": "MIT", |
||||
"engines": { |
||||
"node": ">=18.0.0" |
||||
} |
||||
} |
After Width: | Height: | Size: 9.1 KiB |
@ -0,0 +1,39 @@ |
||||
<template> |
||||
<el-config-provider :locale="locale" :size="size"> |
||||
<!-- 开启水印 --> |
||||
<el-watermark |
||||
v-if="watermarkEnabled" |
||||
:font="{ color: fontColor }" |
||||
:content="defaultSettings.watermarkContent" |
||||
class="wh-full" |
||||
> |
||||
<router-view /> |
||||
</el-watermark> |
||||
<!-- 关闭水印 --> |
||||
<router-view v-else /> |
||||
</el-config-provider> |
||||
</template> |
||||
|
||||
<script setup lang="ts"> |
||||
import { useAppStore, useSettingsStore } from "@/store"; |
||||
import defaultSettings from "@/settings"; |
||||
import { ThemeEnum } from "@/enums/ThemeEnum"; |
||||
|
||||
const appStore = useAppStore(); |
||||
const settingsStore = useSettingsStore(); |
||||
|
||||
const locale = computed(() => appStore.locale); |
||||
const size = computed(() => appStore.size); |
||||
const watermarkEnabled = computed(() => settingsStore.watermarkEnabled); |
||||
|
||||
// 明亮/暗黑主题水印字体颜色适配 |
||||
const fontColor = computed(() => { |
||||
return settingsStore.theme === ThemeEnum.DARK |
||||
? "rgba(255, 255, 255, .15)" |
||||
: "rgba(0, 0, 0, .15)"; |
||||
}); |
||||
</script> |
||||
|
||||
<style> |
||||
|
||||
</style> |
@ -0,0 +1,88 @@ |
||||
import request from "@/utils/request"; |
||||
|
||||
export interface ArticleQuery { |
||||
page?: number; |
||||
limit?: number; |
||||
sort?: string; |
||||
title?: string; |
||||
type?: string; |
||||
importance?: number; |
||||
} |
||||
|
||||
export interface ArticleDetail { |
||||
id: number; |
||||
timestamp: number; |
||||
title: string; |
||||
type: string; |
||||
status: string; |
||||
importance: number; |
||||
content?: string; |
||||
remark?: string; |
||||
} |
||||
|
||||
export interface ArticleCreate { |
||||
type: string; |
||||
timestamp: Date; |
||||
title: string; |
||||
status?: string; |
||||
importance?: number; |
||||
remark?: string; |
||||
} |
||||
|
||||
export interface ArticleUpdate { |
||||
id: number; |
||||
type?: string; |
||||
timestamp?: Date; |
||||
title?: string; |
||||
status?: string; |
||||
importance?: number; |
||||
remark?: string; |
||||
} |
||||
|
||||
export function fetchList(query: ArticleQuery) { |
||||
return request({ |
||||
url: "/api/v1/article/list", |
||||
method: "get", |
||||
params: query, |
||||
}); |
||||
} |
||||
|
||||
export function fetchArticle(id: number) { |
||||
return request({ |
||||
url: "/api/v1/article/detail", |
||||
method: "get", |
||||
params: { id }, |
||||
}); |
||||
} |
||||
|
||||
export function fetchPv(id: number) { |
||||
return request({ |
||||
url: "/api/v1/article/pv", |
||||
method: "get", |
||||
params: { id }, |
||||
}); |
||||
} |
||||
|
||||
export function createArticle(data: ArticleCreate) { |
||||
return request({ |
||||
url: "/api/v1/article/create", |
||||
method: "post", |
||||
data, |
||||
}); |
||||
} |
||||
|
||||
export function updateArticle(data: ArticleUpdate) { |
||||
return request({ |
||||
url: "/api/v1/article/update", |
||||
method: "post", |
||||
data, |
||||
}); |
||||
} |
||||
|
||||
export function deleteArticle(id: number) { |
||||
return request({ |
||||
url: "/api/v1/article/delete", |
||||
method: "post", |
||||
data: { id }, |
||||
}); |
||||
} |
@ -0,0 +1,45 @@ |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
import { CaptchaResult, LoginData, LoginResult } from "./types"; |
||||
|
||||
/** |
||||
* 登录API |
||||
* |
||||
* @param data {LoginData} |
||||
* @returns |
||||
*/ |
||||
export function loginApi(data: LoginData): AxiosPromise<LoginResult> { |
||||
const formData = new FormData(); |
||||
formData.append("username", data.username); |
||||
formData.append("password", data.password); |
||||
formData.append("captchaKey", data.captchaKey || ""); |
||||
formData.append("captchaCode", data.captchaCode || ""); |
||||
return request({ |
||||
url: "/api/v1/auth/login", |
||||
method: "post", |
||||
data: formData, |
||||
headers: { |
||||
"Content-Type": "multipart/form-data", |
||||
}, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 注销API |
||||
*/ |
||||
export function logoutApi() { |
||||
return request({ |
||||
url: "/api/v1/auth/logout", |
||||
method: "delete", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取验证码 |
||||
*/ |
||||
export function getCaptchaApi(): AxiosPromise<CaptchaResult> { |
||||
return request({ |
||||
url: "/api/v1/auth/captcha", |
||||
method: "get", |
||||
}); |
||||
} |
@ -0,0 +1,59 @@ |
||||
/** |
||||
* 登录请求参数 |
||||
*/ |
||||
export interface LoginData { |
||||
/** |
||||
* 用户名 |
||||
*/ |
||||
username: string; |
||||
/** |
||||
* 密码 |
||||
*/ |
||||
password: string; |
||||
|
||||
/** |
||||
* 验证码缓存key |
||||
*/ |
||||
captchaKey?: string; |
||||
|
||||
/** |
||||
* 验证码 |
||||
*/ |
||||
captchaCode?: string; |
||||
} |
||||
|
||||
/** |
||||
* 登录响应 |
||||
*/ |
||||
export interface LoginResult { |
||||
/** |
||||
* 访问token |
||||
*/ |
||||
accessToken?: string; |
||||
/** |
||||
* 过期时间(单位:毫秒) |
||||
*/ |
||||
expires?: number; |
||||
/** |
||||
* 刷新token |
||||
*/ |
||||
refreshToken?: string; |
||||
/** |
||||
* token 类型 |
||||
*/ |
||||
tokenType?: string; |
||||
} |
||||
|
||||
/** |
||||
* 验证码响应 |
||||
*/ |
||||
export interface CaptchaResult { |
||||
/** |
||||
* 验证码缓存key |
||||
*/ |
||||
captchaKey: string; |
||||
/** |
||||
* 验证码图片Base64字符串 |
||||
*/ |
||||
captchaBase64: string; |
||||
} |
@ -0,0 +1,77 @@ |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
import { DeptForm, DeptQuery, DeptVO } from "./types"; |
||||
|
||||
/** |
||||
* 部门树形表格 |
||||
* |
||||
* @param queryParams |
||||
*/ |
||||
export function listDepts(queryParams?: DeptQuery): AxiosPromise<DeptVO[]> { |
||||
return request({ |
||||
url: "/api/v1/dept", |
||||
method: "get", |
||||
params: queryParams, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 部门下拉列表 |
||||
*/ |
||||
export function getDeptOptions(): AxiosPromise<OptionType[]> { |
||||
return request({ |
||||
url: "/api/v1/dept/options", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取部门详情 |
||||
* |
||||
* @param id |
||||
*/ |
||||
export function getDeptForm(id: number): AxiosPromise<DeptForm> { |
||||
return request({ |
||||
url: "/api/v1/dept/" + id + "/form", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 新增部门 |
||||
* |
||||
* @param data |
||||
*/ |
||||
export function addDept(data: DeptForm) { |
||||
return request({ |
||||
url: "/api/v1/dept", |
||||
method: "post", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 修改部门 |
||||
* |
||||
* @param id |
||||
* @param data |
||||
*/ |
||||
export function updateDept(id: number, data: DeptForm) { |
||||
return request({ |
||||
url: "/api/v1/dept/" + id, |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除部门 |
||||
* |
||||
* @param ids |
||||
*/ |
||||
export function deleteDept(ids: string) { |
||||
return request({ |
||||
url: "/api/v1/dept/" + ids, |
||||
method: "delete", |
||||
}); |
||||
} |
@ -0,0 +1,71 @@ |
||||
/** |
||||
* 部门查询参数 |
||||
*/ |
||||
export interface DeptQuery { |
||||
keywords?: string; |
||||
status?: number; |
||||
} |
||||
|
||||
/** |
||||
* 部门类型 |
||||
*/ |
||||
export interface DeptVO { |
||||
/** |
||||
* 子部门 |
||||
*/ |
||||
children?: DeptVO[]; |
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
createTime?: Date; |
||||
/** |
||||
* 部门ID |
||||
*/ |
||||
id?: number; |
||||
/** |
||||
* 部门名称 |
||||
*/ |
||||
name?: string; |
||||
/** |
||||
* 父部门ID |
||||
*/ |
||||
parentId?: number; |
||||
/** |
||||
* 排序 |
||||
*/ |
||||
sort?: number; |
||||
/** |
||||
* 状态(1:启用;0:禁用) |
||||
*/ |
||||
status?: number; |
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
updateTime?: Date; |
||||
} |
||||
|
||||
/** |
||||
* 部门表单类型 |
||||
*/ |
||||
export interface DeptForm { |
||||
/** |
||||
* 部门ID(新增不填) |
||||
*/ |
||||
id?: number; |
||||
/** |
||||
* 部门名称 |
||||
*/ |
||||
name?: string; |
||||
/** |
||||
* 父部门ID |
||||
*/ |
||||
parentId: number; |
||||
/** |
||||
* 排序 |
||||
*/ |
||||
sort?: number; |
||||
/** |
||||
* 状态(1:启用;0:禁用) |
||||
*/ |
||||
status?: number; |
||||
} |
@ -0,0 +1,69 @@ |
||||
import { |
||||
DeviceTypeToVerPageResult, |
||||
DeviceTypeToVerQuery, |
||||
DeviceTypeVerForm, |
||||
} from "@/api/device-type-ver/types"; |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
|
||||
export function deviceTypeToVerPage( |
||||
data: DeviceTypeToVerQuery |
||||
): AxiosPromise<DeviceTypeToVerPageResult> { |
||||
return request({ |
||||
url: "/api/device-type-ver/v1/device-type/page", |
||||
method: "POST", |
||||
data, |
||||
}); |
||||
} |
||||
|
||||
export function updateTypeAndVersionState(typeAndVerId: number) { |
||||
return request({ |
||||
url: `/api/device-type-ver/v1/audit-soft-state/${typeAndVerId}`, |
||||
method: "PUT", |
||||
}); |
||||
} |
||||
|
||||
export function updateTypeNewSoftState(typeAndVerId: number) { |
||||
return request({ |
||||
url: `/api/device-type-ver/v1/audit-new-soft-state/${typeAndVerId}`, |
||||
method: "PUT", |
||||
}); |
||||
} |
||||
|
||||
export function copySoftVerToOtherOui(devTypeId: any, typeAndVerId: number) { |
||||
return request({ |
||||
url: `/api/device-type-ver/v1/audit-new-soft-state/${typeAndVerId}/${devTypeId}`, |
||||
method: "PUT", |
||||
}); |
||||
} |
||||
export function deleteDeviceTypeVersionById(typeAndVerId: number) { |
||||
return request({ |
||||
url: `/api/device-type-ver/v1/delete-device-type/${typeAndVerId}`, |
||||
method: "DELETE", |
||||
}); |
||||
} |
||||
export function deleteDeviceTypeVersionFile( |
||||
typeAndVerId: number, |
||||
fileId: number |
||||
) { |
||||
return request({ |
||||
url: `/api/device-type-ver/v1/delete-device-ver-file/${typeAndVerId}/${fileId}`, |
||||
method: "DELETE", |
||||
}); |
||||
} |
||||
export function findDevTypeVerEditForm( |
||||
typeAndVerId: number |
||||
): AxiosPromise<DeviceTypeVerForm> { |
||||
return request({ |
||||
url: `/api/device-type-ver/v1/find-dev-type-ver-edit-form/${typeAndVerId}`, |
||||
method: "GET", |
||||
}); |
||||
} |
||||
|
||||
export function editDevTypeVerForm(data: DeviceTypeVerForm) { |
||||
return request({ |
||||
url: "/api/device-type-ver/v1/edit-dev-type-ver-form", |
||||
method: "POST", |
||||
data, |
||||
}); |
||||
} |
@ -0,0 +1,33 @@ |
||||
export interface DeviceTypeToVerQuery extends PageQuery { |
||||
devTypeId?: number; |
||||
} |
||||
export interface DeviceTypeToVerVO { |
||||
typeAndVerId?: number; |
||||
softVer?: string; |
||||
fileName?: string; |
||||
fileId?: string; |
||||
fileCreateTime?: string; |
||||
auditTime?: string; |
||||
auditUserName?: string; |
||||
devTypeVerStatus?: string; |
||||
newSoftStatus?: string; |
||||
} |
||||
export type DeviceTypeToVerPageResult = PageResult<DeviceTypeToVerVO[]>; |
||||
|
||||
export interface DeviceTypeVerForm { |
||||
typeAndVerId?: number; |
||||
softVer?: string; |
||||
auditTime?: string; |
||||
auditUserName?: string; |
||||
connectReqUsername?: string; |
||||
connectReqPassword?: string; |
||||
acsUrlPassword?: string; |
||||
devTypeVerDesc?: string; |
||||
provisionFlag?: string; |
||||
devAccessType?: string; |
||||
devTypeName?: string; |
||||
devTypeNameNew?: string; |
||||
oldCASeparation?: string; |
||||
specVer?: string; |
||||
} |
||||
|
@ -0,0 +1,24 @@ |
||||
import { |
||||
DeviceTypePageResult, |
||||
DeviceTypeQuery, |
||||
DeviceTypeVO, |
||||
} from "@/api/device-type/types"; |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
|
||||
export function getDeviceTypePage( |
||||
data: DeviceTypeQuery |
||||
): AxiosPromise<DeviceTypePageResult> { |
||||
return request({ |
||||
url: "/api/dev-type/v1/page", |
||||
method: "POST", |
||||
data, |
||||
}); |
||||
} |
||||
|
||||
export function findDevTypeById(devTypeId: number): AxiosPromise<DeviceTypeVO> { |
||||
return request({ |
||||
url: `/api/dev-type/v1/${devTypeId}`, |
||||
method: "GET", |
||||
}); |
||||
} |
@ -0,0 +1,31 @@ |
||||
import { DictTypePageVO } from "@/api/dict/types"; |
||||
|
||||
export interface DeviceTypeQuery extends PageQuery { |
||||
devVendorName?: string; |
||||
devVendorOui?: string; |
||||
devTypeName?: string; |
||||
devHardVer?: string; |
||||
} |
||||
|
||||
export interface DeviceTypePageVO { |
||||
devTypeId?: number; |
||||
devVendorName?: string; |
||||
devVendorOui?: string; |
||||
devTypeName?: string; |
||||
devHardVer?: string; |
||||
typeAndVerId?: number; |
||||
devTypeVerStatus?: string; |
||||
tr069VerName?: string; |
||||
devTypeNameNew?: string; |
||||
softVer?: string; |
||||
} |
||||
export type DeviceTypePageResult = PageResult<DeviceTypePageVO[]>; |
||||
|
||||
export interface DeviceTypeVO { |
||||
devTypeId?: number; |
||||
devVendorName?: string; |
||||
devVendorOui?: string; |
||||
devTypeName?: string; |
||||
devHardVer?: string; |
||||
devTypeDesc?: string; |
||||
} |
@ -0,0 +1,150 @@ |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
import { |
||||
DictTypeQuery, |
||||
DictTypePageResult, |
||||
DictTypeForm, |
||||
DictQuery, |
||||
DictForm, |
||||
DictPageResult, |
||||
} from "./types"; |
||||
|
||||
/** |
||||
* 字典类型分页列表 |
||||
* |
||||
* @param queryParams |
||||
*/ |
||||
export function getDictTypePage( |
||||
queryParams: DictTypeQuery |
||||
): AxiosPromise<DictTypePageResult> { |
||||
return request({ |
||||
url: "/api/v1/dict/types/page", |
||||
method: "get", |
||||
params: queryParams, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 字典类型表单数据 |
||||
* |
||||
* @param id |
||||
*/ |
||||
export function getDictTypeForm(id: number): AxiosPromise<DictTypeForm> { |
||||
return request({ |
||||
url: "/api/v1/dict/types/" + id + "/form", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 新增字典类型 |
||||
* |
||||
* @param data |
||||
*/ |
||||
export function addDictType(data: DictTypeForm) { |
||||
return request({ |
||||
url: "/api/v1/dict/types", |
||||
method: "post", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 修改字典类型 |
||||
* |
||||
* @param id |
||||
* @param data |
||||
*/ |
||||
export function updateDictType(id: number, data: DictTypeForm) { |
||||
return request({ |
||||
url: "/api/v1/dict/types/" + id, |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除字典类型 |
||||
*/ |
||||
export function deleteDictTypes(ids: string) { |
||||
return request({ |
||||
url: "/api/v1/dict/types/" + ids, |
||||
method: "delete", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取字典类型的数据项 |
||||
* |
||||
* @param typeCode 字典类型编码 |
||||
*/ |
||||
export function getDictOptions(typeCode: string): AxiosPromise<OptionType[]> { |
||||
return request({ |
||||
url: "/api/v1/dict/" + typeCode + "/options", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 字典分页列表 |
||||
*/ |
||||
export function getDictPage( |
||||
queryParams: DictQuery |
||||
): AxiosPromise<DictPageResult> { |
||||
return request({ |
||||
url: "/api/v1/dict/page", |
||||
method: "get", |
||||
params: queryParams, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取字典表单数据 |
||||
* |
||||
* @param id |
||||
*/ |
||||
export function getDictFormData(id: number): AxiosPromise<DictForm> { |
||||
return request({ |
||||
url: "/api/v1/dict/" + id + "/form", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 新增字典 |
||||
* |
||||
* @param data |
||||
*/ |
||||
export function addDict(data: DictForm) { |
||||
return request({ |
||||
url: "/api/v1/dict", |
||||
method: "post", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 修改字典项 |
||||
* |
||||
* @param id |
||||
* @param data |
||||
*/ |
||||
export function updateDict(id: number, data: DictForm) { |
||||
return request({ |
||||
url: "/api/v1/dict/" + id, |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除字典 |
||||
* |
||||
* @param ids 字典项ID,多个以英文逗号(,)分割 |
||||
*/ |
||||
export function deleteDict(ids: string) { |
||||
return request({ |
||||
url: "/api/v1/dict/" + ids, |
||||
method: "delete", |
||||
}); |
||||
} |
@ -0,0 +1,142 @@ |
||||
/** |
||||
* 字典类型查询参数 |
||||
*/ |
||||
export interface DictTypeQuery extends PageQuery { |
||||
/** |
||||
* 关键字(字典类型名称/编码) |
||||
*/ |
||||
keywords?: string; |
||||
} |
||||
|
||||
/** |
||||
* 字典类型分页对象 |
||||
*/ |
||||
export interface DictTypePageVO { |
||||
/** |
||||
* 字典类型ID |
||||
*/ |
||||
id: number; |
||||
/** |
||||
* 类型编码 |
||||
*/ |
||||
code: string; |
||||
/** |
||||
* 类型名称 |
||||
*/ |
||||
name: string; |
||||
/** |
||||
* 状态(1:启用;0:禁用) |
||||
*/ |
||||
status?: number; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
remark?: string; |
||||
} |
||||
|
||||
/** |
||||
* 字典分页项类型声明 |
||||
*/ |
||||
export type DictTypePageResult = PageResult<DictTypePageVO[]>; |
||||
|
||||
/** |
||||
* 字典表单类型声明 |
||||
*/ |
||||
export interface DictTypeForm { |
||||
/** |
||||
* 字典类型ID |
||||
*/ |
||||
id?: number; |
||||
/** |
||||
* 类型名称 |
||||
*/ |
||||
name?: string; |
||||
/** |
||||
* 类型编码 |
||||
*/ |
||||
code?: string; |
||||
/** |
||||
* 类型状态:1:启用;0:禁用 |
||||
*/ |
||||
status: number; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
remark?: string; |
||||
} |
||||
|
||||
/** |
||||
* 字典查询参数 |
||||
*/ |
||||
export interface DictQuery extends PageQuery { |
||||
/** |
||||
* 字典项名称 |
||||
*/ |
||||
name?: string; |
||||
/** |
||||
* 字典类型编码 |
||||
*/ |
||||
typeCode?: string; |
||||
} |
||||
|
||||
/** |
||||
* 字典分页对象 |
||||
*/ |
||||
export interface DictPageVO { |
||||
/** |
||||
* 字典ID |
||||
*/ |
||||
id?: number; |
||||
/** |
||||
* 字典名称 |
||||
*/ |
||||
name?: string; |
||||
/** |
||||
* 状态(1:启用;0:禁用) |
||||
*/ |
||||
status?: number; |
||||
/** |
||||
* 字典值 |
||||
*/ |
||||
value?: string; |
||||
} |
||||
|
||||
/** |
||||
* 字典分页 |
||||
*/ |
||||
export type DictPageResult = PageResult<DictPageVO[]>; |
||||
|
||||
/** |
||||
* 字典表单 |
||||
*/ |
||||
export interface DictForm { |
||||
/** |
||||
* 字典ID |
||||
*/ |
||||
id?: number; |
||||
/** |
||||
* 字典名称 |
||||
*/ |
||||
name?: string; |
||||
/** |
||||
* 排序 |
||||
*/ |
||||
sort?: number; |
||||
/** |
||||
* 状态(1:启用;0:禁用) |
||||
*/ |
||||
status?: number; |
||||
/** |
||||
* 类型编码 |
||||
*/ |
||||
typeCode?: string; |
||||
/** |
||||
* 值 |
||||
*/ |
||||
value?: string; |
||||
|
||||
/** |
||||
* 备注 |
||||
*/ |
||||
remark?: string; |
||||
} |
@ -0,0 +1,49 @@ |
||||
import { DomainForm, DomainQuery, DomainVo } from "@/api/domain/types"; |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
|
||||
export function getDomainList( |
||||
data: DomainQuery |
||||
): AxiosPromise<Array<DomainVo>> { |
||||
return request({ |
||||
url: "/api/domain/v1/list", |
||||
method: "POST", |
||||
data, |
||||
}); |
||||
} |
||||
|
||||
export function getDomainOptions(): AxiosPromise<OptionType[]> { |
||||
return request({ |
||||
url: "/api/domain/v1/options", |
||||
method: "GET", |
||||
}); |
||||
} |
||||
|
||||
export function addDomain(data: DomainForm) { |
||||
return request({ |
||||
url: "/api/domain/v1/add_domain", |
||||
method: "POST", |
||||
data, |
||||
}); |
||||
} |
||||
|
||||
export function editDomain(data: DomainForm) { |
||||
return request({ |
||||
url: "/api/domain/v1/edit_domain", |
||||
method: "POST", |
||||
data, |
||||
}); |
||||
} |
||||
export function deleteDomain(groupId: number) { |
||||
return request({ |
||||
url: `/api/domain/v1/${groupId}`, |
||||
method: "DELETE", |
||||
}); |
||||
} |
||||
|
||||
export function getDomainByGroupId(groupId: number): AxiosPromise<DomainForm> { |
||||
return request({ |
||||
url: `/api/domain/v1/${groupId}`, |
||||
method: "GET", |
||||
}); |
||||
} |
@ -0,0 +1,29 @@ |
||||
export interface DomainQuery extends PageQuery { |
||||
keywords?: string; |
||||
} |
||||
|
||||
export interface DomainVo { |
||||
id?: number; |
||||
|
||||
groupId?: number; |
||||
|
||||
groupName?: string; |
||||
|
||||
parentGroupId?: number; |
||||
|
||||
description?: string; |
||||
|
||||
children?: Array<DomainVo>; |
||||
} |
||||
|
||||
export interface DomainForm { |
||||
id?: number; |
||||
|
||||
groupId?: number; |
||||
|
||||
groupName?: string; |
||||
|
||||
parentGroupId?: number; |
||||
|
||||
description?: string; |
||||
} |
@ -0,0 +1,13 @@ |
||||
import { FileListPageResult, FileListQuery } from "@/api/file-list/types"; |
||||
import { AxiosPromise } from "axios"; |
||||
import request from "@/utils/request"; |
||||
|
||||
export function getPageData( |
||||
data: FileListQuery |
||||
): AxiosPromise<FileListPageResult> { |
||||
return request({ |
||||
url: "/api/file_list/v1/page", |
||||
method: "POST", |
||||
data, |
||||
}); |
||||
} |
@ -0,0 +1,43 @@ |
||||
import { FileServerVO } from "@/api/file-server/types"; |
||||
|
||||
export interface FileListQuery extends PageQuery { |
||||
fileName?: string; |
||||
fileType?: string; |
||||
fileServerId?: number | undefined; |
||||
} |
||||
|
||||
export interface FileListVO { |
||||
fileId?: number; |
||||
|
||||
/** |
||||
* 上传者 |
||||
*/ |
||||
userName?: string; |
||||
|
||||
/** |
||||
* 文件类型 |
||||
*/ |
||||
fileType?: string; |
||||
|
||||
/** |
||||
* 文件名称 |
||||
*/ |
||||
fileName?: string; |
||||
|
||||
/** |
||||
* 文件上传时间 |
||||
*/ |
||||
|
||||
fileCreateTime?: string; |
||||
|
||||
/** |
||||
* 文件描述 |
||||
*/ |
||||
fileDesc?: string; |
||||
|
||||
/** |
||||
* 文件服务器ID |
||||
*/ |
||||
fileServId?: number; |
||||
} |
||||
export type FileListPageResult = PageResult<FileListVO[]>; |
@ -0,0 +1,30 @@ |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
import { FileServerForm, FileServerPageResult } from "@/api/file-server/types"; |
||||
|
||||
export function getFileServerPage( |
||||
data: PageQuery |
||||
): AxiosPromise<FileServerPageResult> { |
||||
return request({ |
||||
url: "/api/file_server/v1/page", |
||||
method: "POST", |
||||
data, |
||||
}); |
||||
} |
||||
|
||||
export function findFileServerFormById( |
||||
id: number |
||||
): AxiosPromise<FileServerForm> { |
||||
return request({ |
||||
url: `/api/file_server/v1/${id}`, |
||||
method: "GET", |
||||
}); |
||||
} |
||||
|
||||
export function editFileServer(data: FileServerForm) { |
||||
return request({ |
||||
url: "/api/file_server/v1/edit", |
||||
method: "POST", |
||||
data, |
||||
}); |
||||
} |
@ -0,0 +1,39 @@ |
||||
import { DictTypePageVO } from "@/api/dict/types"; |
||||
|
||||
export interface FileServerVO { |
||||
fileServId?: number; |
||||
|
||||
fileServName?: string; |
||||
|
||||
supportMode?: string; |
||||
|
||||
ftpIp?: string; |
||||
|
||||
ftpPort?: string; |
||||
|
||||
ftpUserName?: string; |
||||
|
||||
ftpRootDir?: string; |
||||
} |
||||
|
||||
export type FileServerPageResult = PageResult<FileServerVO[]>; |
||||
|
||||
export interface FileServerForm { |
||||
fileServId?: number; |
||||
|
||||
fileServName?: string; |
||||
|
||||
supportMode?: string; |
||||
|
||||
ftpIp?: string; |
||||
|
||||
ftpPort?: string; |
||||
|
||||
ftpUserName?: string; |
||||
|
||||
ftpRootDir?: string; |
||||
|
||||
ftpVerifyPassword?: string; |
||||
|
||||
ftpPassword?: string; |
||||
} |
@ -0,0 +1,33 @@ |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
import { FileInfo } from "./types"; |
||||
|
||||
/** |
||||
* 上传文件 |
||||
* |
||||
* @param file |
||||
*/ |
||||
export function uploadFileApi(file: File): AxiosPromise<string> { |
||||
const formData = new FormData(); |
||||
formData.append("file", file); |
||||
return request({ |
||||
url: "/api/file-option/v1/upload", |
||||
method: "POST", |
||||
data: formData, |
||||
headers: { |
||||
"Content-Type": "multipart/form-data", |
||||
}, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 文件下载 |
||||
* @param fileId |
||||
*/ |
||||
export function downloadFileApi(fileId: number) { |
||||
return request({ |
||||
url: `/api/file-option/v1/download/${fileId}`, |
||||
method: "GET", |
||||
responseType: "blob", |
||||
}); |
||||
} |
@ -0,0 +1,7 @@ |
||||
/** |
||||
* 文件API类型声明 |
||||
*/ |
||||
export interface FileInfo { |
||||
name: string; |
||||
url: string; |
||||
} |
@ -0,0 +1,87 @@ |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
import { MenuQuery, MenuVO, MenuForm } from "./types"; |
||||
|
||||
/** |
||||
* 获取路由列表 |
||||
*/ |
||||
export function listRoutes() { |
||||
return request({ |
||||
url: "/api/v1/menus/routes", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取菜单树形列表 |
||||
* |
||||
* @param queryParams |
||||
*/ |
||||
export function listMenus(queryParams: MenuQuery): AxiosPromise<MenuVO[]> { |
||||
return request({ |
||||
url: "/api/v1/menus", |
||||
method: "get", |
||||
params: queryParams, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取菜单下拉树形列表 |
||||
*/ |
||||
export function getMenuOptions(): AxiosPromise<OptionType[]> { |
||||
return request({ |
||||
url: "/api/v1/menus/options", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取菜单表单数据 |
||||
* |
||||
* @param id |
||||
*/ |
||||
export function getMenuForm(id: number): AxiosPromise<MenuForm> { |
||||
return request({ |
||||
url: "/api/v1/menus/" + id + "/form", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 添加菜单 |
||||
* |
||||
* @param data |
||||
*/ |
||||
export function addMenu(data: MenuForm) { |
||||
return request({ |
||||
url: "/api/v1/menus", |
||||
method: "post", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 修改菜单 |
||||
* |
||||
* @param id |
||||
* @param data |
||||
*/ |
||||
export function updateMenu(id: string, data: MenuForm) { |
||||
return request({ |
||||
url: "/api/v1/menus/" + id, |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除菜单 |
||||
* |
||||
* @param id 菜单ID |
||||
*/ |
||||
export function deleteMenu(id: number) { |
||||
return request({ |
||||
url: "/api/v1/menus/" + id, |
||||
method: "delete", |
||||
}); |
||||
} |
@ -0,0 +1,124 @@ |
||||
import { MenuTypeEnum } from "@/enums/MenuTypeEnum"; |
||||
|
||||
/** |
||||
* 菜单查询参数类型 |
||||
*/ |
||||
export interface MenuQuery { |
||||
keywords?: string; |
||||
} |
||||
|
||||
/** |
||||
* 菜单视图对象类型 |
||||
*/ |
||||
export interface MenuVO { |
||||
/** |
||||
* 子菜单 |
||||
*/ |
||||
children?: MenuVO[]; |
||||
/** |
||||
* 组件路径 |
||||
*/ |
||||
component?: string; |
||||
/** |
||||
* ICON |
||||
*/ |
||||
icon?: string; |
||||
/** |
||||
* 菜单ID |
||||
*/ |
||||
id?: number; |
||||
/** |
||||
* 菜单名称 |
||||
*/ |
||||
name?: string; |
||||
/** |
||||
* 父菜单ID |
||||
*/ |
||||
parentId?: number; |
||||
/** |
||||
* 按钮权限标识 |
||||
*/ |
||||
perm?: string; |
||||
/** |
||||
* 跳转路径 |
||||
*/ |
||||
redirect?: string; |
||||
/** |
||||
* 路由名称 |
||||
*/ |
||||
routeName?: string; |
||||
/** |
||||
* 路由相对路径 |
||||
*/ |
||||
routePath?: string; |
||||
/** |
||||
* 菜单排序(数字越小排名越靠前) |
||||
*/ |
||||
sort?: number; |
||||
/** |
||||
* 菜单类型 |
||||
*/ |
||||
type?: MenuTypeEnum; |
||||
/** |
||||
* 菜单是否可见(1:显示;0:隐藏) |
||||
*/ |
||||
visible?: number; |
||||
} |
||||
|
||||
/** |
||||
* 菜单表单对象类型 |
||||
*/ |
||||
export interface MenuForm { |
||||
/** |
||||
* 菜单ID |
||||
*/ |
||||
id?: string; |
||||
/** |
||||
* 父菜单ID |
||||
*/ |
||||
parentId?: number; |
||||
/** |
||||
* 菜单名称 |
||||
*/ |
||||
name?: string; |
||||
/** |
||||
* 菜单是否可见(1:是;0:否;) |
||||
*/ |
||||
visible: number; |
||||
icon?: string; |
||||
/** |
||||
* 排序 |
||||
*/ |
||||
sort: number; |
||||
/** |
||||
* 组件路径 |
||||
*/ |
||||
component?: string; |
||||
/** |
||||
* 路由路径 |
||||
*/ |
||||
path?: string; |
||||
/** |
||||
* 跳转路由路径 |
||||
*/ |
||||
redirect?: string; |
||||
|
||||
/** |
||||
* 菜单类型 |
||||
*/ |
||||
type: MenuTypeEnum; |
||||
|
||||
/** |
||||
* 权限标识 |
||||
*/ |
||||
perm?: string; |
||||
/** |
||||
* 【菜单】是否开启页面缓存 |
||||
*/ |
||||
keepAlive?: number; |
||||
|
||||
/** |
||||
* 【目录】只有一个子路由是否始终显示 |
||||
*/ |
||||
alwaysShow?: number; |
||||
} |
@ -0,0 +1,112 @@ |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
import { RoleQuery, RolePageResult, RoleForm } from "./types"; |
||||
|
||||
/** |
||||
* 获取角色分页数据 |
||||
* |
||||
* @param queryParams |
||||
*/ |
||||
export function getRolePage( |
||||
queryParams?: RoleQuery |
||||
): AxiosPromise<RolePageResult> { |
||||
return request({ |
||||
url: "/api/v1/roles/page", |
||||
method: "get", |
||||
params: queryParams, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取角色下拉数据 |
||||
* |
||||
* @param queryParams |
||||
*/ |
||||
export function getRoleOptions( |
||||
queryParams?: RoleQuery |
||||
): AxiosPromise<OptionType[]> { |
||||
return request({ |
||||
url: "/api/v1/roles/options", |
||||
method: "get", |
||||
params: queryParams, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取角色的菜单ID集合 |
||||
* |
||||
* @param queryParams |
||||
*/ |
||||
export function getRoleMenuIds(roleId: number): AxiosPromise<number[]> { |
||||
return request({ |
||||
url: "/api/v1/roles/" + roleId + "/menuIds", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 分配菜单权限给角色 |
||||
* |
||||
* @param queryParams |
||||
*/ |
||||
export function updateRoleMenus( |
||||
roleId: number, |
||||
data: number[] |
||||
): AxiosPromise<any> { |
||||
return request({ |
||||
url: "/api/v1/roles/" + roleId + "/menus", |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取角色详情 |
||||
* |
||||
* @param id |
||||
*/ |
||||
export function getRoleForm(id: number): AxiosPromise<RoleForm> { |
||||
return request({ |
||||
url: "/api/v1/roles/" + id + "/form", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 添加角色 |
||||
* |
||||
* @param data |
||||
*/ |
||||
export function addRole(data: RoleForm) { |
||||
return request({ |
||||
url: "/api/v1/roles", |
||||
method: "post", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 更新角色 |
||||
* |
||||
* @param id |
||||
* @param data |
||||
*/ |
||||
export function updateRole(id: number, data: RoleForm) { |
||||
return request({ |
||||
url: "/api/v1/roles/" + id, |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除角色,多个以英文逗号(,)分割 |
||||
* |
||||
* @param ids |
||||
*/ |
||||
export function deleteRoles(ids: string) { |
||||
return request({ |
||||
url: "/api/v1/roles/" + ids, |
||||
method: "delete", |
||||
}); |
||||
} |
@ -0,0 +1,78 @@ |
||||
/** |
||||
* 角色查询参数 |
||||
*/ |
||||
export interface RoleQuery extends PageQuery { |
||||
keywords?: string; |
||||
} |
||||
|
||||
/** |
||||
* 角色分页对象 |
||||
*/ |
||||
export interface RolePageVO { |
||||
/** |
||||
* 角色编码 |
||||
*/ |
||||
code?: string; |
||||
|
||||
/** |
||||
* 角色ID |
||||
*/ |
||||
id?: number; |
||||
/** |
||||
* 角色名称 |
||||
*/ |
||||
name?: string; |
||||
/** |
||||
* 排序 |
||||
*/ |
||||
sort?: number; |
||||
/** |
||||
* 角色状态 |
||||
*/ |
||||
status?: number; |
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
createTime?: Date; |
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
updateTime?: Date; |
||||
} |
||||
|
||||
/** |
||||
* 角色分页 |
||||
*/ |
||||
export type RolePageResult = PageResult<RolePageVO[]>; |
||||
|
||||
/** |
||||
* 角色表单对象 |
||||
*/ |
||||
export interface RoleForm { |
||||
/** |
||||
* 角色ID |
||||
*/ |
||||
id?: number; |
||||
|
||||
/** |
||||
* 角色编码 |
||||
*/ |
||||
code: string; |
||||
/** |
||||
* 数据权限 |
||||
*/ |
||||
dataScope?: number; |
||||
|
||||
/** |
||||
* 角色名称 |
||||
*/ |
||||
name: string; |
||||
/** |
||||
* 排序 |
||||
*/ |
||||
sort?: number; |
||||
/** |
||||
* 角色状态(1-正常;0-停用) |
||||
*/ |
||||
status?: number; |
||||
} |
@ -0,0 +1,19 @@ |
||||
import { AxiosPromise } from "axios"; |
||||
import { CapabilityForm } from "@/api/type-ver-ext/types"; |
||||
import request from "@/utils/request"; |
||||
|
||||
export function getCapabilityForm( |
||||
typeAndVerId: string |
||||
): AxiosPromise<CapabilityForm> { |
||||
return request({ |
||||
url: `/api/type-ver-ext/v1/${typeAndVerId}`, |
||||
method: "GET", |
||||
}); |
||||
} |
||||
export function editCapabilityForm(data: CapabilityForm) { |
||||
return request({ |
||||
url: `/api/type-ver-ext/v1/edit`, |
||||
method: "POST", |
||||
data, |
||||
}); |
||||
} |
@ -0,0 +1,16 @@ |
||||
export interface CapabilityForm { |
||||
typeAndVerId?: string | number; |
||||
lanNumber?: string; |
||||
voipPortNumber?: string; |
||||
gePortNumber?: string; |
||||
fePortNumber?: string; |
||||
wifiType?: string; |
||||
wifiConfig?: string; |
||||
voipProtocol?: string; |
||||
capability?: string; |
||||
mesh?: string; |
||||
ywg?: string; |
||||
tr143?: string; |
||||
ipv6Enable?: string; |
||||
reboot?: string; |
||||
} |
@ -0,0 +1,140 @@ |
||||
import request from "@/utils/request"; |
||||
import { AxiosPromise } from "axios"; |
||||
import { UserForm, UserInfo, UserPageVO, UserQuery } from "./types"; |
||||
|
||||
/** |
||||
* 登录成功后获取用户信息(昵称、头像、权限集合和角色集合) |
||||
*/ |
||||
export function getUserInfoApi(): AxiosPromise<UserInfo> { |
||||
return request({ |
||||
url: "/api/v1/users/me", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取用户分页列表 |
||||
* |
||||
* @param queryParams |
||||
*/ |
||||
export function getUserPage( |
||||
queryParams: UserQuery |
||||
): AxiosPromise<PageResult<UserPageVO[]>> { |
||||
return request({ |
||||
url: "/api/v1/users/page", |
||||
method: "get", |
||||
params: queryParams, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 获取用户表单详情 |
||||
* |
||||
* @param userId |
||||
*/ |
||||
export function getUserForm(userId: number): AxiosPromise<UserForm> { |
||||
return request({ |
||||
url: "/api/v1/users/" + userId + "/form", |
||||
method: "get", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 添加用户 |
||||
* |
||||
* @param data |
||||
*/ |
||||
export function addUser(data: any) { |
||||
return request({ |
||||
url: "/api/v1/users", |
||||
method: "post", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 修改用户 |
||||
* |
||||
* @param id |
||||
* @param data |
||||
*/ |
||||
export function updateUser(id: number, data: UserForm) { |
||||
return request({ |
||||
url: "/api/v1/users/" + id, |
||||
method: "put", |
||||
data: data, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 修改用户密码 |
||||
* |
||||
* @param id |
||||
* @param password |
||||
*/ |
||||
export function updateUserPassword(id: number, password: string) { |
||||
return request({ |
||||
url: "/api/v1/users/" + id + "/password", |
||||
method: "patch", |
||||
params: { password: password }, |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 删除用户 |
||||
* |
||||
* @param ids |
||||
*/ |
||||
export function deleteUsers(ids: string) { |
||||
return request({ |
||||
url: "/api/v1/users/" + ids, |
||||
method: "delete", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 下载用户导入模板 |
||||
* |
||||
* @returns |
||||
*/ |
||||
export function downloadTemplateApi() { |
||||
return request({ |
||||
url: "/api/v1/users/template", |
||||
method: "get", |
||||
responseType: "arraybuffer", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 导出用户 |
||||
* |
||||
* @param queryParams |
||||
* @returns |
||||
*/ |
||||
export function exportUser(queryParams: UserQuery) { |
||||
return request({ |
||||
url: "/api/v1/users/_export", |
||||
method: "get", |
||||
params: queryParams, |
||||
responseType: "arraybuffer", |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 导入用户 |
||||
* |
||||
* @param file |
||||
*/ |
||||
export function importUser(deptId: number, file: File) { |
||||
const formData = new FormData(); |
||||
formData.append("file", file); |
||||
return request({ |
||||
url: "/api/v1/users/_import", |
||||
method: "post", |
||||
params: { deptId: deptId }, |
||||
data: formData, |
||||
headers: { |
||||
"Content-Type": "multipart/form-data", |
||||
}, |
||||
}); |
||||
} |
@ -0,0 +1,124 @@ |
||||
/** |
||||
* 登录用户信息 |
||||
*/ |
||||
export interface UserInfo { |
||||
userId?: number; |
||||
username?: string; |
||||
nickname?: string; |
||||
avatar?: string; |
||||
roles: string[]; |
||||
perms: string[]; |
||||
} |
||||
|
||||
/** |
||||
* 用户查询对象类型 |
||||
*/ |
||||
export interface UserQuery extends PageQuery { |
||||
keywords?: string; |
||||
status?: number; |
||||
deptId?: number; |
||||
startTime?: string; |
||||
endTime?: string; |
||||
groupId?: number; |
||||
} |
||||
|
||||
/** |
||||
* 用户分页对象 |
||||
*/ |
||||
export interface UserPageVO { |
||||
/** |
||||
* 用户头像地址 |
||||
*/ |
||||
avatar?: string; |
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
createTime?: Date; |
||||
/** |
||||
* 部门名称 |
||||
*/ |
||||
deptName?: string; |
||||
/** |
||||
* 用户邮箱 |
||||
*/ |
||||
email?: string; |
||||
/** |
||||
* 性别 |
||||
*/ |
||||
genderLabel?: string; |
||||
/** |
||||
* 用户ID |
||||
*/ |
||||
id?: number; |
||||
/** |
||||
* 手机号 |
||||
*/ |
||||
mobile?: string; |
||||
/** |
||||
* 用户昵称 |
||||
*/ |
||||
nickname?: string; |
||||
/** |
||||
* 角色名称,多个使用英文逗号(,)分割 |
||||
*/ |
||||
roleNames?: string; |
||||
/** |
||||
* 用户状态(1:启用;0:禁用) |
||||
*/ |
||||
status?: number; |
||||
/** |
||||
* 用户名 |
||||
*/ |
||||
username?: string; |
||||
/** |
||||
* xi |
||||
*/ |
||||
groupName?: string; |
||||
} |
||||
|
||||
/** |
||||
* 用户表单类型 |
||||
*/ |
||||
export interface UserForm { |
||||
/** |
||||
* 用户头像 |
||||
*/ |
||||
avatar?: string; |
||||
/** |
||||
* 部门ID |
||||
*/ |
||||
deptId?: number; |
||||
/** |
||||
* 邮箱 |
||||
*/ |
||||
email?: string; |
||||
/** |
||||
* 性别 |
||||
*/ |
||||
gender?: number; |
||||
/** |
||||
* 用户ID |
||||
*/ |
||||
id?: number; |
||||
mobile?: string; |
||||
/** |
||||
* 昵称 |
||||
*/ |
||||
nickname?: string; |
||||
/** |
||||
* 角色ID集合 |
||||
*/ |
||||
roleIds?: number[]; |
||||
/** |
||||
* 用户状态(1:正常;0:禁用) |
||||
*/ |
||||
status?: number; |
||||
/** |
||||
* 用户名 |
||||
*/ |
||||
username?: string; |
||||
/** |
||||
* 系统管理域 |
||||
*/ |
||||
domainGroupId?: number; |
||||
} |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 941 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 297 B |
After Width: | Height: | Size: 183 B |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 187 B |
After Width: | Height: | Size: 311 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 640 B |
After Width: | Height: | Size: 962 B |
After Width: | Height: | Size: 817 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 944 B |
After Width: | Height: | Size: 972 B |
After Width: | Height: | Size: 175 B |
After Width: | Height: | Size: 175 B |
After Width: | Height: | Size: 1019 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 180 B |
After Width: | Height: | Size: 535 B |
After Width: | Height: | Size: 501 B |
After Width: | Height: | Size: 909 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 949 B |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 525 B |
After Width: | Height: | Size: 272 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 877 B |
After Width: | Height: | Size: 458 B |
After Width: | Height: | Size: 925 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 267 B |
After Width: | Height: | Size: 149 B |
After Width: | Height: | Size: 473 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 351 B |
After Width: | Height: | Size: 992 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 886 B |
After Width: | Height: | Size: 774 B |
After Width: | Height: | Size: 159 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 5.3 KiB |