以 ckcloudManage a44810c 为基础,只保留资产页面(台账、单据、基础数据、同步任务)、 登录/错误/个人资料等公共页面,以及资产单据“查看流程”用到的流程详情页; 统一登录应用编码默认 CK_ASSET,标题“资产管理”,本地端口 9090。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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 # 关闭末尾空格修剪
|
||||
@@ -0,0 +1,18 @@
|
||||
# 标题
|
||||
VITE_APP_TITLE=资产管理
|
||||
|
||||
# 统一登录应用编码
|
||||
VITE_APP_CODE=CK_ASSET
|
||||
|
||||
# 项目本地运行端口号
|
||||
VITE_PORT=9090
|
||||
|
||||
# open 运行 npm run dev 时自动打开浏览器
|
||||
VITE_OPEN=true
|
||||
|
||||
# 租户开关
|
||||
VITE_APP_TENANT_ENABLE=true
|
||||
|
||||
# 文档地址的开关
|
||||
VITE_APP_DOCALERT_ENABLE=false
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# 开发环境:本地只启动前端项目,依赖开发环境(后端、APP)
|
||||
NODE_ENV=production
|
||||
|
||||
VITE_DEV=true
|
||||
|
||||
# 仅开发:局域网 HTTP 调试时允许无 Web Locks 退化为页内串行
|
||||
VITE_ALLOW_INSECURE_HTTP_SSO=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://127.0.0.1:58080'
|
||||
|
||||
# 接口地址
|
||||
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
|
||||
|
||||
# GoView域名
|
||||
VITE_GOVIEW_URL='http://127.0.0.1:3000'
|
||||
@@ -0,0 +1,32 @@
|
||||
# 生产环境:只在打包时使用
|
||||
NODE_ENV=production
|
||||
|
||||
VITE_DEV=false
|
||||
|
||||
# 生产必须 HTTPS + Web Locks,禁止 HTTP 下退化为页内串行。
|
||||
# HTTP 测试环境请使用 test 模式构建(pnpm build:test,见 .env.test)。
|
||||
VITE_ALLOW_INSECURE_HTTP_SSO=false
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL=/
|
||||
|
||||
# 接口地址
|
||||
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-prod
|
||||
|
||||
# GoView域名
|
||||
VITE_GOVIEW_URL='http://127.0.0.1:3000'
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
# 预发布环境:只在打包时使用
|
||||
NODE_ENV=production
|
||||
|
||||
VITE_DEV=false
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL=/
|
||||
|
||||
# 接口地址
|
||||
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-stage
|
||||
|
||||
# GoView域名
|
||||
VITE_GOVIEW_URL='http://127.0.0.1:3000'
|
||||
@@ -0,0 +1,32 @@
|
||||
# 测试环境(局域网 HTTP 地址,如 192.168.0.3):只在打包时使用,构建命令 pnpm build:test
|
||||
# 与 .env.prod 的唯一差异是允许 HTTP 下无 Web Locks 时退化为页内串行,此制品不得部署到生产。
|
||||
NODE_ENV=production
|
||||
|
||||
VITE_DEV=false
|
||||
|
||||
# 仅测试环境:HTTP 非安全上下文没有 navigator.locks,允许页内串行降级
|
||||
VITE_ALLOW_INSECURE_HTTP_SSO=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL=/
|
||||
|
||||
# 接口地址
|
||||
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-test
|
||||
|
||||
# GoView域名
|
||||
VITE_GOVIEW_URL='http://127.0.0.1:3000'
|
||||
@@ -0,0 +1,3 @@
|
||||
# 单元测试专用(vitest --mode unittest),不连接任何后端,地址仅用于拼接请求 URL
|
||||
VITE_BASE_URL='http://127.0.0.1:58080'
|
||||
VITE_API_URL=/admin-api
|
||||
@@ -0,0 +1,9 @@
|
||||
/build/
|
||||
/config/
|
||||
/dist/
|
||||
/*.js
|
||||
/test/unit/coverage/
|
||||
/node_modules/*
|
||||
/dist*
|
||||
/src/main.ts
|
||||
/vendor/
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
// @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',
|
||||
'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 【属性】顺序的提示,因为暂时不需要这么严格,警告也有点繁琐
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,43 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=4096
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 11
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
cache: pnpm
|
||||
|
||||
- name: Install
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build
|
||||
run: pnpm build:prod
|
||||
|
||||
- name: Type check
|
||||
run: pnpm ts:check
|
||||
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
|
||||
- name: Unit test with coverage
|
||||
run: pnpm test:coverage
|
||||
|
||||
- name: Audit
|
||||
run: pnpm audit --registry=https://registry.npmjs.org --audit-level=critical
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
/dist*
|
||||
pnpm-debug
|
||||
.idea
|
||||
.history
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# 本地环境变量(含个人配置,不入库)
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# AI 编码辅助文件,仅本地使用
|
||||
AGENTS.md
|
||||
CLAUDE.md
|
||||
GEMINI.md
|
||||
skills-lock.json
|
||||
.agents/
|
||||
.claude/
|
||||
.codex/
|
||||
.cursor/
|
||||
|
||||
# 单元测试覆盖率报告
|
||||
coverage/
|
||||
@@ -0,0 +1,12 @@
|
||||
/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
|
||||
/vendor/
|
||||
@@ -0,0 +1,7 @@
|
||||
/dist/*
|
||||
/public/*
|
||||
public/*
|
||||
/dist*
|
||||
/src/types/env.d.ts
|
||||
/docs/**/*
|
||||
/vendor/
|
||||
@@ -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.
|
||||
@@ -0,0 +1,21 @@
|
||||
# caikai-assets
|
||||
|
||||
财开云资产管理前端:实物资产台账、资产单据、基础数据、同步任务(致远/金蝶)。
|
||||
|
||||
- 统一登录应用编码 `CK_ASSET`(`.env` 中 `VITE_APP_CODE`),菜单由平台按该应用下发。
|
||||
- 后端接口在 `ckcloud-platform` 的 `ckcloud-module-asset` 模块,随平台后端发布。
|
||||
- 部署路径 `/asset/`,构建时传 `VITE_BASE_PATH=/asset/`。
|
||||
|
||||
## 开发
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
pnpm dev # 需本地 .env.local,参照 .env.dev
|
||||
pnpm build:prod
|
||||
```
|
||||
|
||||
## 目录
|
||||
|
||||
- `src/views/asset`:资产页面
|
||||
- `src/api/asset`:资产接口
|
||||
- `src/views/system/bpm/processInstance/detail`:资产单据“查看流程”使用的流程详情页
|
||||
@@ -0,0 +1,108 @@
|
||||
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'
|
||||
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-ng'
|
||||
import UnoCSS from 'unocss/vite'
|
||||
|
||||
export function createVitePlugins() {
|
||||
const root = process.cwd()
|
||||
// 单元测试只需要编译相关插件(Vue/JSX/自动导入/i18n),构建期插件跳过以加快速度
|
||||
const isTest = !!process.env.VITEST
|
||||
|
||||
// 路径查找
|
||||
function pathResolve(dir: string) {
|
||||
return resolve(root, '.', dir)
|
||||
}
|
||||
|
||||
return [
|
||||
Vue(),
|
||||
VueJsx(),
|
||||
UnoCSS(),
|
||||
...(isTest ? [] : [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']
|
||||
}),
|
||||
...(isTest
|
||||
? []
|
||||
: [
|
||||
EslintPlugin({
|
||||
cache: false,
|
||||
include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件
|
||||
})
|
||||
]),
|
||||
VueI18nPlugin({
|
||||
// 动态导入的 TS 语言包包含原始字符串,需要保留运行时文本编译器。
|
||||
runtimeOnly: false,
|
||||
compositionOnly: true,
|
||||
include: [resolve(__dirname, 'src/locales/**')]
|
||||
}),
|
||||
createSvgIconsPlugin({
|
||||
iconDirs: [pathResolve('src/assets/svgs')],
|
||||
symbolId: 'icon-[dir]-[name]',
|
||||
}),
|
||||
...(isTest
|
||||
? []
|
||||
: [
|
||||
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}`
|
||||
})
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
const include = [
|
||||
'qs',
|
||||
'url',
|
||||
'vue',
|
||||
'sass',
|
||||
'mitt',
|
||||
'axios',
|
||||
'pinia',
|
||||
'dayjs',
|
||||
'qrcode',
|
||||
'vue-router',
|
||||
'vue-types',
|
||||
'vue-i18n',
|
||||
'cropperjs',
|
||||
'lodash-es',
|
||||
'nprogress',
|
||||
'web-storage-cache',
|
||||
'@iconify/iconify',
|
||||
'@vueuse/core',
|
||||
'@zxcvbn-ts/core',
|
||||
'echarts/core',
|
||||
'echarts/charts',
|
||||
'echarts/components',
|
||||
'echarts/renderers',
|
||||
'echarts-wordcloud',
|
||||
'@wangeditor-next/editor',
|
||||
'@wangeditor-next/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',
|
||||
'element-plus/es/components/mention/style/css',
|
||||
'element-plus/es/components/progress/style/css'
|
||||
]
|
||||
|
||||
const exclude = ['@iconify/json']
|
||||
|
||||
export { include, exclude }
|
||||
@@ -0,0 +1,66 @@
|
||||
# 管理端列表页样式规范
|
||||
|
||||
适用于管理端所有“搜索 + 表格 + 分页”的内页。新页面优先用 `@/components/PublicView`,组件默认就符合本规范;暂未迁移的旧页面(`ContentWrap` + `el-form` + `el-table` + `Pagination`)在根节点加 `ckyun-list-page` 类并按下文调整结构。
|
||||
|
||||
## 1. 页面框架
|
||||
|
||||
| 区域 | 规范 |
|
||||
|------|------|
|
||||
| 顶栏 | 深红纯色(`--ckyun-header-bg-color`),左侧 logo + 面包屑,右侧“回到门户”和当前身份(只显示到集团/企业,部门岗位在悬停提示和切换下拉里) |
|
||||
| 位置 | 只在顶栏面包屑显示,页面内**不再放页面标题**;需要返回的详情页由路由 `meta.pageBackPath` 显示“返回 + 标题”行 |
|
||||
| 内容区 | 通栏铺满,不留外边距;背景 `--app-content-bg-color`(浅灰) |
|
||||
|
||||
## 2. 从上到下的四个区域
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────┐
|
||||
│ ① 搜索区 字段 字段 字段 字段 │ 白底通栏,贴边
|
||||
│ 字段 字段 [筛选][重置] │
|
||||
│ ② 工具栏行 [+ 新增] [导出] … │ 紧接搜索区,同一块白底,靠左
|
||||
├──────────────────────────────────────────────┤
|
||||
│ ③ 表格卡片(四周留 16,圆角 8,阴影) │
|
||||
│ 表头浅灰 37px,行高 45px,操作列在最右 │
|
||||
├──────────────────────────────────────────────┤
|
||||
│ ④ 分页条 共 N 条记录,第 x / y 页 首页 上一页 1 2 … 下一页 尾页 每页 [10] 条 │
|
||||
└──────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### ① 搜索区
|
||||
|
||||
- 白底通栏,左右内边距 16px,上 12px、下 14px,底部 1px 分隔线(下面有工具栏行时分隔线移到工具栏行底部)。
|
||||
- 标签在输入框**上方**,字号 12px;控件高 30px,宽度占满所在列。
|
||||
- 每行 4 列(≤1200px 3 列,≤768px 1 列),列间距 12px。
|
||||
- “筛选”(主按钮)“重置”固定在最后一个字段右侧、右对齐;字段多时用“展开/收起”。
|
||||
- 按钮文字统一为“筛选”“重置”,不用“搜索”“查询”。
|
||||
|
||||
### ② 工具栏行
|
||||
|
||||
- 放页面级操作:新增、导入导出、批量操作、刷新等;**不放筛选/重置**。
|
||||
- **放在查询条件下面,另起一行靠左**,与搜索区连成同一块白底;主操作(新增)在最前,用 `type="primary"`,其余默认按钮,间距 8px。
|
||||
- 页面需要先选上下文(如应用)时,选择器和按钮放在搜索区**上方**一行,选择器在最左、前面带“选择应用:”,按钮紧跟其后。
|
||||
- 没有任何操作时整行不显示。`PublicView` 在没有标题/`header` 插槽时自动把按钮行放到查询条件下面。
|
||||
|
||||
### ③ 表格卡片
|
||||
|
||||
- 与搜索区、分页条之间留 16px,左右 16px;白底,圆角 8px,阴影 `--ckyun-list-panel-shadow`,无边框。
|
||||
- 表头背景 `--ckyun-table-header-bg`,高 37px;数据行高 45px;单元格左右内边距 12px。
|
||||
- 第一列(名称/编号)加粗;状态用小标签;空数据显示“暂无数据”。
|
||||
- 操作列固定在最右,文字按钮,主操作红色(`--ckyun-table-action-primary-color`),间距 8px;超过 3 个收进“更多”。
|
||||
|
||||
### ④ 分页条
|
||||
|
||||
- 贴在页面底部的白色通栏,高 44px,左右内边距 16px,顶部 1px 分隔线。
|
||||
- 左侧“共 N 条记录,第 x / y 页”;右侧“首页 / 上一页 / 页码 / 下一页 / 尾页 / 每页 [n] 条”。
|
||||
- 旧页面使用 `PublicViewPagination`(从 `@/components/PublicView` 导入),不要用 `Pagination`。
|
||||
|
||||
## 3. 非列表页
|
||||
|
||||
左树右详情(组织架构、岗位、分组)、设计器、看板等不套用表格规范,但遵守:页面内不放页面标题、内容区通栏、卡片圆角 8px + 阴影、主按钮放在所属卡片右上角。
|
||||
|
||||
## 4. 检查清单
|
||||
|
||||
- [ ] 页面内没有和面包屑重复的标题
|
||||
- [ ] 新增等操作在查询条件下面一行靠左,筛选/重置在搜索区右侧
|
||||
- [ ] 搜索区标签在上、4 列网格、通栏白底
|
||||
- [ ] 表格是四周留 16px 的圆角卡片
|
||||
- [ ] 分页条在底部,格式为“共 N 条记录,第 x / y 页”
|
||||
@@ -0,0 +1,84 @@
|
||||
# SSO browser-session contract
|
||||
|
||||
- Login and logout URL creation are POST requests with a cryptographically random
|
||||
32-byte requestId. The initial login requestId is the browser transaction ID;
|
||||
there is no additional state parameter in the Ticket SSO protocol.
|
||||
The callback returns ticket and requestId; logout returns logout=1 and requestId.
|
||||
Ticket exchange sends the original ID as loginRequestId. The adapter generates
|
||||
a different requestId for its signed center exchange request, preserving replay
|
||||
protection. Browser requests include credentials for the HttpOnly binding.
|
||||
- The frontend requestId check is supplementary. The backend must independently bind
|
||||
and consume each transaction; a valid ticket by itself is insufficient.
|
||||
- Login and logout transactions have an 8-hour client lifetime matching the center
|
||||
recovery window, are bound to the
|
||||
originating tab and login generation, and are superseded by a newer transaction
|
||||
for this application. Callback errors remain visible until explicit user retry.
|
||||
- Access/refresh tokens, login generation and center-session binding are written
|
||||
as one application-namespaced localStorage record. Refresh preserves the
|
||||
generation and center binding. Other tabs reload identity and menus when the
|
||||
generation changes; old-page requests and old-generation responses are rejected.
|
||||
- Logout URL creation uses Origin, browser binding, requestId and the captured center
|
||||
generation, not a currently valid access token. Application logout sends the
|
||||
captured token without automatic refresh. Flow creation, login commits, logout cleanup, refresh,
|
||||
revoked-session cleanup and account-switch actions share the same Web Lock and
|
||||
recheck the captured flow or session after acquiring it. The backend must also resolve a replaced access token
|
||||
to its original refresh-token family. The center URL is bound to the captured
|
||||
opaque center-session generation, so a delayed logout cannot clear a newer
|
||||
center session.
|
||||
- Callback and local authentication URLs use Vite BASE_URL. The registered
|
||||
application callback must exactly match the deployed base path.
|
||||
- Legacy unnamespaced tokens are intentionally not migrated: their owning
|
||||
application cannot be established safely. Deployment requires a fresh login.
|
||||
- Browser flow storage uses v2 keys and does not accept previous state-based
|
||||
transactions. Historical OAuth and social-login state parameters remain unchanged.
|
||||
- The standalone center page at /zcy/login is not coupled to the management
|
||||
application's local login generation. Its captcha requests carry no management
|
||||
token; its form is bound by the backend's HttpOnly cookie and login token.
|
||||
- Sliding captcha is temporarily disabled (2026-10-24). `UnifiedLogin.vue` reads
|
||||
`VITE_APP_CAPTCHA_ENABLE`; when false, it submits the account/password form
|
||||
directly and does not mount the captcha widget. The backend
|
||||
`ckcloud.captcha.enable` must also be false. To restore captcha, enable both
|
||||
switches and restart/rebuild the affected services.
|
||||
- Changing an existing mobile number or email address prompts for currentPassword
|
||||
without storing it in the profile or login cache. Successful sensitive changes
|
||||
revoke sessions and send the user directly to forced login.
|
||||
- Profile password changes also revoke all sessions. The success event carries
|
||||
the pre-request session snapshot; cleanup and forced login occur under the
|
||||
shared lock only if that login generation is still current.
|
||||
- HTTPS and same-site deployment of the frontend and first-party adapter are
|
||||
required for browser cookie binding. CORS must allow the exact frontend origin
|
||||
with credentials, never a credentialed wildcard.
|
||||
- A modern browser with the Web Locks API is required by default. Unsupported
|
||||
browsers or insecure origins display an explicit error and cannot change login
|
||||
state. A dedicated HTTP test artifact may explicitly set
|
||||
`VITE_ALLOW_INSECURE_HTTP_SSO=true`; it serializes writes only within the current
|
||||
page and therefore must not be used for production or concurrent cross-tab
|
||||
account switching. Token writes and removals still assert lock ownership.
|
||||
- Test artifacts may set `VITE_SSO_CENTER_PORT_MAP` (for example,
|
||||
`8081:9000,1081:2000`) so browser redirects use the matching internal or
|
||||
externally mapped identity-center port. This is an automatic exact port map;
|
||||
users never choose a center and production artifacts leave it unset.
|
||||
- Requests capture one session snapshot before checking the page generation and
|
||||
use only that snapshot's token. An old page cannot adopt another tab's new
|
||||
identity between the page check and the Authorization header assignment.
|
||||
|
||||
## Focused manual acceptance
|
||||
|
||||
Logout URL or server revocation failures do not prevent local cleanup. Each
|
||||
failure path rechecks the captured flow and session before clearing storage.
|
||||
The callback displays an explicit incomplete-revocation warning; a stale logout
|
||||
must still abort without deleting a newer login. Local-only completion never
|
||||
claims all application or center sessions were revoked.
|
||||
|
||||
No automated tests or builds were executed for this hardening change.
|
||||
|
||||
1. Login each application with an independent requestId and ensure same-origin deployment
|
||||
does not overwrite the other application's token or tenant/user cache.
|
||||
2. Reject absent, mismatched, expired, replayed and foreign-browser callback requestId.
|
||||
3. Start two login attempts; only the current transaction may commit locally.
|
||||
4. Change account in a second tab while requests are pending; reload the first tab
|
||||
without displaying the old identity with the new account's data.
|
||||
5. Logout while refresh is pending, then login in another tab. Old logout responses
|
||||
and callbacks must not remove the new session.
|
||||
6. Confirm revoked application access stops at an error page without a login loop.
|
||||
7. Verify callbacks and retry links when deployed at a non-root base path.
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta
|
||||
name="keywords"
|
||||
content="财开云平台 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
|
||||
/>
|
||||
<meta
|
||||
name="description"
|
||||
content="财开云平台 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
|
||||
/>
|
||||
<title>%VITE_APP_TITLE%</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<style>
|
||||
/* 启动页先于全局样式显示,固定字体和盒模型,避免样式加载后闪变。 */
|
||||
.app-loading,
|
||||
.app-loading * {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.app-loading {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
color: #000;
|
||||
background: #f0f2f5;
|
||||
font-family: Arial, 'Microsoft YaHei', sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.app-loading .app-loading-wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 品牌区与转圈的间距单独控制,避免嵌套标题的边距参与居中计算。 */
|
||||
.app-loading .app-loading-brand {
|
||||
display: flex;
|
||||
margin-bottom: 60px;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.app-loading .app-loading-title {
|
||||
height: 28px;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
line-height: 28px;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.app-loading .app-loading-logo {
|
||||
display: block;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin: 0 auto 15px auto;
|
||||
}
|
||||
|
||||
.app-loading .app-loading-item {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
vertical-align: middle;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.app-loading .app-loading-outter {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 4px solid #2d8cf0;
|
||||
border-bottom: 0;
|
||||
border-left-color: transparent;
|
||||
border-radius: 50%;
|
||||
animation: loader-outter 1s cubic-bezier(0.42, 0.61, 0.58, 0.41) infinite;
|
||||
}
|
||||
|
||||
.app-loading .app-loading-inner {
|
||||
position: absolute;
|
||||
top: calc(50% - 20px);
|
||||
left: calc(50% - 20px);
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 4px solid #87bdff;
|
||||
border-right: 0;
|
||||
border-top-color: transparent;
|
||||
border-radius: 50%;
|
||||
animation: loader-inner 1s cubic-bezier(0.42, 0.61, 0.58, 0.41) infinite;
|
||||
}
|
||||
|
||||
@-webkit-keyframes loader-outter {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loader-outter {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes loader-inner {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: rotate(-360deg);
|
||||
transform: rotate(-360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loader-inner {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: rotate(-360deg);
|
||||
transform: rotate(-360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="app-loading">
|
||||
<div class="app-loading-wrap">
|
||||
<div class="app-loading-brand">
|
||||
<img src="/src/assets/imgs/caikai-logo.png" class="app-loading-logo" alt="财开云 Logo" />
|
||||
<div class="app-loading-title">%VITE_APP_TITLE%</div>
|
||||
</div>
|
||||
<div class="app-loading-item">
|
||||
<div class="app-loading-outter"></div>
|
||||
<div class="app-loading-inner"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
"*.{vue,ts}": ["vue-tsc-files --noEmit"]
|
||||
}
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
{
|
||||
"name": "caikai-assets",
|
||||
"version": "0.1.0",
|
||||
"description": "财开云资产管理前端(实物资产台账、单据、同步)",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"i": "pnpm install",
|
||||
"dev": "vite --mode env.local",
|
||||
"dev-server": "vite --mode dev",
|
||||
"ts:check": "node --max_old_space_size=8192 ./node_modules/vue-tsc/bin/vue-tsc.js --noEmit",
|
||||
"build:local": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build",
|
||||
"build:dev": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode dev",
|
||||
"build:test": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode test",
|
||||
"build:stage": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode stage",
|
||||
"build:prod": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode prod",
|
||||
"serve:dev": "vite preview --mode dev",
|
||||
"serve:prod": "vite preview --mode prod",
|
||||
"preview": "pnpm build:local && vite preview",
|
||||
"test": "vitest run --mode unittest",
|
||||
"test:watch": "vitest --mode unittest",
|
||||
"test:coverage": "vitest run --mode unittest --coverage",
|
||||
"clean": "npx rimraf node_modules",
|
||||
"clean:cache": "npx rimraf node_modules/.cache",
|
||||
"lint": "eslint --ext .js,.ts,.vue --max-warnings 0 ./src",
|
||||
"lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",
|
||||
"lint:format": "prettier --write --loglevel warn \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"",
|
||||
"lint:style": "stylelint --fix \"./src/**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
|
||||
"lint:lint-staged": "lint-staged -c "
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "2.3.2",
|
||||
"@form-create/designer": "^3.5.0",
|
||||
"@form-create/element-ui": "^3.3.4",
|
||||
"@iconify/iconify": "^3.1.1",
|
||||
"@microsoft/fetch-event-source": "^2.0.1",
|
||||
"@videojs-player/vue": "^1.0.0",
|
||||
"@vueuse/core": "^10.9.0",
|
||||
"@wangeditor-next/editor": "^5.6.46",
|
||||
"@wangeditor-next/editor-for-vue": "^5.1.14",
|
||||
"@wangeditor-next/plugin-mention": "^1.0.16",
|
||||
"@zxcvbn-ts/core": "^3.0.4",
|
||||
"acorn": "8.19.0",
|
||||
"animate.css": "^4.1.1",
|
||||
"axios": "1.20.0",
|
||||
"benz-amr-recorder": "^1.1.5",
|
||||
"bpmn-js-token-simulation": "^0.36.0",
|
||||
"camunda-bpmn-moddle": "^7.0.1",
|
||||
"cropperjs": "^1.6.1",
|
||||
"crypto-js": "4.2.0",
|
||||
"dayjs": "^1.11.10",
|
||||
"diagram-js": "^12.8.0",
|
||||
"driver.js": "^1.3.1",
|
||||
"echarts": "^5.5.0",
|
||||
"echarts-wordcloud": "^2.1.0",
|
||||
"element-plus": "2.14.5",
|
||||
"highlight.js": "^11.9.0",
|
||||
"jsoneditor": "^10.1.3",
|
||||
"lodash-es": "^4.18.1",
|
||||
"markdown-it": "^14.3.3",
|
||||
"markmap-common": "^0.16.0",
|
||||
"markmap-lib": "^0.16.1",
|
||||
"markmap-toolbar": "^0.17.0",
|
||||
"markmap-view": "^0.16.0",
|
||||
"min-dash": "^4.1.1",
|
||||
"mitt": "^3.0.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"pinia": "^2.1.7",
|
||||
"pinia-plugin-persistedstate": "^3.2.1",
|
||||
"qrcode": "^1.5.3",
|
||||
"qs": "^6.16.0",
|
||||
"snabbdom": "^3.6.2",
|
||||
"sortablejs": "^1.15.3",
|
||||
"steady-xml": "^0.1.0",
|
||||
"url": "^0.11.3",
|
||||
"video.js": "^7.21.5",
|
||||
"vue": "3.5.44",
|
||||
"vue-dompurify-html": "^4.1.4",
|
||||
"vue-i18n": "9.14.5",
|
||||
"vue-router": "4.4.5",
|
||||
"vue-types": "^5.1.1",
|
||||
"vue3-print-nb": "^0.1.4",
|
||||
"vue3-signature": "^0.2.4",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"web-storage-cache": "^1.1.1",
|
||||
"xml-js": "^1.6.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^19.0.1",
|
||||
"@commitlint/config-conventional": "^19.0.0",
|
||||
"@iconify/json": "^2.2.187",
|
||||
"@intlify/unplugin-vue-i18n": "^11.2.7",
|
||||
"@purge-icons/generated": "^0.9.0",
|
||||
"@types/jsoneditor": "^9.9.5",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^20.19.43",
|
||||
"@types/nprogress": "^0.2.3",
|
||||
"@types/qrcode": "^1.5.5",
|
||||
"@types/qs": "^6.9.12",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
||||
"@typescript-eslint/parser": "^7.1.0",
|
||||
"@unocss/eslint-config": "^0.57.4",
|
||||
"@unocss/eslint-plugin": "66.1.0-beta.5",
|
||||
"@vitejs/plugin-vue": "^6.0.10",
|
||||
"@vitejs/plugin-vue-jsx": "^5.1.6",
|
||||
"@vitest/coverage-v8": "^4.1.12",
|
||||
"@vue/test-utils": "^2.5.1",
|
||||
"autoprefixer": "^10.4.17",
|
||||
"bpmn-js": "^17.9.2",
|
||||
"bpmn-js-properties-panel": "5.23.0",
|
||||
"consola": "^3.2.3",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-define-config": "^2.1.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-vue": "^9.22.0",
|
||||
"jsdom": "^26.1.0",
|
||||
"lint-staged": "^15.2.10",
|
||||
"postcss": "^8.4.35",
|
||||
"postcss-html": "^1.6.0",
|
||||
"postcss-scss": "^4.0.9",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier-eslint": "^16.3.0",
|
||||
"rimraf": "^5.0.5",
|
||||
"rollup": "^4.59.0",
|
||||
"sass": "^1.69.5",
|
||||
"stylelint": "^16.2.1",
|
||||
"stylelint-config-html": "^1.1.0",
|
||||
"stylelint-config-recommended": "^14.0.0",
|
||||
"stylelint-config-standard": "^36.0.0",
|
||||
"stylelint-order": "^6.0.4",
|
||||
"terser": "^5.28.1",
|
||||
"typescript": "5.3.3",
|
||||
"unocss": "~66.11.0",
|
||||
"unplugin-auto-import": "^0.16.7",
|
||||
"unplugin-element-plus": "^0.8.0",
|
||||
"unplugin-vue-components": "^0.25.2",
|
||||
"vite": "^7.3.7",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-ejs": "^1.7.0",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
"vite-plugin-progress": "^0.0.7",
|
||||
"vite-plugin-purge-icons": "^0.10.0",
|
||||
"vite-plugin-svg-icons-ng": "^1.3.1",
|
||||
"vite-plugin-top-level-await": "^1.4.4",
|
||||
"vitest": "^4.1.12",
|
||||
"vue-eslint-parser": "^9.3.2",
|
||||
"vue-tsc": "^1.8.27",
|
||||
"vue-tsc-files": "^0.0.6"
|
||||
},
|
||||
"license": "MIT",
|
||||
"web-types": "./web-types.json",
|
||||
"engines": {
|
||||
"node": ">= 16.0.0",
|
||||
"pnpm": ">=8.6.0"
|
||||
}
|
||||
}
|
||||
Generated
+11774
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,56 @@
|
||||
allowBuilds:
|
||||
'@parcel/watcher': true
|
||||
'@swc/core': true
|
||||
core-js: true
|
||||
core-js-pure: true
|
||||
es5-ext: true
|
||||
esbuild: true
|
||||
vue-demi: true
|
||||
|
||||
# 安全修复:将存在已知漏洞的传递依赖提升到修复版本(审计:pnpm audit --registry=https://registry.npmjs.org)
|
||||
overrides:
|
||||
'form-data@4': '^4.0.6'
|
||||
'@xmldom/xmldom@<0.8.15': '^0.8.15'
|
||||
'brace-expansion@1': '^1.1.21'
|
||||
'brace-expansion@2': '^2.1.7'
|
||||
'glob@10': '^10.5.0'
|
||||
'js-yaml@4': '^4.3.2'
|
||||
'minimatch@3': '^3.1.5'
|
||||
'minimatch@5': '^5.1.9'
|
||||
'minimatch@9': '^9.0.9'
|
||||
'rollup@2': '^2.80.0'
|
||||
'rollup@4': '4.65.0'
|
||||
'svgo@3': '^3.3.5'
|
||||
'flatted@3': '^3.4.4'
|
||||
'picomatch@2': '^2.3.2'
|
||||
'picomatch@4': '^4.0.7'
|
||||
'lodash@4': '^4.18.1'
|
||||
'defu@6': '^6.1.7'
|
||||
'postcss@8': '8.5.31'
|
||||
'immutable@5': '^5.1.9'
|
||||
'linkify-it@5': '^5.0.2'
|
||||
'fast-uri@3': '^3.1.9'
|
||||
'nanoid@3': '^3.3.20'
|
||||
'nanoid@5': '^5.1.16'
|
||||
'browserslist@4': '4.29.4'
|
||||
'source-map-js@1': '^1.2.2'
|
||||
'dompurify@3': '^3.4.17'
|
||||
'@purge-icons/core>axios': '^0.34.0'
|
||||
'follow-redirects@1': '^1.16.2'
|
||||
'yaml@2': '^2.9.1'
|
||||
'ajv@6': '^6.15.0'
|
||||
'ajv@8': '^8.20.0'
|
||||
'prismjs@1': '^1.30.0'
|
||||
'katex@0.16': '^0.16.47'
|
||||
'postcss-selector-parser@6': '^6.1.5'
|
||||
'postcss-selector-parser@7': '^7.1.7'
|
||||
'colord@2': '^2.10.0'
|
||||
'@babel/runtime@7': '^7.29.10'
|
||||
'@babel/helpers@7': '^7.29.10'
|
||||
'@babel/runtime-corejs3@7': '^7.29.10'
|
||||
'qs@6': '6.16.1'
|
||||
'@intlify/shared@9': '^9.14.5'
|
||||
'vite-plugin-top-level-await>uuid': '^11.1.1'
|
||||
'@babel/core@7': '^7.29.1'
|
||||
'min-document@2': '^2.19.1'
|
||||
'electron-to-chromium@1': '1.5.464'
|
||||
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
autoprefixer: {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
module.exports = {
|
||||
printWidth: 100, // 每行代码长度(默认80)
|
||||
tabWidth: 2, // 每个tab相当于多少个空格(默认2)ab进行缩进(默认false)
|
||||
useTabs: false, // 是否使用tab
|
||||
semi: false, // 声明结尾使用分号(默认true)
|
||||
vueIndentScriptAndStyle: false,
|
||||
singleQuote: true, // 使用单引号(默认false)
|
||||
quoteProps: 'as-needed',
|
||||
bracketSpacing: true, // 对象字面量的大括号间使用空格(默认true)
|
||||
trailingComma: 'none', // 多行使用拖尾逗号(默认none)
|
||||
jsxSingleQuote: false,
|
||||
// 箭头函数参数括号 默认avoid 可选 avoid| always
|
||||
// avoid 能省略括号的时候就省略 例如x => x
|
||||
// always 总是有括号
|
||||
arrowParens: 'always',
|
||||
insertPragma: false,
|
||||
requirePragma: false,
|
||||
proseWrap: 'never',
|
||||
htmlWhitespaceSensitivity: 'strict',
|
||||
endOfLine: 'auto',
|
||||
rangeStart: 0
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
+68
@@ -0,0 +1,68 @@
|
||||
<script setup lang="ts">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import routerSearch from '@/components/RouterSearch/index.vue'
|
||||
import { startSessionReplacedWatch } from '@/utils/sessionReplaced'
|
||||
import { startAuthSessionSync } from '@/utils/ssoFlow'
|
||||
|
||||
defineOptions({ name: 'APP' })
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
const prefixCls = getPrefixCls('app')
|
||||
const appStore = useAppStore()
|
||||
const currentSize = computed(() => appStore.getCurrentSize)
|
||||
const greyMode = computed(() => appStore.getGreyMode)
|
||||
const { wsCache } = useCache()
|
||||
|
||||
// 管理台默认使用浅色主题;用户可通过右上角主题开关手动切换并持久化。
|
||||
const setDefaultTheme = () => {
|
||||
let isDarkTheme = wsCache.get(CACHE_KEY.IS_DARK)
|
||||
if (isDarkTheme === null) {
|
||||
isDarkTheme = false
|
||||
}
|
||||
appStore.setIsDark(isDarkTheme)
|
||||
}
|
||||
setDefaultTheme()
|
||||
let stopSessionWatch: (() => void) | undefined
|
||||
let stopSessionSync: (() => void) | undefined
|
||||
onMounted(() => {
|
||||
stopSessionWatch = startSessionReplacedWatch()
|
||||
stopSessionSync = startAuthSessionSync()
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
stopSessionWatch?.()
|
||||
stopSessionSync?.()
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<ConfigGlobal :size="currentSize">
|
||||
<RouterView :class="greyMode ? `${prefixCls}-grey-mode` : ''" />
|
||||
<routerSearch />
|
||||
</ConfigGlobal>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
$prefix-cls: #{$namespace}-app;
|
||||
|
||||
.size {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
@extend .size;
|
||||
|
||||
padding: 0 !important;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
|
||||
#app {
|
||||
@extend .size;
|
||||
}
|
||||
}
|
||||
|
||||
.#{$prefix-cls}-grey-mode {
|
||||
filter: grayscale(100%);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,271 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 资产字典类型,与后端 sql/dm/143_asset.sql 一致 */
|
||||
export const ASSET_DICT = {
|
||||
TYPE: 'asset_type',
|
||||
STATUS: 'asset_status',
|
||||
CATEGORY: 'asset_category',
|
||||
UNIT: 'asset_unit',
|
||||
SOURCE: 'asset_source',
|
||||
DEPRECIATION_METHOD: 'asset_depreciation_method',
|
||||
INVENTORY_RESULT: 'asset_inventory_result',
|
||||
BILL_TYPE: 'asset_bill_type'
|
||||
} as const
|
||||
|
||||
/** 审批状态 */
|
||||
export const ASSET_BILL_STATUS_OPTIONS = [
|
||||
{ label: '审批中', value: 1 },
|
||||
{ label: '审批通过', value: 2 },
|
||||
{ label: '审批不通过', value: 3 },
|
||||
{ label: '已取消', value: 4 }
|
||||
]
|
||||
|
||||
/** 同步任务状态 */
|
||||
export const ASSET_SYNC_STATUS_OPTIONS = [
|
||||
{ label: '待执行', value: 0 },
|
||||
{ label: '执行中', value: 1 },
|
||||
{ label: '成功', value: 2 },
|
||||
{ label: '失败', value: 3 },
|
||||
{ label: '业务失败', value: 4 },
|
||||
{ label: '暂不执行', value: 9 }
|
||||
]
|
||||
|
||||
/** 同步动作 */
|
||||
export const ASSET_SYNC_ACTION_OPTIONS = [
|
||||
{ label: '致远单据', value: 'SEEYON_BILL' },
|
||||
{ label: '金蝶资产卡片', value: 'KD_ASSET_CARD' },
|
||||
{ label: '金蝶报销单', value: 'KD_REIMBURSE' },
|
||||
{ label: '金蝶报销单附件', value: 'KD_ATTACHMENT' },
|
||||
{ label: '金蝶清理单', value: 'KD_CLEAR' }
|
||||
]
|
||||
|
||||
/** 资产来源 */
|
||||
export const ASSET_ORIGIN_OPTIONS = [
|
||||
{ label: '财开云入库', value: 1 },
|
||||
{ label: '致远导入', value: 2 }
|
||||
]
|
||||
|
||||
/** 日期显示:后端 LocalDate 序列化为 [年, 月, 日] 数组,也兼容 yyyy-MM-dd 文本 */
|
||||
export const formatAssetDate = (value?: unknown): string => {
|
||||
if (Array.isArray(value) && value.length >= 3) {
|
||||
return `${value[0]}-${String(value[1]).padStart(2, '0')}-${String(value[2]).padStart(2, '0')}`
|
||||
}
|
||||
return value ? String(value) : '-'
|
||||
}
|
||||
|
||||
/** 资产卡片 */
|
||||
export interface AssetCardVO {
|
||||
id: number
|
||||
assetNo: string
|
||||
assetName: string
|
||||
assetType: string
|
||||
categoryCode?: string
|
||||
spec?: string
|
||||
unitCode?: string
|
||||
quantity?: number
|
||||
originalValue?: number
|
||||
taxAmount?: number
|
||||
taxIncludedValue?: number
|
||||
sourceCode?: string
|
||||
depreciationMethod?: string
|
||||
usefulPeriods?: number
|
||||
ownerOrgId?: number
|
||||
ownerOrgName?: string
|
||||
useDeptId?: number
|
||||
useDeptName?: string
|
||||
useUserId?: number
|
||||
useUserName?: string
|
||||
manageDeptId?: number
|
||||
manageDeptName?: string
|
||||
managerUserId?: number
|
||||
managerUserName?: string
|
||||
location?: string
|
||||
supplierName?: string
|
||||
acquireDate?: string
|
||||
warrantyStart?: string
|
||||
warrantyEnd?: string
|
||||
invoiceNo?: string
|
||||
status: number
|
||||
lockBillId?: number
|
||||
sourceBillId?: number
|
||||
remark?: string
|
||||
seeyonCardId?: string
|
||||
kingdeeCardNo?: string
|
||||
origin: number
|
||||
createTime?: number | string
|
||||
}
|
||||
|
||||
/** 资产变动流水 */
|
||||
export interface AssetCardLogVO {
|
||||
id: number
|
||||
cardId: number
|
||||
billId?: number
|
||||
billType: string
|
||||
operatorName?: string
|
||||
changeTime: number | string
|
||||
beforeJson?: string
|
||||
afterJson?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
/** 资产单据明细 */
|
||||
export interface AssetBillItemVO {
|
||||
id: number
|
||||
seq: number
|
||||
cardId?: number
|
||||
assetNo?: string
|
||||
assetName?: string
|
||||
dataJson?: string
|
||||
targetDeptId?: number
|
||||
targetUserId?: number
|
||||
targetLocation?: string
|
||||
result?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
/** 同步任务 */
|
||||
export interface AssetSyncTaskVO {
|
||||
id: number
|
||||
billId: number
|
||||
cardId?: number
|
||||
target: string
|
||||
action: string
|
||||
dependsOn?: number
|
||||
status: number
|
||||
attemptCount: number
|
||||
nextRetryTime?: number | string
|
||||
externalNo?: string
|
||||
requestDigest?: string
|
||||
responseBody?: string
|
||||
errorMessage?: string
|
||||
createTime?: number | string
|
||||
updateTime?: number | string
|
||||
}
|
||||
|
||||
/** 资产单据 */
|
||||
export interface AssetBillVO {
|
||||
id: number
|
||||
billType: string
|
||||
billNo?: string
|
||||
processInstanceId?: string
|
||||
processDefinitionKey?: string
|
||||
status: number
|
||||
applyUserName?: string
|
||||
billDate?: string
|
||||
summary?: string
|
||||
assetType?: string
|
||||
refBillId?: number
|
||||
extJson?: string
|
||||
finishTime?: number | string
|
||||
syncStatus: number
|
||||
createTime?: number | string
|
||||
items?: AssetBillItemVO[]
|
||||
syncTasks?: AssetSyncTaskVO[]
|
||||
}
|
||||
|
||||
/** 致远导入结果 */
|
||||
export interface AssetSeeyonImportVO {
|
||||
total: number
|
||||
created: number
|
||||
updated: number
|
||||
skipped: number
|
||||
unmatchedDepts: string[]
|
||||
unmatchedUsers: string[]
|
||||
unmatchedCategories: string[]
|
||||
}
|
||||
|
||||
export interface AssetSupplierVO {
|
||||
id?: number
|
||||
name: string
|
||||
contact?: string
|
||||
phone?: string
|
||||
bankName?: string
|
||||
bankAccount?: string
|
||||
address?: string
|
||||
kingdeeSupplierNo?: string
|
||||
status?: number
|
||||
remark?: string
|
||||
createTime?: number | string
|
||||
}
|
||||
|
||||
export interface AssetNameLibVO {
|
||||
id?: number
|
||||
assetType?: string
|
||||
categoryCode?: string
|
||||
name: string
|
||||
status?: number
|
||||
createTime?: number | string
|
||||
}
|
||||
|
||||
export interface AssetCodeMappingVO {
|
||||
id?: number
|
||||
dictType: string
|
||||
dictValue: string
|
||||
scope?: string
|
||||
seeyonValue?: string
|
||||
seeyonName?: string
|
||||
kingdeeValue?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
export interface AssetOrgMappingVO {
|
||||
id?: number
|
||||
deptId?: number
|
||||
deptName?: string
|
||||
kind: string
|
||||
kingdeeOrgNo?: string
|
||||
kingdeeAccountOrgNo?: string
|
||||
kingdeeDeptNo?: string
|
||||
kingdeeStoreplaceNo?: string
|
||||
seeyonId?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
/** 金蝶卡片(金蝶查询接口实时取回) */
|
||||
export interface AssetKingdeeCardVO {
|
||||
number?: string
|
||||
billno?: string
|
||||
orgNumber?: string
|
||||
assetcatNumber?: string
|
||||
assetname?: string
|
||||
billstatus?: string
|
||||
bizstatus?: string
|
||||
realaccountdate?: string
|
||||
originalVal?: number
|
||||
accumDepre?: number
|
||||
netWorth?: number
|
||||
preResidualVal?: number
|
||||
}
|
||||
|
||||
export const getCardPage = (params: any) => request.get({ url: '/asset/card/page', params })
|
||||
export const getCard = (id: number) => request.get<AssetCardVO>({ url: '/asset/card/get', params: { id } })
|
||||
export const getCardLogList = (id: number) =>
|
||||
request.get<AssetCardLogVO[]>({ url: '/asset/card/log-list', params: { id } })
|
||||
export const getKingdeeCard = (id: number) =>
|
||||
request.get<AssetKingdeeCardVO | null>({ url: '/asset/card/kingdee-card', params: { id }, timeout: 60000 })
|
||||
export const updateCard = (data: any) => request.put({ url: '/asset/card/update', data })
|
||||
export const importSeeyon = () =>
|
||||
request.post<AssetSeeyonImportVO>({ url: '/asset/card/import-seeyon', timeout: 600000 })
|
||||
|
||||
export const getBillPage = (params: any) => request.get({ url: '/asset/bill/page', params })
|
||||
export const getBill = (id: number) => request.get<AssetBillVO>({ url: '/asset/bill/get', params: { id } })
|
||||
|
||||
export const getSyncTaskPage = (params: any) => request.get({ url: '/asset/sync-task/page', params })
|
||||
export const retrySyncTask = (id: number) => request.put({ url: '/asset/sync-task/retry?id=' + id })
|
||||
|
||||
export const getSupplierPage = (params: any) => request.get({ url: '/asset/base/supplier/page', params })
|
||||
export const saveSupplier = (data: AssetSupplierVO) => request.post({ url: '/asset/base/supplier/save', data })
|
||||
export const deleteSupplier = (id: number) => request.delete({ url: '/asset/base/supplier/delete', params: { id } })
|
||||
export const getNameLibPage = (params: any) => request.get({ url: '/asset/base/name-lib/page', params })
|
||||
export const saveNameLib = (data: AssetNameLibVO) => request.post({ url: '/asset/base/name-lib/save', data })
|
||||
export const deleteNameLib = (id: number) => request.delete({ url: '/asset/base/name-lib/delete', params: { id } })
|
||||
export const getCodeMappingList = (dictType?: string) =>
|
||||
request.get<AssetCodeMappingVO[]>({ url: '/asset/base/code-mapping/list', params: { dictType } })
|
||||
export const saveCodeMapping = (data: AssetCodeMappingVO) =>
|
||||
request.post({ url: '/asset/base/code-mapping/save', data })
|
||||
export const deleteCodeMapping = (id: number) =>
|
||||
request.delete({ url: '/asset/base/code-mapping/delete', params: { id } })
|
||||
export const getOrgMappingList = () => request.get<AssetOrgMappingVO[]>({ url: '/asset/base/org-mapping/list' })
|
||||
export const saveOrgMapping = (data: AssetOrgMappingVO) => request.post({ url: '/asset/base/org-mapping/save', data })
|
||||
export const deleteOrgMapping = (id: number) =>
|
||||
request.delete({ url: '/asset/base/org-mapping/delete', params: { id } })
|
||||
@@ -0,0 +1,53 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// BPM 流程分类 VO
|
||||
export interface CategoryVO {
|
||||
id: number // 分类编号
|
||||
name: string // 分类名
|
||||
code: string // 分类标志
|
||||
status: number // 分类状态
|
||||
sort: number // 分类排序
|
||||
}
|
||||
|
||||
// BPM 流程分类 API
|
||||
export const CategoryApi = {
|
||||
// 查询流程分类分页
|
||||
getCategoryPage: async (params: PageParam) => {
|
||||
return await request.get({ url: `/bpm/category/page`, params })
|
||||
},
|
||||
|
||||
// 查询流程分类列表
|
||||
getCategorySimpleList: async () => {
|
||||
return await request.get({ url: `/bpm/category/simple-list` })
|
||||
},
|
||||
|
||||
// 查询流程分类详情
|
||||
getCategory: async (id: number) => {
|
||||
return await request.get({ url: `/bpm/category/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增流程分类
|
||||
createCategory: async (data: CategoryVO) => {
|
||||
return await request.post({ url: `/bpm/category/create`, data })
|
||||
},
|
||||
|
||||
// 修改流程分类
|
||||
updateCategory: async (data: CategoryVO) => {
|
||||
return await request.post({ url: `/bpm/category/update`, data })
|
||||
},
|
||||
|
||||
// 批量修改流程分类的排序
|
||||
updateCategorySortBatch: async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: `/bpm/category/update-sort-batch`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 删除流程分类
|
||||
deleteCategory: async (id: number) => {
|
||||
return await request.post({ url: `/bpm/category/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 填写页传 forStart,详情读取同时校验当前组织的发起权限。 */
|
||||
export const getProcessDefinition = async (id?: string, key?: string, forStart = false) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/get',
|
||||
params: { id, key, forStart }
|
||||
})
|
||||
}
|
||||
|
||||
export const getProcessDefinitionPage = async (params) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/page',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export const getProcessDefinitionList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/list',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export const getSimpleProcessDefinitionList = async () => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-definition/simple-list'
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import request from '@/config/axios'
|
||||
import type { FormStorageSetting } from '@/api/bpm/formData'
|
||||
|
||||
export type FormVO = {
|
||||
id: number
|
||||
name: string
|
||||
conf: string
|
||||
fields: string[]
|
||||
status: number
|
||||
remark: string
|
||||
createTime: string
|
||||
storageSetting?: FormStorageSetting // 数据入库配置
|
||||
}
|
||||
|
||||
/** 保存模板时只提交业务配置,不携带来源系统的审计字段。 */
|
||||
export type FormSaveVO = Omit<FormVO, 'id' | 'createTime'> & { id?: number }
|
||||
|
||||
// 创建工作流的表单定义
|
||||
export const createForm = async (data: FormSaveVO) => {
|
||||
return await request.post({
|
||||
url: '/bpm/form/create',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新工作流的表单定义
|
||||
export const updateForm = async (data: FormSaveVO) => {
|
||||
return await request.post({
|
||||
url: '/bpm/form/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工作流的表单定义
|
||||
export const deleteForm = async (id: number) => {
|
||||
return await request.post({
|
||||
url: '/bpm/form/delete?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得工作流的表单定义
|
||||
export const getForm = async (id: number) => {
|
||||
return await request.get({
|
||||
url: '/bpm/form/get?id=' + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获得工作流的表单定义分页
|
||||
export const getFormPage = async (params) => {
|
||||
return await request.get({
|
||||
url: '/bpm/form/page',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获得动态表单的精简列表
|
||||
export const getFormSimpleList = async () => {
|
||||
return await request.get({
|
||||
url: '/bpm/form/simple-list'
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 表单数据入库配置:是否启用、对应数据表。 */
|
||||
export interface FormStorageSetting {
|
||||
enable: boolean
|
||||
tableName?: string
|
||||
}
|
||||
|
||||
/** 控件对应的数据表字段,保存在表单字段规则的 tableColumn 中。 */
|
||||
export interface FormTableColumnSetting {
|
||||
column?: string // 数据表字段名
|
||||
}
|
||||
|
||||
/** 可选的数据表。 */
|
||||
export interface FormTable {
|
||||
tableName: string
|
||||
comment?: string
|
||||
}
|
||||
|
||||
/** 数据表字段。 */
|
||||
export interface FormTableColumn {
|
||||
name: string
|
||||
comment?: string
|
||||
typeName: string
|
||||
category: 'text' | 'number' | 'datetime' | 'boolean' | 'other'
|
||||
size?: number
|
||||
nullable: boolean
|
||||
hasDefault: boolean
|
||||
primaryKey: boolean
|
||||
autoIncrement: boolean
|
||||
system: boolean
|
||||
}
|
||||
|
||||
export const getTableList = (): Promise<FormTable[]> =>
|
||||
request.get({ url: '/bpm/form-data/table-list' })
|
||||
|
||||
/** 获得数据表字段。 */
|
||||
export const getTableColumns = (tableName: string): Promise<FormTableColumn[]> =>
|
||||
request.get({ url: '/bpm/form-data/table-columns', params: { tableName } })
|
||||
@@ -0,0 +1,5 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 只查询预计编号,不提前占号,提交时由后端加锁重新核定。 */
|
||||
export const getNumberingPreview = (numberingType: string): Promise<string> =>
|
||||
request.get({ url: '/bpm/process-instance/numbering-preview', params: { numberingType } })
|
||||
@@ -0,0 +1,62 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 流程外部接口调用日志 */
|
||||
export interface HttpCallLogVO {
|
||||
id: number
|
||||
processInstanceId?: string
|
||||
processDefinitionKey?: string
|
||||
processDefinitionName?: string
|
||||
taskDefinitionKey?: string
|
||||
callSource: number
|
||||
requestUrl: string
|
||||
requestHeaders?: string
|
||||
requestBody?: string
|
||||
responseStatus?: number
|
||||
responseBody?: string
|
||||
status: number
|
||||
attemptCount: number
|
||||
maxAttempts: number
|
||||
nextRetryTime?: number | string
|
||||
durationMs?: number
|
||||
errorMessage?: string
|
||||
retryTime?: number | string
|
||||
createTime?: number | string
|
||||
retryable?: boolean
|
||||
}
|
||||
|
||||
export interface HttpCallLogPageReqVO extends PageParam {
|
||||
processInstanceId?: string
|
||||
processDefinitionName?: string
|
||||
requestUrl?: string
|
||||
callSource?: number
|
||||
status?: number
|
||||
createTime?: string[]
|
||||
}
|
||||
|
||||
export const HTTP_CALL_STATUS = { PENDING: 0, SENDING: 1, SUCCESS: 2, FAILED: 3, BUSINESS_FAILED: 4 } as const
|
||||
|
||||
export const HTTP_CALL_SOURCE_OPTIONS = [
|
||||
{ label: '流程前置通知', value: 1 },
|
||||
{ label: '流程后置通知', value: 2 },
|
||||
{ label: '任务前置通知', value: 3 },
|
||||
{ label: '任务后置通知', value: 4 },
|
||||
{ label: '触发器请求', value: 5 },
|
||||
{ label: '触发器回调', value: 6 },
|
||||
{ label: '任务监听器', value: 7 }
|
||||
]
|
||||
|
||||
export const HTTP_CALL_STATUS_OPTIONS = [
|
||||
{ label: '待重试', value: HTTP_CALL_STATUS.PENDING },
|
||||
{ label: '发送中', value: HTTP_CALL_STATUS.SENDING },
|
||||
{ label: '成功', value: HTTP_CALL_STATUS.SUCCESS },
|
||||
{ label: '失败', value: HTTP_CALL_STATUS.FAILED },
|
||||
{ label: '业务失败', value: HTTP_CALL_STATUS.BUSINESS_FAILED }
|
||||
]
|
||||
|
||||
// 分页查询调用日志
|
||||
export const getHttpCallLogPage = (params: HttpCallLogPageReqVO): Promise<PageResult<HttpCallLogVO[]>> =>
|
||||
request.get({ url: '/bpm/http-call-log/page', params })
|
||||
|
||||
// 手动重试,返回重试后的记录
|
||||
export const retryHttpCall = (id: number): Promise<HttpCallLogVO> =>
|
||||
request.post({ url: '/bpm/http-call-log/retry?id=' + id })
|
||||
@@ -0,0 +1,27 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type LeaveVO = {
|
||||
id: number
|
||||
status: number
|
||||
type: number
|
||||
reason: string
|
||||
processInstanceId: string
|
||||
startTime: string
|
||||
endTime: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
// 创建请假申请
|
||||
export const createLeave = async (data: LeaveVO) => {
|
||||
return await request.post({ url: '/bpm/oa/leave/create', data: data })
|
||||
}
|
||||
|
||||
// 获得请假申请
|
||||
export const getLeave = async (id: number) => {
|
||||
return await request.get({ url: '/bpm/oa/leave/get?id=' + id })
|
||||
}
|
||||
|
||||
// 获得请假申请分页
|
||||
export const getLeavePage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/oa/leave/page', params })
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 自建表字段 */
|
||||
export interface LedgerColumn {
|
||||
columnName: string
|
||||
typeName?: string
|
||||
category?: string
|
||||
comment?: string
|
||||
displayName: string
|
||||
available: boolean
|
||||
listVisible: boolean
|
||||
sortNo: number
|
||||
sortable: boolean
|
||||
}
|
||||
|
||||
/** 台账筛选项 */
|
||||
export interface LedgerFilter {
|
||||
column: string
|
||||
label: string
|
||||
category: string
|
||||
mode: 'like' | 'eq' | 'range'
|
||||
dictType?: string
|
||||
options?: { label: string; value: string | number | boolean }[]
|
||||
}
|
||||
|
||||
export interface LedgerMeta {
|
||||
title: string
|
||||
columns: LedgerColumn[]
|
||||
filters: LedgerFilter[]
|
||||
exportable: boolean
|
||||
}
|
||||
|
||||
export interface LedgerRow {
|
||||
id: string
|
||||
processInstanceId?: string
|
||||
startUserName?: string
|
||||
createTime?: number | string
|
||||
values: Record<string, string>
|
||||
}
|
||||
|
||||
export interface LedgerDetail {
|
||||
row: LedgerRow
|
||||
columns: LedgerColumn[]
|
||||
}
|
||||
|
||||
export interface LedgerPageReq {
|
||||
menuCode: string
|
||||
pageNo?: number
|
||||
pageSize?: number
|
||||
filters?: Record<string, unknown>
|
||||
sortColumn?: string
|
||||
sortOrder?: string
|
||||
}
|
||||
|
||||
// 获得台账配置
|
||||
export const getLedgerMeta = (menuCode: string): Promise<LedgerMeta> =>
|
||||
request.get({ url: '/bpm/ledger/view/meta', params: { menuCode } })
|
||||
|
||||
// 分页查询台账
|
||||
export const getLedgerPage = (data: LedgerPageReq): Promise<PageResult<LedgerRow[]>> =>
|
||||
request.post({ url: '/bpm/ledger/view/page', data })
|
||||
|
||||
// 查询台账详情
|
||||
export const getLedgerDetail = (menuCode: string, id: string): Promise<LedgerDetail> =>
|
||||
request.get({ url: '/bpm/ledger/view/get', params: { menuCode, id } })
|
||||
|
||||
// 查询审批过程
|
||||
export const getLedgerApproval = (menuCode: string, id: string): Promise<any[]> =>
|
||||
request.get({ url: '/bpm/ledger/view/approval', params: { menuCode, id } })
|
||||
|
||||
// 导出台账
|
||||
export const exportLedger = (data: LedgerPageReq) =>
|
||||
request.download({ url: '/bpm/ledger/view/export', method: 'POST', data })
|
||||
|
||||
/** 自建表登记 */
|
||||
export interface LedgerRegistry {
|
||||
id: number
|
||||
applicationId: number
|
||||
funcCode: string
|
||||
funcName: string
|
||||
tableName: string
|
||||
status: number
|
||||
tableProblem?: string
|
||||
}
|
||||
|
||||
export interface LedgerMenuOption {
|
||||
id: number
|
||||
funcName: string
|
||||
tableName: string
|
||||
columns: LedgerColumn[]
|
||||
}
|
||||
|
||||
export interface LedgerFilterColumn {
|
||||
column: string
|
||||
mode: string
|
||||
}
|
||||
|
||||
export interface LedgerMenuBinding {
|
||||
registryId: number
|
||||
menuCode: string
|
||||
filterColumns: LedgerFilterColumn[]
|
||||
}
|
||||
|
||||
// 分页查询自建表登记
|
||||
export const getRegistryPage = (params: PageParam & Record<string, unknown>): Promise<PageResult<LedgerRegistry[]>> =>
|
||||
request.get({ url: '/bpm/ledger/registry/page', params })
|
||||
|
||||
export interface LedgerTableOption {
|
||||
tableName: string
|
||||
comment?: string
|
||||
problem?: string
|
||||
}
|
||||
|
||||
// 获得可登记的数据库表
|
||||
export const getRegistryTableOptions = (applicationId: number): Promise<LedgerTableOption[]> =>
|
||||
request.get({ url: '/bpm/ledger/registry/table-options', params: { applicationId } })
|
||||
|
||||
// 登记自建表
|
||||
export const createRegistry = (data: {
|
||||
applicationId: number
|
||||
tableName: string
|
||||
funcName: string
|
||||
funcCode: string
|
||||
}): Promise<number> => request.post({ url: '/bpm/ledger/registry/create', data })
|
||||
|
||||
// 获得字段配置
|
||||
export const getRegistryColumns = (registryId: number): Promise<LedgerColumn[]> =>
|
||||
request.get({ url: '/bpm/ledger/registry/columns', params: { registryId } })
|
||||
|
||||
// 保存字段配置
|
||||
export const saveRegistryColumns = (registryId: number, columns: LedgerColumn[]) =>
|
||||
request.post({ url: '/bpm/ledger/registry/columns/save', data: { registryId, columns } })
|
||||
|
||||
// 获得可绑定的自建表
|
||||
export const getMenuOptions = (applicationId: number): Promise<LedgerMenuOption[]> =>
|
||||
request.get({ url: '/bpm/ledger/menu/options', params: { applicationId } })
|
||||
|
||||
// 获得菜单绑定,普通菜单返回空
|
||||
export const getMenuBinding = (menuId: number): Promise<LedgerMenuBinding | null> =>
|
||||
request.get({ url: '/bpm/ledger/menu/get', params: { menuId } })
|
||||
|
||||
// 保存自建表列表菜单
|
||||
export const saveLedgerMenu = (data: Record<string, unknown>): Promise<number> =>
|
||||
request.post({ url: '/bpm/ledger/menu/save', data })
|
||||
|
||||
// 获得表单对应的台账入口
|
||||
export const getLedgerEntries = (formId: number): Promise<{ menuCode: string }[]> =>
|
||||
request.get({ url: '/bpm/ledger/view/entries', params: { formId } })
|
||||
|
||||
// 获得流程实例对应的台账记录入口
|
||||
export const getLedgerProcessEntry = (
|
||||
processInstanceId: string
|
||||
): Promise<{ menuCode: string; id: string; tableName: string } | null> =>
|
||||
request.get({ url: '/bpm/ledger/view/process-entry', params: { processInstanceId } })
|
||||
|
||||
export interface LedgerWriteInfo {
|
||||
funcName: string
|
||||
status: number
|
||||
statusName: string
|
||||
lastTryTime?: string | number
|
||||
failReason?: string
|
||||
canRetry: boolean
|
||||
}
|
||||
|
||||
// 手动重试写入自建表
|
||||
export const retryLedgerWrite = (processInstanceId: string) =>
|
||||
request.post({ url: '/bpm/ledger/write/retry', params: { processInstanceId } })
|
||||
@@ -0,0 +1,210 @@
|
||||
import request from '@/config/axios'
|
||||
import type { DeptVO } from '@/api/system/dept'
|
||||
import type { UserVO } from '@/api/system/user'
|
||||
|
||||
/** 发起范围:历史数据不设置此字段,明确切换后使用公司范围与额外人员并集。 */
|
||||
export enum BpmStartScopeMode {
|
||||
ALL = 0,
|
||||
SPECIFIED = 2
|
||||
}
|
||||
|
||||
/** 发起范围配置可跨公司选人,仅返回选项展示所需信息。 */
|
||||
export interface ModelStartScopeOptions {
|
||||
departments: DeptVO[]
|
||||
users: Pick<UserVO, 'id' | 'nickname' | 'deptId'>[]
|
||||
posts: { id: number; name: string; code: string }[]
|
||||
}
|
||||
|
||||
export const getModelStartScopeOptions = (): Promise<ModelStartScopeOptions> =>
|
||||
request.get({ url: '/bpm/model/start-scope-options' })
|
||||
|
||||
export type ProcessDefinitionVO = {
|
||||
id: string
|
||||
version: number
|
||||
deploymentTIme: string
|
||||
suspensionState: number
|
||||
formType?: number
|
||||
formCustomCreatePath?: string
|
||||
}
|
||||
|
||||
export type ModelVO = {
|
||||
id: number
|
||||
formName: string
|
||||
key: string
|
||||
name: string
|
||||
description: string
|
||||
category: string
|
||||
formType: number
|
||||
formId: number
|
||||
formCustomCreatePath: string
|
||||
formCustomViewPath: string
|
||||
processDefinition: ProcessDefinitionVO
|
||||
status: number
|
||||
remark: string
|
||||
createTime: string
|
||||
bpmnXml: string
|
||||
/** 空值沿用历史规则,额外人员仅在新模式下独立于公司范围。 */
|
||||
startScopeMode?: BpmStartScopeMode | null
|
||||
applicableOrgIds?: number[]
|
||||
startUserIds?: number[]
|
||||
startDeptIds?: number[]
|
||||
/** 指定岗位按当前有效任职动态匹配,与部门、额外人员取并集。 */
|
||||
startPostIds?: number[]
|
||||
}
|
||||
|
||||
export const getModelList = async (name: string | undefined) => {
|
||||
return await request.get({ url: '/bpm/model/list', params: { name } })
|
||||
}
|
||||
|
||||
export const getModel = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/model/get?id=' + id })
|
||||
}
|
||||
|
||||
export const updateModel = async (data: ModelVO) => {
|
||||
return await request.post({ url: '/bpm/model/update', data: data })
|
||||
}
|
||||
|
||||
// 批量修改流程分类的排序
|
||||
export const updateModelSortBatch = async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: `/bpm/model/update-sort-batch`,
|
||||
params: {
|
||||
ids: ids.join(',')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const updateModelBpmn = async (data: ModelVO) => {
|
||||
return await request.post({ url: '/bpm/model/update-bpmn', data: data })
|
||||
}
|
||||
|
||||
// 任务状态修改
|
||||
export const updateModelState = async (id: number, state: number) => {
|
||||
const data = {
|
||||
id: id,
|
||||
state: state
|
||||
}
|
||||
return await request.post({ url: '/bpm/model/update-state', data: data })
|
||||
}
|
||||
|
||||
export const createModel = async (data: ModelVO) => {
|
||||
return await request.post({ url: '/bpm/model/create', data: data })
|
||||
}
|
||||
|
||||
export const deleteModel = async (id: number) => {
|
||||
return await request.post({ url: '/bpm/model/delete?id=' + id })
|
||||
}
|
||||
|
||||
export const deployModel = async (id: number) => {
|
||||
return await request.post({ url: '/bpm/model/deploy?id=' + id })
|
||||
}
|
||||
|
||||
/** 批量发布等待时间:几十个流程由后端统一处理,单独放宽默认的 30 秒超时。 */
|
||||
const MODEL_BATCH_DEPLOY_TIMEOUT = 10 * 60 * 1000
|
||||
|
||||
/** 批量发布中单个模型的处理结果。 */
|
||||
export interface ModelDeployBatchResultVO {
|
||||
id: string
|
||||
success: boolean
|
||||
errorMessage?: string
|
||||
}
|
||||
|
||||
/** 一次提交全部模型编号,由后端独立发布各流程并汇总结果。 */
|
||||
export const deployModelBatch = async (ids: string[]): Promise<ModelDeployBatchResultVO[]> => {
|
||||
return await request.post({
|
||||
url: '/bpm/model/deploy-batch',
|
||||
data: { ids },
|
||||
timeout: MODEL_BATCH_DEPLOY_TIMEOUT
|
||||
})
|
||||
}
|
||||
|
||||
/** 模型清理结果:清理前后端会自动归档,归档文件可下载 */
|
||||
export interface ModelCleanRespVO {
|
||||
/** 清理的流程实例数量 */
|
||||
cleanedCount: number
|
||||
archiveFileId?: number
|
||||
archiveFileName?: string
|
||||
archiveUrl?: string
|
||||
}
|
||||
|
||||
/** 清理模型下的流程数据,仅超级管理员可用 */
|
||||
export const cleanModel = async (id: number): Promise<ModelCleanRespVO> => {
|
||||
return await request.post({ url: '/bpm/model/clean?id=' + id })
|
||||
}
|
||||
|
||||
/** 流程设计器审批角色候选项 */
|
||||
export interface CandidateRoleVO {
|
||||
id: number
|
||||
name: string
|
||||
code?: string
|
||||
}
|
||||
|
||||
/** 流程设计器审批角色候选项:协同办公应用(CK_OA)内已启用的角色,有流程模型权限即可查询,不受应用管理范围限制 */
|
||||
export const getCandidateRoleList = async (): Promise<CandidateRoleVO[]> => {
|
||||
return await request.get({ url: '/bpm/model/candidate-roles' })
|
||||
}
|
||||
|
||||
// ========== 流程批量导出与导入 ==========
|
||||
|
||||
/** 流程导出文件:导出接口返回、导入时原样回传 */
|
||||
export interface ModelTransferFileVO {
|
||||
format: string
|
||||
version: number
|
||||
exportTime?: string
|
||||
models: { name: string; key: string; categoryCode?: string; categoryName?: string; [key: string]: unknown }[]
|
||||
}
|
||||
|
||||
/** 导入处理方式;category_required 表示分类未匹配,需手动选择。 */
|
||||
export type ModelImportAction = 'create' | 'conflict' | 'used' | 'category_required'
|
||||
|
||||
/** 流程导入预览行 */
|
||||
export interface ModelImportPreviewVO {
|
||||
sourceKey: string
|
||||
sourceCategoryCode?: string
|
||||
sourceCategoryName?: string
|
||||
category?: string
|
||||
categoryName?: string
|
||||
name: string
|
||||
key: string
|
||||
formName?: string
|
||||
action: ModelImportAction
|
||||
}
|
||||
|
||||
/** 流程导入请求 */
|
||||
export interface ModelImportReqVO {
|
||||
/** 兼容旧调用方统一指定分类,新界面按文件分类自动匹配。 */
|
||||
category?: string
|
||||
/** 未匹配分类的手动选择:原流程标识 -> 目标分类编码。 */
|
||||
categoryMappings?: Record<string, string>
|
||||
file: ModelTransferFileVO
|
||||
overwriteNames?: string[]
|
||||
/** 按原标识选择覆盖,区分不同分类下的同名流程。 */
|
||||
overwriteKeys?: string[]
|
||||
}
|
||||
|
||||
/** 流程导入结果 */
|
||||
export interface ModelImportRespVO {
|
||||
createdNames: string[]
|
||||
overwrittenNames: string[]
|
||||
skippedNames: string[]
|
||||
}
|
||||
|
||||
/** 批量导出流程(含流程设置、流程设计与流程表单) */
|
||||
export const exportModels = async (
|
||||
ids: string[],
|
||||
options?: { keyPrefix: string; namePrefix: string }
|
||||
): Promise<ModelTransferFileVO> => {
|
||||
return await request.get({ url: '/bpm/model/export', params: { ids: ids.join(','), ...options } })
|
||||
}
|
||||
|
||||
/** 预览批量导入:自动匹配分类,未匹配的待选择;在各自目标分类内判断重名,不写入数据。 */
|
||||
export const previewImportModels = async (
|
||||
data: ModelImportReqVO
|
||||
): Promise<ModelImportPreviewVO[]> => {
|
||||
return await request.post({ url: '/bpm/model/import/preview', data })
|
||||
}
|
||||
|
||||
/** 批量导入流程,导入的流程为未发布状态 */
|
||||
export const importModels = async (data: ModelImportReqVO): Promise<ModelImportRespVO> => {
|
||||
return await request.post({ url: '/bpm/model/import', data })
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 标记当前用户已打开流程详情。 */
|
||||
export const markRead = async (processInstanceId: string, taskId?: string) => {
|
||||
return await request.post({
|
||||
url: '/bpm/process-audit/mark-read',
|
||||
params: { processInstanceId, taskId }
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询流程实例的完整人工操作日志。 */
|
||||
export const getOperationLogList = async (processInstanceId: string) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-audit/operation-log-list',
|
||||
params: { processInstanceId }
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询流程实例的用户阅读记录。 */
|
||||
export const getReadRecordList = async (processInstanceId: string) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-audit/read-record-list',
|
||||
params: { processInstanceId }
|
||||
})
|
||||
}
|
||||
|
||||
/** 修订流程变量请求 */
|
||||
export interface ReviseVariablesReqVO {
|
||||
processInstanceId: string
|
||||
variables: Record<string, unknown>
|
||||
reason: string
|
||||
}
|
||||
|
||||
/** 修订审批意见请求 */
|
||||
export interface ReviseTaskOpinionReqVO {
|
||||
taskId: string
|
||||
opinion: string
|
||||
reason: string
|
||||
}
|
||||
|
||||
/** 管理员修订流程表单、附件或文件单号对应的变量。 */
|
||||
export const reviseVariables = async (data: ReviseVariablesReqVO) => {
|
||||
return await request.post({ url: '/bpm/process-audit/revise-variables', data })
|
||||
}
|
||||
|
||||
/** 管理员修订指定历史任务的审批意见。 */
|
||||
export const reviseTaskOpinion = async (data: ReviseTaskOpinionReqVO) => {
|
||||
return await request.post({ url: '/bpm/process-audit/revise-task-opinion', data })
|
||||
}
|
||||
|
||||
/** 审批人修订本人已完成任务的审批意见。 */
|
||||
export const reviseOwnTaskOpinion = async (data: ReviseTaskOpinionReqVO) => {
|
||||
return await request.post({ url: '/bpm/process-audit/revise-own-task-opinion', data })
|
||||
}
|
||||
|
||||
/** 管理员挂起运行中的流程实例。 */
|
||||
export const suspendProcess = async (processInstanceId: string, reason: string) => {
|
||||
return await request.post({
|
||||
url: '/bpm/process-audit/suspend',
|
||||
data: { processInstanceId, reason }
|
||||
})
|
||||
}
|
||||
|
||||
/** 管理员恢复已挂起的流程实例。 */
|
||||
export const activateProcess = async (processInstanceId: string, reason: string) => {
|
||||
return await request.post({
|
||||
url: '/bpm/process-audit/activate',
|
||||
data: { processInstanceId, reason }
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询流程应读人员(处理人、抄送人)的阅读情况,未读人员同样返回。 */
|
||||
export const getReadStatusList = async (processInstanceId: string) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-audit/read-status-list',
|
||||
params: { processInstanceId }
|
||||
})
|
||||
}
|
||||
|
||||
/** 查询流程审计时间线:全部任务、人工操作、催办、首次阅读按时间合并,仅流程管理员可用。 */
|
||||
export const getTimeline = async (processInstanceId: string) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-audit/timeline',
|
||||
params: { processInstanceId }
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// BPM 流程表达式 VO
|
||||
export interface ProcessExpressionVO {
|
||||
id: number // 编号
|
||||
name: string // 表达式名字
|
||||
status: number // 表达式状态
|
||||
expression: string // 表达式
|
||||
}
|
||||
|
||||
// BPM 流程表达式 API
|
||||
export const ProcessExpressionApi = {
|
||||
// 查询BPM 流程表达式分页
|
||||
getProcessExpressionPage: async (params: PageParam) => {
|
||||
return await request.get({ url: `/bpm/process-expression/page`, params })
|
||||
},
|
||||
|
||||
// 查询BPM 流程表达式详情
|
||||
getProcessExpression: async (id: number) => {
|
||||
return await request.get({ url: `/bpm/process-expression/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增BPM 流程表达式
|
||||
createProcessExpression: async (data: ProcessExpressionVO) => {
|
||||
return await request.post({ url: `/bpm/process-expression/create`, data })
|
||||
},
|
||||
|
||||
// 修改BPM 流程表达式
|
||||
updateProcessExpression: async (data: ProcessExpressionVO) => {
|
||||
return await request.post({ url: `/bpm/process-expression/update`, data })
|
||||
},
|
||||
|
||||
// 删除BPM 流程表达式
|
||||
deleteProcessExpression: async (id: number) => {
|
||||
return await request.post({ url: `/bpm/process-expression/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出BPM 流程表达式 Excel
|
||||
exportProcessExpression: async (params) => {
|
||||
return await request.download({ url: `/bpm/process-expression/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
import request from '@/config/axios'
|
||||
import { ProcessDefinitionVO } from '@/api/bpm/model'
|
||||
import { NodeType, CandidateStrategy } from '@/components/SimpleProcessDesignerV2/src/consts'
|
||||
export type Task = {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type ProcessInstanceVO = {
|
||||
id: number
|
||||
name: string
|
||||
processDefinitionId: string
|
||||
category: string
|
||||
result: number
|
||||
tasks: Task[]
|
||||
fields: string[]
|
||||
status: number
|
||||
remark: string
|
||||
businessKey: string
|
||||
createTime: string
|
||||
endTime: string
|
||||
processDefinition?: ProcessDefinitionVO
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
export type User = {
|
||||
id: number
|
||||
nickname: string
|
||||
avatar: string
|
||||
/** 自选审批人来自用户精简接口,用主任职岗位判断即时展示标题。 */
|
||||
deptId?: number
|
||||
postIds?: number[]
|
||||
}
|
||||
|
||||
// 审批任务信息
|
||||
export type ApprovalTaskInfo = {
|
||||
id: number
|
||||
ownerUser: User
|
||||
assigneeUser: User
|
||||
status: number
|
||||
reason: string
|
||||
// 签名文件编号
|
||||
signPicFileId?: number
|
||||
// 签名图片地址(后端已签名的短时地址,历史任务为旧地址),仅用于展示
|
||||
signPicUrl: string
|
||||
// 按请假、出差代理授权代为办理时的委托人,不为空时显示“代”
|
||||
principalUser?: User
|
||||
withdrawn?: boolean // 办理后是否已被撤回
|
||||
adminSkipped?: boolean // 是否被管理员跳过
|
||||
}
|
||||
|
||||
// 审批节点信息
|
||||
export type ApprovalNodeInfo = {
|
||||
id: number
|
||||
name: string
|
||||
/** 后端按节点配置及审批人的共同主岗位计算,缺失时回退 name。 */
|
||||
displayName?: string
|
||||
showApproverPost?: boolean
|
||||
nodeType: NodeType
|
||||
candidateStrategy?: CandidateStrategy
|
||||
/** 本次提交即将进入的节点原规则无人,需要由当前办理人选择。 */
|
||||
emptyUserSelect?: boolean
|
||||
/** 空选跳过后可达的原生自选节点,仍需选择审批人。 */
|
||||
requiredUserSelect?: boolean
|
||||
status: number
|
||||
startTime?: Date
|
||||
endTime?: Date
|
||||
processInstanceId?: string
|
||||
candidateUsers?: User[]
|
||||
tasks: ApprovalTaskInfo[]
|
||||
}
|
||||
|
||||
export const getProcessInstanceMyPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/process-instance/my-page', params })
|
||||
}
|
||||
|
||||
export const getProcessInstanceManagerPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/process-instance/manager-page', params })
|
||||
}
|
||||
|
||||
export const createProcessInstance = async (data) => {
|
||||
return await request.post({ url: '/bpm/process-instance/create', data: data })
|
||||
}
|
||||
|
||||
export const cancelProcessInstanceByStartUser = async (id: number, reason: string) => {
|
||||
const data = {
|
||||
id: id,
|
||||
reason: reason
|
||||
}
|
||||
return await request.post({ url: '/bpm/process-instance/cancel-by-start-user', data: data })
|
||||
}
|
||||
|
||||
export const cancelProcessInstanceByAdmin = async (id: number, reason: string) => {
|
||||
const data = {
|
||||
id: id,
|
||||
reason: reason
|
||||
}
|
||||
return await request.post({ url: '/bpm/process-instance/cancel-by-admin', data: data })
|
||||
}
|
||||
|
||||
export const getProcessInstance = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get?id=' + id })
|
||||
}
|
||||
|
||||
export const getProcessInstanceCopyPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/process-instance/copy/page', params })
|
||||
}
|
||||
|
||||
/** 获取流程实例的抄送记录(流转记录中展示抄送节点与被抄送人) */
|
||||
export const getProcessInstanceCopyListByProcessInstanceId = async (processInstanceId: string) => {
|
||||
return await request.get({
|
||||
url: '/bpm/process-instance/copy/list-by-process-instance-id',
|
||||
params: { processInstanceId }
|
||||
})
|
||||
}
|
||||
|
||||
/** GET 方式获取审批详情的查询参数:流程变量序列化为 JSON 字符串 */
|
||||
export interface ApprovalDetailQueryReqVO {
|
||||
processDefinitionId?: string
|
||||
processInstanceId?: string
|
||||
activityId?: string
|
||||
taskId?: string
|
||||
processVariablesStr?: string
|
||||
}
|
||||
|
||||
/** 查询下一个执行节点的参数 */
|
||||
export interface NextApprovalNodesReqVO {
|
||||
processInstanceId: string
|
||||
taskId: string
|
||||
processVariablesStr?: string
|
||||
selectedAssigneesStr?: string
|
||||
}
|
||||
|
||||
// 获取审批详情
|
||||
export const getApprovalDetail = async (params: ApprovalDetailQueryReqVO) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-approval-detail', params })
|
||||
}
|
||||
|
||||
/** POST 方式获取审批详情的请求体:流程变量直接以 JSON 对象传递,避免 GET 查询串过长 */
|
||||
export interface ApprovalDetailReqVO {
|
||||
processDefinitionId?: string
|
||||
processInstanceId?: string
|
||||
activityId?: string
|
||||
taskId?: string
|
||||
processVariables?: Record<string, any>
|
||||
selectedAssignees?: Record<string, number[]>
|
||||
}
|
||||
|
||||
// 获取审批详情(POST,发起页按表单值预测审批节点时使用)
|
||||
export const getApprovalDetailByPost = async (data: ApprovalDetailReqVO) => {
|
||||
return await request.post({ url: '/bpm/process-instance/get-approval-detail', data })
|
||||
}
|
||||
|
||||
// 获取下一个执行的流程节点
|
||||
export const getNextApprovalNodes = async (params: NextApprovalNodesReqVO) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-next-approval-nodes', params })
|
||||
}
|
||||
|
||||
// 管理员获取下一个执行的流程节点(跳过节点时选择自选审批人,不要求是当前审批人)
|
||||
export const getNextApprovalNodesByAdmin = async (params: NextApprovalNodesReqVO) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-next-approval-nodes-by-admin', params })
|
||||
}
|
||||
|
||||
// 获取表单字段权限
|
||||
export const getFormFieldsPermission = async (params: Record<string, unknown>) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-form-fields-permission', params })
|
||||
}
|
||||
|
||||
// 获取流程实例的 BPMN 模型视图
|
||||
export const getProcessInstanceBpmnModelView = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-bpmn-model-view?id=' + id })
|
||||
}
|
||||
|
||||
// 获取流程实例打印数据
|
||||
export const getProcessInstancePrintData = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/process-instance/get-print-data?processInstanceId=' + id })
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// BPM 流程监听器 VO
|
||||
export interface ProcessListenerVO {
|
||||
id: number // 编号
|
||||
name: string // 监听器名字
|
||||
type: string // 监听器类型
|
||||
status: number // 监听器状态
|
||||
event: string // 监听事件
|
||||
valueType: string // 监听器值类型
|
||||
value: string // 监听器值
|
||||
}
|
||||
|
||||
// BPM 流程监听器 API
|
||||
export const ProcessListenerApi = {
|
||||
// 查询流程监听器分页
|
||||
getProcessListenerPage: async (params: PageParam) => {
|
||||
return await request.get({ url: `/bpm/process-listener/page`, params })
|
||||
},
|
||||
|
||||
// 查询流程监听器详情
|
||||
getProcessListener: async (id: number) => {
|
||||
return await request.get({ url: `/bpm/process-listener/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增流程监听器
|
||||
createProcessListener: async (data: ProcessListenerVO) => {
|
||||
return await request.post({ url: `/bpm/process-listener/create`, data })
|
||||
},
|
||||
|
||||
// 修改流程监听器
|
||||
updateProcessListener: async (data: ProcessListenerVO) => {
|
||||
return await request.post({ url: `/bpm/process-listener/update`, data })
|
||||
},
|
||||
|
||||
// 删除流程监听器
|
||||
deleteProcessListener: async (id: number) => {
|
||||
return await request.post({ url: `/bpm/process-listener/delete?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 入库接口参数。 */
|
||||
export interface ProcessStorageParam {
|
||||
key: string // 参数标识
|
||||
label: string // 参数名称
|
||||
required: boolean // 是否必须映射表单字段
|
||||
}
|
||||
|
||||
/** 入库接口目录项。 */
|
||||
export interface ProcessStorageHandler {
|
||||
key: string // 接口标识
|
||||
name: string // 接口名称
|
||||
params: ProcessStorageParam[] // 接口参数
|
||||
}
|
||||
|
||||
/** 获得入库接口目录:业务模块注册的接口及其参数。 */
|
||||
export const getStorageHandlerList = (): Promise<ProcessStorageHandler[]> =>
|
||||
request.get({ url: '/bpm/process-storage/handler-list' })
|
||||
@@ -0,0 +1,25 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 修改申请状态选项。 */
|
||||
export const REVISION_APPLY_STATUS_OPTIONS = [
|
||||
{ label: '审批中', value: 1, type: 'primary' },
|
||||
{ label: '已生效', value: 2, type: 'success' },
|
||||
{ label: '已驳回', value: 3, type: 'danger' },
|
||||
{ label: '已撤销', value: 4, type: 'info' },
|
||||
{ label: '生效失败', value: 5, type: 'warning' }
|
||||
]
|
||||
|
||||
/** 提交审批意见修改申请,审批通过后自动生效。 */
|
||||
export const createOpinionApply = async (data: { taskId: string; opinion: string; reason: string }) => {
|
||||
return await request.post({ url: '/bpm/revision-apply/create', data })
|
||||
}
|
||||
|
||||
/** 分页查询修改申请。 */
|
||||
export const getApplyPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/revision-apply/page', params })
|
||||
}
|
||||
|
||||
/** 查询原流程的全部修改申请。 */
|
||||
export const getApplyList = async (processInstanceId: string) => {
|
||||
return await request.get({ url: '/bpm/revision-apply/list-by-process-instance', params: { processInstanceId } })
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
|
||||
export const updateBpmSimpleModel = async (data) => {
|
||||
return await request.post({
|
||||
url: '/bpm/model/simple/update',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export const getBpmSimpleModel = async (id) => {
|
||||
return await request.get({
|
||||
url: '/bpm/model/simple/get?id=' + id
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 模型已保存配置与指定发布版本二选一;摘要用于避免模型修改后继续沿用旧状态。 */
|
||||
export interface SimulationSource {
|
||||
modelId?: string
|
||||
processDefinitionId?: string
|
||||
snapshot?: string
|
||||
}
|
||||
|
||||
/** 仿真只使用配置快照和精简人员信息,不创建真实流程或任务。 */
|
||||
export interface SimulationDefinition {
|
||||
id: string
|
||||
modelId?: string
|
||||
snapshot?: string
|
||||
name: string
|
||||
version?: number | null
|
||||
formConf: string
|
||||
formFields: string[]
|
||||
bpmnXml: string
|
||||
modelType: number
|
||||
simpleModel?: string
|
||||
users: SimulationUser[]
|
||||
startUsers: SimulationUser[]
|
||||
departments: { id: number; name: string; parentId: number; orgType?: string; disabled: boolean }[]
|
||||
formDepartments: SimulationDefinition['departments']
|
||||
}
|
||||
|
||||
/** 有效任职部门用于模拟组织身份,登录用户保持不变。 */
|
||||
export interface SimulationUser {
|
||||
id: number
|
||||
nickname: string
|
||||
deptId?: number
|
||||
deptIds: number[]
|
||||
/** 主任职的唯一岗位,副岗与兼职不参与审批节点标题判断。 */
|
||||
primaryPostId?: number
|
||||
primaryPostName?: string
|
||||
}
|
||||
|
||||
/** 状态只保存在当前页面内存中,每次请求传入计算,不在后台保存。 */
|
||||
export interface SimulationState {
|
||||
activeNodeIds: string[]
|
||||
waitingJoins: Record<string, string[]>
|
||||
finishedNodeIds: string[]
|
||||
finishedFlowIds: string[]
|
||||
}
|
||||
|
||||
/** 当前可选择预览的节点配置;多个节点表示仍有并行分支。 */
|
||||
export interface SimulationNode {
|
||||
id: string
|
||||
name: string
|
||||
/** 按发布配置用共同主岗位名称展示审批节点。 */
|
||||
showApproverPost?: boolean
|
||||
type: 'start' | 'approve' | 'automatic' | 'copy' | 'unsupported' | 'end'
|
||||
supported: boolean
|
||||
notice?: string
|
||||
candidateUserIds: number[]
|
||||
selectAssignees: boolean
|
||||
fieldPermissions: Record<string, string>
|
||||
requiredFields: string[]
|
||||
}
|
||||
|
||||
export interface SimulationResult {
|
||||
state: SimulationState
|
||||
nodes: SimulationNode[]
|
||||
completed: boolean
|
||||
notices: string[]
|
||||
previewNotice?: string
|
||||
}
|
||||
|
||||
export interface SimulationStep extends SimulationSource {
|
||||
startUserId: number
|
||||
startDeptId: number
|
||||
nodeId?: string
|
||||
variables: Record<string, unknown>
|
||||
state: SimulationState
|
||||
selectedAssignees: Record<string, number[]>
|
||||
}
|
||||
|
||||
/** 每次开始都使用独立状态对象,避免不同弹窗之间共享数组。 */
|
||||
export const createSimulationState = (): SimulationState => ({
|
||||
activeNodeIds: [], waitingJoins: {}, finishedNodeIds: [], finishedFlowIds: []
|
||||
})
|
||||
|
||||
/** 后续计算和表单选项始终沿用打开仿真时的同一个来源。 */
|
||||
export const getSimulationSource = (definition: SimulationDefinition): SimulationSource =>
|
||||
definition.modelId ? { modelId: definition.modelId, snapshot: definition.snapshot }
|
||||
: { processDefinitionId: definition.id }
|
||||
|
||||
export const getSimulationDefinition = (source: SimulationSource): Promise<SimulationDefinition> =>
|
||||
request.get({ url: '/bpm/simulation/definition', params: source })
|
||||
|
||||
export const simulateStep = (data: SimulationStep): Promise<SimulationResult> =>
|
||||
request.post({ url: '/bpm/simulation/step', data })
|
||||
|
||||
/** 预测始终使用独立状态,不调用模拟提交或正式审批接口。 */
|
||||
export const previewSimulation = (data: SimulationStep): Promise<SimulationResult> =>
|
||||
request.post({ url: '/bpm/simulation/preview', data })
|
||||
|
||||
/** 原表单控件通过仿真专属接口取选项,保留原部门关联和范围开关。 */
|
||||
export const getSimulationFormUsers = (params: Record<string, unknown>) =>
|
||||
request.get({ url: '/bpm/simulation/form-users', params })
|
||||
|
||||
export const getSimulationFormRoles = (params: Record<string, unknown>) =>
|
||||
request.get({ url: '/bpm/simulation/form-roles', params })
|
||||
@@ -0,0 +1,55 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 流程统计查询条件:endTime 为时间范围(任务统计按办结时间,流程统计按发起时间)。 */
|
||||
export interface StatisticsReqVO {
|
||||
/** 时间范围。 */
|
||||
endTime?: string[]
|
||||
/** 流程分类编码。 */
|
||||
category?: string
|
||||
/** 流程标识。 */
|
||||
processDefinitionKey?: string
|
||||
/** 处理人部门编号。 */
|
||||
deptId?: number
|
||||
/** 处理人编号(流程统计为发起人)。 */
|
||||
userId?: number
|
||||
}
|
||||
|
||||
/** 流程维度统计。 */
|
||||
export const getProcessSummary = async (params: StatisticsReqVO) => {
|
||||
return await request.get({ url: '/bpm/statistics/process-summary', params })
|
||||
}
|
||||
|
||||
/** 节点维度统计。 */
|
||||
export const getNodeSummary = async (params: StatisticsReqVO) => {
|
||||
return await request.get({ url: '/bpm/statistics/node-summary', params })
|
||||
}
|
||||
|
||||
/** 员工耗时排名。 */
|
||||
export const getUserRanking = async (params: StatisticsReqVO) => {
|
||||
return await request.get({ url: '/bpm/statistics/user-ranking', params })
|
||||
}
|
||||
|
||||
/** 导出员工耗时排名。 */
|
||||
export const exportUserRanking = async (params: StatisticsReqVO) => {
|
||||
return await request.download({ url: '/bpm/statistics/export-user-ranking', params })
|
||||
}
|
||||
|
||||
/** 当前已超时的在办任务。 */
|
||||
export const getRunningTimeoutList = async (params: StatisticsReqVO) => {
|
||||
return await request.get({ url: '/bpm/statistics/running-timeout-list', params })
|
||||
}
|
||||
|
||||
/** 分页查询排名排除名单,包含指定人员和用户组。 */
|
||||
export const getExcludeUserPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/statistics/exclude-user/page', params })
|
||||
}
|
||||
|
||||
/** 新增排名排除记录,userId 与 userGroupId 二选一。 */
|
||||
export const createExcludeUser = async (data: { userId?: number; userGroupId?: number; remark?: string }) => {
|
||||
return await request.post({ url: '/bpm/statistics/exclude-user/create', data })
|
||||
}
|
||||
|
||||
/** 删除排名排除记录。 */
|
||||
export const deleteExcludeUser = async (id: number) => {
|
||||
return await request.post({ url: '/bpm/statistics/exclude-user/delete', params: { id } })
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/**
|
||||
* 任务状态枚举
|
||||
*/
|
||||
export enum TaskStatusEnum {
|
||||
/**
|
||||
* 跳过
|
||||
*/
|
||||
SKIP = -2,
|
||||
/**
|
||||
* 未开始
|
||||
*/
|
||||
NOT_START = -1,
|
||||
|
||||
/**
|
||||
* 待审批
|
||||
*/
|
||||
WAIT = 0,
|
||||
/**
|
||||
* 审批中
|
||||
*/
|
||||
RUNNING = 1,
|
||||
/**
|
||||
* 审批通过
|
||||
*/
|
||||
APPROVE = 2,
|
||||
|
||||
/**
|
||||
* 审批不通过
|
||||
*/
|
||||
REJECT = 3,
|
||||
|
||||
/**
|
||||
* 已取消
|
||||
*/
|
||||
CANCEL = 4,
|
||||
/**
|
||||
* 已退回
|
||||
*/
|
||||
RETURN = 5,
|
||||
/**
|
||||
* 审批通过中
|
||||
*/
|
||||
APPROVING = 7
|
||||
}
|
||||
|
||||
// 退回策略,值需与后端 BpmReturnStrategyEnum 保持一致
|
||||
export enum ReturnStrategyEnum {
|
||||
REWALK = 1,
|
||||
TARGET_DECIDES = 2
|
||||
}
|
||||
|
||||
// 退回目标节点的后续决定,值需与后端 BpmReturnTargetDecisionEnum 保持一致
|
||||
export enum ReturnTargetDecisionEnum {
|
||||
CONTINUE_BY_RULE = 1,
|
||||
JUMP_TO_SOURCE = 2
|
||||
}
|
||||
|
||||
export const getTaskTodoPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/task/todo-page', params })
|
||||
}
|
||||
|
||||
export const getTaskDonePage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/task/done-page', params })
|
||||
}
|
||||
|
||||
export const getTaskManagerPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/task/manager-page', params })
|
||||
}
|
||||
|
||||
export const approveTask = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/approve', data })
|
||||
}
|
||||
|
||||
export const rejectTask = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/reject', data })
|
||||
}
|
||||
|
||||
/** 查询流程实例任务记录;full 为 true 时包含取消、撤回等中间痕迹。 */
|
||||
export const getTaskListByProcessInstanceId = async (processInstanceId: string, full = false) => {
|
||||
return await request.get({
|
||||
url: '/bpm/task/list-by-process-instance-id',
|
||||
params: { processInstanceId, full }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取所有可退回的节点
|
||||
export const getTaskListByReturn = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/task/list-by-return', params: { id } })
|
||||
}
|
||||
|
||||
// 退回
|
||||
export const returnTask = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/return', data })
|
||||
}
|
||||
|
||||
/** 查询当前任务可安全跳转的后续串行节点。 */
|
||||
export const getTaskListByForwardJump = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/task/list-by-forward-jump', params: { id } })
|
||||
}
|
||||
|
||||
/** 当前审批人将流程跳转到选定的后续串行节点。 */
|
||||
export const forwardJumpTask = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/forward-jump', data })
|
||||
}
|
||||
|
||||
// 查询当前任务是否处于“退回目标节点决定后续方式”的上下文中
|
||||
export const getTaskReturnContext = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/task/return-context', params: { id } })
|
||||
}
|
||||
|
||||
// 委派
|
||||
export const delegateTask = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/delegate', data })
|
||||
}
|
||||
|
||||
// 转派
|
||||
export const transferTask = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/transfer', data })
|
||||
}
|
||||
|
||||
/** 管理员强制转交当前任务。 */
|
||||
export const transferTaskByAdmin = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/transfer-by-admin', data })
|
||||
}
|
||||
|
||||
// 加签
|
||||
export const signCreateTask = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/create-sign', data })
|
||||
}
|
||||
|
||||
/** 管理员对当前任务发起加签。 */
|
||||
export const signCreateTaskByAdmin = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/create-sign-by-admin', data })
|
||||
}
|
||||
|
||||
// 减签
|
||||
export const signDeleteTask = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/delete-sign', data })
|
||||
}
|
||||
|
||||
/** 管理员删除加签产生的审批任务。 */
|
||||
export const signDeleteTaskByAdmin = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/delete-sign-by-admin', data })
|
||||
}
|
||||
|
||||
/** 管理员跳过当前唯一活动审批节点。 */
|
||||
export const skipTaskByAdmin = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/skip-by-admin', data })
|
||||
}
|
||||
|
||||
// 抄送
|
||||
export const copyTask = async (data: Record<string, unknown>) => {
|
||||
return await request.post({ url: '/bpm/task/copy', data })
|
||||
}
|
||||
|
||||
// 撤回本人已办任务,reason 选填(最长 200 字),下一节点尚未审批时任务回到本人待办
|
||||
export const withdrawTask = async (taskId: string, reason?: string) => {
|
||||
return await request.post({ url: '/bpm/task/withdraw', params: { taskId, reason: reason || undefined } })
|
||||
}
|
||||
|
||||
// 获取我的待办任务
|
||||
export const myTodoTask = async (processInstanceId: string) => {
|
||||
return await request.get({ url: '/bpm/task/my-todo?processInstanceId=' + processInstanceId })
|
||||
}
|
||||
|
||||
// 获取减签任务列表
|
||||
export const getChildrenTaskList = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/task/list-by-parent-task-id?parentTaskId=' + id })
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 代理授权保存请求,时间为毫秒时间戳。 */
|
||||
export interface TaskAgentSaveReqVO {
|
||||
/** 授权编号,修改时必填。 */
|
||||
id?: number
|
||||
/** 委托人编号,仅管理员代为设置时使用。 */
|
||||
principalUserId?: number
|
||||
/** 代理人编号。 */
|
||||
agentUserId?: number
|
||||
/** 生效开始时间。 */
|
||||
startTime?: number
|
||||
/** 生效结束时间。 */
|
||||
endTime?: number
|
||||
/** 事由:1 请假、2 出差、3 其他。 */
|
||||
reasonType?: number
|
||||
/** 适用范围:1 全部流程、2 指定流程。 */
|
||||
scopeType?: number
|
||||
/** 指定流程的流程标识列表。 */
|
||||
processDefinitionKeys?: string[]
|
||||
/** 是否同时转移已有待办(仅立即生效时执行)。 */
|
||||
transferExisting?: boolean
|
||||
/** 备注。 */
|
||||
remark?: string
|
||||
}
|
||||
|
||||
/** 代理事由选项。 */
|
||||
export const AGENT_REASON_OPTIONS = [
|
||||
{ label: '请假', value: 1 },
|
||||
{ label: '出差', value: 2 },
|
||||
{ label: '其他', value: 3 }
|
||||
]
|
||||
|
||||
/** 代理适用范围选项。 */
|
||||
export const AGENT_SCOPE_OPTIONS = [
|
||||
{ label: '全部流程', value: 1 },
|
||||
{ label: '指定流程', value: 2 }
|
||||
]
|
||||
|
||||
/** 代理授权状态选项。 */
|
||||
export const AGENT_STATUS_OPTIONS = [
|
||||
{ label: '有效', value: 1, type: 'success' },
|
||||
{ label: '已撤销', value: 2, type: 'info' },
|
||||
{ label: '已过期', value: 3, type: 'warning' }
|
||||
]
|
||||
|
||||
/**
|
||||
* 授权状态的展示标签:有效但尚未到开始时间的显示“未生效”,其余按状态值显示。
|
||||
*
|
||||
* @param status 授权状态
|
||||
* @param startTime 开始时间(毫秒时间戳或日期字符串)
|
||||
*/
|
||||
export const getAgentStatusOption = (status: unknown, startTime?: unknown) => {
|
||||
const start = startTime == null || startTime === '' ? NaN : new Date(startTime as number | string).getTime()
|
||||
if (status === 1 && !Number.isNaN(start) && start > Date.now()) {
|
||||
return { label: '未生效', value: 1, type: 'primary' }
|
||||
}
|
||||
return AGENT_STATUS_OPTIONS.find((item) => item.value === status)
|
||||
}
|
||||
|
||||
/** 查询本人作为委托人或代理人的授权。 */
|
||||
export const getMyAgentPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/task-agent/my-page', params })
|
||||
}
|
||||
|
||||
/** 本人设置代理。 */
|
||||
export const createAgent = async (data: TaskAgentSaveReqVO) => {
|
||||
return await request.post({ url: '/bpm/task-agent/create', data })
|
||||
}
|
||||
|
||||
/** 本人修改代理。 */
|
||||
export const updateAgent = async (data: TaskAgentSaveReqVO) => {
|
||||
return await request.post({ url: '/bpm/task-agent/update', data })
|
||||
}
|
||||
|
||||
/** 本人撤销代理。 */
|
||||
export const revokeAgent = async (id: number) => {
|
||||
return await request.post({ url: '/bpm/task-agent/revoke', params: { id } })
|
||||
}
|
||||
|
||||
/** 管理员查询全部代理授权。 */
|
||||
export const getAgentPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/task-agent/page', params })
|
||||
}
|
||||
|
||||
/** 管理员为他人设置代理。 */
|
||||
export const createAgentByAdmin = async (data: TaskAgentSaveReqVO) => {
|
||||
return await request.post({ url: '/bpm/task-agent/create-by-admin', data })
|
||||
}
|
||||
|
||||
/** 管理员修改代理。 */
|
||||
export const updateAgentByAdmin = async (data: TaskAgentSaveReqVO) => {
|
||||
return await request.post({ url: '/bpm/task-agent/update-by-admin', data })
|
||||
}
|
||||
|
||||
/** 管理员撤销代理。 */
|
||||
export const revokeAgentByAdmin = async (id: number) => {
|
||||
return await request.post({ url: '/bpm/task-agent/revoke-by-admin', params: { id } })
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 催办请求:不传 planTime 为立即催办,传 planTime(毫秒时间戳)为预定时间催办。 */
|
||||
export interface TaskUrgeCreateReqVO {
|
||||
/** 流程实例编号。 */
|
||||
processInstanceId: string
|
||||
/** 只催办部分当前处理人时的用户编号,为空时催办全部。 */
|
||||
targetUserIds?: number[]
|
||||
/** 催办内容,为空时使用默认内容。 */
|
||||
content?: string
|
||||
/** 附加通知渠道:SMS 短信、DINGTALK 钉钉,站内信总是发送。 */
|
||||
channels?: string[]
|
||||
/** 预定催办时间。 */
|
||||
planTime?: number
|
||||
}
|
||||
|
||||
/** 催办方式名称。 */
|
||||
export const URGE_TYPE_NAMES: Record<number, string> = { 1: '手动催办', 2: '预定催办', 3: '超时提醒' }
|
||||
|
||||
/** 催办发送状态名称。 */
|
||||
export const URGE_SEND_STATUS_NAMES: Record<number, string> = {
|
||||
0: '待发送',
|
||||
1: '已发送',
|
||||
2: '部分失败',
|
||||
3: '已取消'
|
||||
}
|
||||
|
||||
/** 催办附加通知渠道,站内信总是发送无需传。 */
|
||||
export const URGE_CHANNEL = {
|
||||
/** 短信。 */
|
||||
SMS: 'SMS',
|
||||
/** 钉钉工作通知。 */
|
||||
DINGTALK: 'DINGTALK'
|
||||
} as const
|
||||
|
||||
/** 催办提交结果:发送条数(或催办记录编号)及因距上次催办过近被跳过的人员。 */
|
||||
export interface TaskUrgeCreateRespVO {
|
||||
/** 实际发送的催办条数(按待办任务计)。 */
|
||||
urgeCount?: number
|
||||
/** 生成的催办记录编号,未返回 urgeCount 时按其个数计算条数。 */
|
||||
urgeIds?: number[]
|
||||
/** 距上次催办不足最小间隔而被跳过的人员姓名。 */
|
||||
skippedUserNames?: string[]
|
||||
/** 手动催办最小间隔(分钟),后端返回时用于提示文案。 */
|
||||
minIntervalMinutes?: number
|
||||
}
|
||||
|
||||
/** 立即催办或设置预定催办,返回催办条数及被跳过的人员。 */
|
||||
export const createUrge = async (data: TaskUrgeCreateReqVO): Promise<TaskUrgeCreateRespVO | number> => {
|
||||
return await request.post({ url: '/bpm/task-urge/create', data })
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一解析催办提交结果,兼容旧接口直接返回发送条数的情况。
|
||||
*
|
||||
* @param result createUrge 的返回值
|
||||
*/
|
||||
export const parseUrgeCreateResult = (result: TaskUrgeCreateRespVO | number | null | undefined) => {
|
||||
if (typeof result === 'number') return { count: result, skippedUserNames: [] as string[], minIntervalMinutes: undefined }
|
||||
return {
|
||||
count: result?.urgeCount ?? result?.urgeIds?.length ?? 0,
|
||||
skippedUserNames: result?.skippedUserNames || [],
|
||||
minIntervalMinutes: result?.minIntervalMinutes
|
||||
}
|
||||
}
|
||||
|
||||
/** 取消尚未发送的预定催办。 */
|
||||
export const cancelUrge = async (id: number) => {
|
||||
return await request.post({ url: '/bpm/task-urge/cancel', params: { id } })
|
||||
}
|
||||
|
||||
/** 查询流程的催办记录。 */
|
||||
export const getUrgeList = async (processInstanceId: string) => {
|
||||
return await request.get({ url: '/bpm/task-urge/list-by-process-instance', params: { processInstanceId } })
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 流程可选的用户分组,取自系统管理“分组管理”,名称带上级路径 */
|
||||
export type UserGroupVO = {
|
||||
id: number
|
||||
name: string
|
||||
parentId: number
|
||||
}
|
||||
|
||||
// 获取用户组精简信息列表(仅启用分组)
|
||||
export const getUserGroupSimpleList = async (): Promise<UserGroupVO[]> => {
|
||||
return await request.get({ url: '/bpm/user-group/simple-list' })
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 移交场景选项(巡检由系统产生,不可手工选择)。 */
|
||||
export const HANDOVER_SCENE_OPTIONS = [
|
||||
{ label: '离职', value: 1 },
|
||||
{ label: '调岗', value: 2 },
|
||||
{ label: '手工', value: 3 },
|
||||
{ label: '巡检', value: 4 }
|
||||
]
|
||||
|
||||
/** 移交方式选项。 */
|
||||
export const HANDOVER_MODE_OPTIONS = [
|
||||
{ label: '指定接手人', value: 1 },
|
||||
{ label: '按节点规则重新计算', value: 2 }
|
||||
]
|
||||
|
||||
/** 移交批次状态选项。 */
|
||||
export const HANDOVER_STATUS_OPTIONS = [
|
||||
{ label: '处理中', value: 1, type: 'primary' },
|
||||
{ label: '已完成', value: 2, type: 'success' },
|
||||
{ label: '部分待处理', value: 3, type: 'warning' }
|
||||
]
|
||||
|
||||
/** 移交明细状态选项。 */
|
||||
export const HANDOVER_ITEM_STATUS_OPTIONS = [
|
||||
{ label: '已移交', value: 1, type: 'success' },
|
||||
{ label: '待管理员指定', value: 2, type: 'warning' },
|
||||
{ label: '失败', value: 3, type: 'danger' },
|
||||
{ label: '已跳过', value: 4, type: 'info' }
|
||||
]
|
||||
|
||||
/** 查询人员在途待办概况,停用、调岗前提醒用。 */
|
||||
export const getRunningSummary = async (userId: number) => {
|
||||
return await request.get({ url: '/bpm/user-handover/running-summary', params: { userId } })
|
||||
}
|
||||
|
||||
/** 批量查询人员待办(不含代理授权),仅返回有待办的人员。 */
|
||||
export interface UserRunningTaskSummary {
|
||||
userId: number
|
||||
todoCount: number
|
||||
tasks: {
|
||||
taskId: string
|
||||
taskName: string
|
||||
processInstanceId: string
|
||||
processInstanceName?: string
|
||||
suspended: boolean
|
||||
}[]
|
||||
}
|
||||
|
||||
/** 每批最多 100 人,组织变更预览按批调用,避免逐人请求。 */
|
||||
export const getRunningSummaryBatch = (userIds: number[]): Promise<UserRunningTaskSummary[]> =>
|
||||
request.get({ url: '/bpm/user-handover/running-summary-batch', params: { userIds: userIds.join(',') } })
|
||||
|
||||
/** 发起人员任务移交,返回批次编号。 */
|
||||
export const createHandover = async (data: {
|
||||
sourceUserId: number
|
||||
scene: number
|
||||
mode: number
|
||||
targetUserId?: number
|
||||
taskIds?: string[]
|
||||
reason: string
|
||||
}) => {
|
||||
return await request.post({ url: '/bpm/user-handover/create', data })
|
||||
}
|
||||
|
||||
/** 为待管理员指定的明细指定接手人。 */
|
||||
export const assignHandoverItem = async (data: { itemId: number; targetUserId: number }) => {
|
||||
return await request.post({ url: '/bpm/user-handover/assign-item', data })
|
||||
}
|
||||
|
||||
/** 分页查询移交批次。 */
|
||||
export const getHandoverPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/bpm/user-handover/page', params })
|
||||
}
|
||||
|
||||
/** 查询移交批次及明细。 */
|
||||
export const getHandover = async (id: number) => {
|
||||
return await request.get({ url: '/bpm/user-handover/get', params: { id } })
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 请假时段:上午 AM / 下午 PM */
|
||||
export type LeaveHalfDay = 'AM' | 'PM'
|
||||
|
||||
export interface LeaveDaysReqVO {
|
||||
/** 开始日期 yyyy-MM-dd */
|
||||
startDate: string
|
||||
startPeriod: LeaveHalfDay
|
||||
/** 结束日期 yyyy-MM-dd */
|
||||
endDate: string
|
||||
endPeriod: LeaveHalfDay
|
||||
}
|
||||
|
||||
/** 按工作日历核算请假天数(周一至周五为工作日,节假日不计) */
|
||||
export const getLeaveDays = async (params: LeaveDaysReqVO): Promise<number> => {
|
||||
const result = await request.get({ url: '/bpm/work-calendar/leave-days', params })
|
||||
return Number(result?.leaveDays)
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ApiAccessLogVO {
|
||||
id: number
|
||||
traceId: string
|
||||
userId: number
|
||||
userType: number
|
||||
applicationName: string
|
||||
requestMethod: string
|
||||
requestParams: string
|
||||
responseBody: string
|
||||
requestUrl: string
|
||||
userIp: string
|
||||
userAgent: string
|
||||
operateModule: string
|
||||
operateName: string
|
||||
operateType: number
|
||||
beginTime: Date
|
||||
endTime: Date
|
||||
duration: number
|
||||
resultCode: number
|
||||
resultMsg: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询列表API 访问日志
|
||||
export const getApiAccessLogPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/api-access-log/page', params })
|
||||
}
|
||||
|
||||
// 导出API 访问日志
|
||||
export const exportApiAccessLog = (params) => {
|
||||
return request.download({ url: '/infra/api-access-log/export-excel', params })
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ApiErrorLogVO {
|
||||
id: number
|
||||
traceId: string
|
||||
userId: number
|
||||
userType: number
|
||||
applicationName: string
|
||||
requestMethod: string
|
||||
requestParams: string
|
||||
requestUrl: string
|
||||
userIp: string
|
||||
userAgent: string
|
||||
exceptionTime: Date
|
||||
exceptionName: string
|
||||
exceptionMessage: string
|
||||
exceptionRootCauseMessage: string
|
||||
exceptionStackTrace: string
|
||||
exceptionClassName: string
|
||||
exceptionFileName: string
|
||||
exceptionMethodName: string
|
||||
exceptionLineNumber: number
|
||||
processUserId: number
|
||||
processStatus: number
|
||||
processTime: Date
|
||||
resultCode: number
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询列表API 访问日志
|
||||
export const getApiErrorLogPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/api-error-log/page', params })
|
||||
}
|
||||
|
||||
// 更新 API 错误日志的处理状态
|
||||
export const updateApiErrorLogPage = (id: number, processStatus: number) => {
|
||||
return request.post({
|
||||
url: '/infra/api-error-log/update-status?id=' + id + '&processStatus=' + processStatus
|
||||
})
|
||||
}
|
||||
|
||||
// 导出API 访问日志
|
||||
export const exportApiErrorLog = (params) => {
|
||||
return request.download({
|
||||
url: '/infra/api-error-log/export-excel',
|
||||
params
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type CodegenTableVO = {
|
||||
id: number
|
||||
tableId: number
|
||||
isParentMenuIdValid: boolean
|
||||
dataSourceConfigId: number
|
||||
scene: number
|
||||
tableName: string
|
||||
tableComment: string
|
||||
remark: string
|
||||
moduleName: string
|
||||
businessName: string
|
||||
className: string
|
||||
classComment: string
|
||||
author: string
|
||||
createTime: Date
|
||||
updateTime: Date
|
||||
templateType: number
|
||||
parentMenuId: number
|
||||
}
|
||||
|
||||
export type CodegenColumnVO = {
|
||||
id: number
|
||||
tableId: number
|
||||
columnName: string
|
||||
dataType: string
|
||||
columnComment: string
|
||||
nullable: number
|
||||
primaryKey: number
|
||||
ordinalPosition: number
|
||||
javaType: string
|
||||
javaField: string
|
||||
dictType: string
|
||||
example: string
|
||||
createOperation: number
|
||||
updateOperation: number
|
||||
listOperation: number
|
||||
listOperationCondition: string
|
||||
listOperationResult: number
|
||||
htmlType: string
|
||||
}
|
||||
|
||||
export type DatabaseTableVO = {
|
||||
name: string
|
||||
comment: string
|
||||
}
|
||||
|
||||
export type CodegenPreviewVO = {
|
||||
filePath: string
|
||||
code: string
|
||||
}
|
||||
|
||||
export type CodegenUpdateReqVO = {
|
||||
table: CodegenTableVO | any
|
||||
columns: CodegenColumnVO[]
|
||||
}
|
||||
|
||||
// 查询列表代码生成表定义
|
||||
export const getCodegenTableList = (dataSourceConfigId: number) => {
|
||||
return request.get({ url: '/infra/codegen/table/list?dataSourceConfigId=' + dataSourceConfigId })
|
||||
}
|
||||
|
||||
// 查询列表代码生成表定义
|
||||
export const getCodegenTablePage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/codegen/table/page', params })
|
||||
}
|
||||
|
||||
// 查询详情代码生成表定义
|
||||
export const getCodegenTable = (id: number) => {
|
||||
return request.get({ url: '/infra/codegen/detail?tableId=' + id })
|
||||
}
|
||||
|
||||
// 修改代码生成表定义
|
||||
export const updateCodegenTable = (data: CodegenUpdateReqVO) => {
|
||||
return request.post({ url: '/infra/codegen/update', data })
|
||||
}
|
||||
|
||||
// 基于数据库的表结构,同步数据库的表和字段定义
|
||||
export const syncCodegenFromDB = (id: number) => {
|
||||
return request.post({ url: '/infra/codegen/sync-from-db?tableId=' + id })
|
||||
}
|
||||
|
||||
// 预览生成代码
|
||||
export const previewCodegen = (id: number) => {
|
||||
return request.get({ url: '/infra/codegen/preview?tableId=' + id })
|
||||
}
|
||||
|
||||
// 下载生成代码
|
||||
export const downloadCodegen = (id: number) => {
|
||||
return request.download({ url: '/infra/codegen/download?tableId=' + id })
|
||||
}
|
||||
|
||||
// 获得表定义
|
||||
export const getSchemaTableList = (params) => {
|
||||
return request.get({ url: '/infra/codegen/db/table/list', params })
|
||||
}
|
||||
|
||||
// 基于数据库的表结构,创建代码生成器的表定义
|
||||
export const createCodegenList = (data) => {
|
||||
return request.post({ url: '/infra/codegen/create-list', data })
|
||||
}
|
||||
|
||||
// 删除代码生成表定义
|
||||
export const deleteCodegenTable = (id: number) => {
|
||||
return request.post({ url: '/infra/codegen/delete?tableId=' + id })
|
||||
}
|
||||
|
||||
// 批量删除代码生成表定义
|
||||
export const deleteCodegenTableList = (ids: number[]) => {
|
||||
return request.post({ url: '/infra/codegen/delete-list', params: { tableIds: ids.join(',') } })
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ConfigVO {
|
||||
id: number | undefined
|
||||
category: string
|
||||
name: string
|
||||
key: string
|
||||
value: string
|
||||
valueType: 'string' | 'number' | 'boolean' | 'json' | 'userGroup'
|
||||
status: number
|
||||
type: number
|
||||
visible: boolean
|
||||
remark: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
export const BREADCRUMB_ENABLED_CONFIG_KEY = 'system.ui.breadcrumb.enabled'
|
||||
|
||||
// 查询参数列表
|
||||
export const getConfigPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/config/page', params })
|
||||
}
|
||||
|
||||
// 查询参数详情
|
||||
export const getConfig = (id: number) => {
|
||||
return request.get({ url: '/infra/config/get?id=' + id })
|
||||
}
|
||||
|
||||
// 根据参数键名查询参数值
|
||||
export const getConfigKey = (configKey: string) => {
|
||||
return request.get<string | null>({
|
||||
url: '/infra/config/get-value-by-key?key=' + encodeURIComponent(configKey)
|
||||
})
|
||||
}
|
||||
|
||||
// 新增参数
|
||||
export const createConfig = (data: ConfigVO) => {
|
||||
return request.post({ url: '/infra/config/create', data })
|
||||
}
|
||||
|
||||
// 修改参数
|
||||
export const updateConfig = (data: ConfigVO) => {
|
||||
return request.post({ url: '/infra/config/update', data })
|
||||
}
|
||||
|
||||
// 删除参数
|
||||
export const deleteConfig = (id: number) => {
|
||||
return request.post({ url: '/infra/config/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除参数
|
||||
export const deleteConfigList = (ids: number[]) => {
|
||||
return request.post({ url: '/infra/config/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 导出参数
|
||||
export const exportConfig = (params) => {
|
||||
return request.download({ url: '/infra/config/export-excel', params })
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface DataSourceConfigVO {
|
||||
id: number | undefined
|
||||
name: string
|
||||
url: string
|
||||
username: string
|
||||
password: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
// 新增数据源配置
|
||||
export const createDataSourceConfig = (data: DataSourceConfigVO) => {
|
||||
return request.post({ url: '/infra/data-source-config/create', data })
|
||||
}
|
||||
|
||||
// 修改数据源配置
|
||||
export const updateDataSourceConfig = (data: DataSourceConfigVO) => {
|
||||
return request.post({ url: '/infra/data-source-config/update', data })
|
||||
}
|
||||
|
||||
// 删除数据源配置
|
||||
export const deleteDataSourceConfig = (id: number) => {
|
||||
return request.post({ url: '/infra/data-source-config/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除数据源配置
|
||||
export const deleteDataSourceConfigList = (ids: number[]) => {
|
||||
return request.post({
|
||||
url: '/infra/data-source-config/delete-list',
|
||||
params: { ids: ids.join(',') }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询数据源配置详情
|
||||
export const getDataSourceConfig = (id: number) => {
|
||||
return request.get({ url: '/infra/data-source-config/get?id=' + id })
|
||||
}
|
||||
|
||||
// 查询数据源配置列表
|
||||
export const getDataSourceConfigList = () => {
|
||||
return request.get({ url: '/infra/data-source-config/list' })
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 联调日志开关与容量状态 */
|
||||
export interface DebugLogStatusVO {
|
||||
enabled: boolean
|
||||
mqCapacity: number
|
||||
mqSize: number
|
||||
}
|
||||
|
||||
/** 平台对 MQ 消息的受理结果 */
|
||||
export type MqDebugLogResult = 'ACCEPTED' | 'DUPLICATE' | 'REJECTED' | 'ERROR'
|
||||
|
||||
/** 一条消息队列联调记录 */
|
||||
export interface MqDebugLogVO {
|
||||
id: number
|
||||
receiveTime: number
|
||||
topic: string
|
||||
messageId?: string
|
||||
sourceChannel?: string
|
||||
busiKey?: string
|
||||
publishTime?: string
|
||||
reconsumeTimes?: number
|
||||
eventId?: string
|
||||
eventType?: string
|
||||
operation?: string
|
||||
sourceAppId?: string
|
||||
sourceObjectId?: string
|
||||
result: MqDebugLogResult
|
||||
reason?: string
|
||||
receiptId?: string
|
||||
body?: string
|
||||
}
|
||||
|
||||
export interface MqDebugLogPageReqVO extends PageParam {
|
||||
topic?: string
|
||||
sourceChannel?: string
|
||||
result?: MqDebugLogResult
|
||||
keyword?: string
|
||||
receiveTime?: string[]
|
||||
}
|
||||
|
||||
/** 查询联调日志开关与容量。 */
|
||||
export const getDebugLogStatus = (): Promise<DebugLogStatusVO> => {
|
||||
return request.get({ url: '/infra/debug-log/status' })
|
||||
}
|
||||
|
||||
/** 分页查询平台收到的 MQ 消息,最新的在前。 */
|
||||
export const getMqDebugLogPage = (params: MqDebugLogPageReqVO): Promise<PageResult<MqDebugLogVO[]>> => {
|
||||
return request.get({ url: '/infra/debug-log/mq/page', params })
|
||||
}
|
||||
|
||||
/** 查询一条 MQ 联调记录详情。 */
|
||||
export const getMqDebugLog = (id: number): Promise<MqDebugLogVO> => {
|
||||
return request.get({ url: '/infra/debug-log/mq/get?id=' + id })
|
||||
}
|
||||
|
||||
/** 清空 MQ 联调记录。 */
|
||||
export const clearMqDebugLog = () => {
|
||||
return request.post({ url: '/infra/debug-log/mq/clear' })
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
|
||||
/** 示例联系人信息 */
|
||||
export interface Demo01Contact {
|
||||
id: number // 编号
|
||||
name?: string // 名字
|
||||
sex?: number // 性别
|
||||
birthday?: string | Dayjs // 出生年
|
||||
description?: string // 简介
|
||||
avatar: string // 头像
|
||||
}
|
||||
|
||||
// 示例联系人 API
|
||||
export const Demo01ContactApi = {
|
||||
// 查询示例联系人分页
|
||||
getDemo01ContactPage: async (params: PageParam) => {
|
||||
return await request.get({ url: `/infra/demo01-contact/page`, params })
|
||||
},
|
||||
|
||||
// 查询示例联系人详情
|
||||
getDemo01Contact: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo01-contact/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增示例联系人
|
||||
createDemo01Contact: async (data: Demo01Contact) => {
|
||||
return await request.post({ url: `/infra/demo01-contact/create`, data })
|
||||
},
|
||||
|
||||
// 修改示例联系人
|
||||
updateDemo01Contact: async (data: Demo01Contact) => {
|
||||
return await request.post({ url: `/infra/demo01-contact/update`, data })
|
||||
},
|
||||
|
||||
// 删除示例联系人
|
||||
deleteDemo01Contact: async (id: number) => {
|
||||
return await request.post({ url: `/infra/demo01-contact/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除示例联系人 */
|
||||
deleteDemo01ContactList: async (ids: number[]) => {
|
||||
return await request.post({ url: `/infra/demo01-contact/delete-list?ids=${ids.join(',')}` })
|
||||
},
|
||||
|
||||
// 导出示例联系人 Excel
|
||||
exportDemo01Contact: async (params) => {
|
||||
return await request.download({ url: `/infra/demo01-contact/export-excel`, params })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface Demo02CategoryVO {
|
||||
id: number
|
||||
name: string
|
||||
parentId: number
|
||||
}
|
||||
|
||||
// 查询示例分类列表
|
||||
export const getDemo02CategoryList = async () => {
|
||||
return await request.get({ url: `/infra/demo02-category/list` })
|
||||
}
|
||||
|
||||
// 查询示例分类详情
|
||||
export const getDemo02Category = async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo02-category/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增示例分类
|
||||
export const createDemo02Category = async (data: Demo02CategoryVO) => {
|
||||
return await request.post({ url: `/infra/demo02-category/create`, data })
|
||||
}
|
||||
|
||||
// 修改示例分类
|
||||
export const updateDemo02Category = async (data: Demo02CategoryVO) => {
|
||||
return await request.post({ url: `/infra/demo02-category/update`, data })
|
||||
}
|
||||
|
||||
// 删除示例分类
|
||||
export const deleteDemo02Category = async (id: number) => {
|
||||
return await request.post({ url: `/infra/demo02-category/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出示例分类 Excel
|
||||
export const exportDemo02Category = async (params) => {
|
||||
return await request.download({ url: `/infra/demo02-category/export-excel`, params })
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
|
||||
/** 学生课程信息 */
|
||||
export interface Demo03Course {
|
||||
id: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
score?: number // 分数
|
||||
}
|
||||
|
||||
/** 学生班级信息 */
|
||||
export interface Demo03Grade {
|
||||
id: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
teacher?: string // 班主任
|
||||
}
|
||||
|
||||
/** 学生信息 */
|
||||
export interface Demo03Student {
|
||||
id: number // 编号
|
||||
name?: string // 名字
|
||||
sex?: number // 性别
|
||||
birthday?: string | Dayjs // 出生日期
|
||||
description?: string // 简介
|
||||
}
|
||||
|
||||
// 学生 API
|
||||
export const Demo03StudentApi = {
|
||||
// 查询学生分页
|
||||
getDemo03StudentPage: async (params: PageParam) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/page`, params })
|
||||
},
|
||||
|
||||
// 查询学生详情
|
||||
getDemo03Student: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增学生
|
||||
createDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生
|
||||
updateDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生
|
||||
deleteDemo03Student: async (id: number) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除学生 */
|
||||
deleteDemo03StudentList: async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: `/infra/demo03-student-erp/delete-list?ids=${ids.join(',')}`
|
||||
})
|
||||
},
|
||||
|
||||
// 导出学生 Excel
|
||||
exportDemo03Student: async (params) => {
|
||||
return await request.download({ url: `/infra/demo03-student-erp/export-excel`, params })
|
||||
},
|
||||
|
||||
// ==================== 子表(学生课程) ====================
|
||||
|
||||
// 获得学生课程分页
|
||||
getDemo03CoursePage: async (params) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/demo03-course/page`, params })
|
||||
},
|
||||
// 新增学生课程
|
||||
createDemo03Course: async (data: Demo03Course) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/demo03-course/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生课程
|
||||
updateDemo03Course: async (data: Demo03Course) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/demo03-course/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生课程
|
||||
deleteDemo03Course: async (id: number) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/demo03-course/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除学生课程 */
|
||||
deleteDemo03CourseList: async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: `/infra/demo03-student-erp/demo03-course/delete-list?ids=${ids.join(',')}`
|
||||
})
|
||||
},
|
||||
|
||||
// 获得学生课程
|
||||
getDemo03Course: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/demo03-course/get?id=` + id })
|
||||
},
|
||||
|
||||
// ==================== 子表(学生班级) ====================
|
||||
|
||||
// 获得学生班级分页
|
||||
getDemo03GradePage: async (params) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/demo03-grade/page`, params })
|
||||
},
|
||||
// 新增学生班级
|
||||
createDemo03Grade: async (data: Demo03Grade) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/demo03-grade/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生班级
|
||||
updateDemo03Grade: async (data: Demo03Grade) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/demo03-grade/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生班级
|
||||
deleteDemo03Grade: async (id: number) => {
|
||||
return await request.post({ url: `/infra/demo03-student-erp/demo03-grade/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除学生班级 */
|
||||
deleteDemo03GradeList: async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: `/infra/demo03-student-erp/demo03-grade/delete-list?ids=${ids.join(',')}`
|
||||
})
|
||||
},
|
||||
|
||||
// 获得学生班级
|
||||
getDemo03Grade: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo03-student-erp/demo03-grade/get?id=` + id })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
|
||||
/** 学生课程信息 */
|
||||
export interface Demo03Course {
|
||||
id: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
score?: number // 分数
|
||||
}
|
||||
|
||||
/** 学生班级信息 */
|
||||
export interface Demo03Grade {
|
||||
id: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
teacher?: string // 班主任
|
||||
}
|
||||
|
||||
/** 学生信息 */
|
||||
export interface Demo03Student {
|
||||
id: number // 编号
|
||||
name?: string // 名字
|
||||
sex?: number // 性别
|
||||
birthday?: string | Dayjs // 出生日期
|
||||
description?: string // 简介
|
||||
demo03courses?: Demo03Course[]
|
||||
demo03grade?: Demo03Grade
|
||||
}
|
||||
|
||||
// 学生 API
|
||||
export const Demo03StudentApi = {
|
||||
// 查询学生分页
|
||||
getDemo03StudentPage: async (params: PageParam) => {
|
||||
return await request.get({ url: `/infra/demo03-student-inner/page`, params })
|
||||
},
|
||||
|
||||
// 查询学生详情
|
||||
getDemo03Student: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo03-student-inner/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增学生
|
||||
createDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.post({ url: `/infra/demo03-student-inner/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生
|
||||
updateDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.post({ url: `/infra/demo03-student-inner/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生
|
||||
deleteDemo03Student: async (id: number) => {
|
||||
return await request.post({ url: `/infra/demo03-student-inner/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除学生 */
|
||||
deleteDemo03StudentList: async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: `/infra/demo03-student-inner/delete-list?ids=${ids.join(',')}`
|
||||
})
|
||||
},
|
||||
|
||||
// 导出学生 Excel
|
||||
exportDemo03Student: async (params) => {
|
||||
return await request.download({ url: `/infra/demo03-student-inner/export-excel`, params })
|
||||
},
|
||||
|
||||
// ==================== 子表(学生课程) ====================
|
||||
|
||||
// 获得学生课程列表
|
||||
getDemo03CourseListByStudentId: async (studentId) => {
|
||||
return await request.get({
|
||||
url: `/infra/demo03-student-inner/demo03-course/list-by-student-id?studentId=` + studentId
|
||||
})
|
||||
},
|
||||
|
||||
// ==================== 子表(学生班级) ====================
|
||||
|
||||
// 获得学生班级
|
||||
getDemo03GradeByStudentId: async (studentId) => {
|
||||
return await request.get({
|
||||
url: `/infra/demo03-student-inner/demo03-grade/get-by-student-id?studentId=` + studentId
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import request from '@/config/axios'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
|
||||
/** 学生课程信息 */
|
||||
export interface Demo03Course {
|
||||
id: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
score?: number // 分数
|
||||
}
|
||||
|
||||
/** 学生班级信息 */
|
||||
export interface Demo03Grade {
|
||||
id: number // 编号
|
||||
studentId?: number // 学生编号
|
||||
name?: string // 名字
|
||||
teacher?: string // 班主任
|
||||
}
|
||||
|
||||
/** 学生信息 */
|
||||
export interface Demo03Student {
|
||||
id: number // 编号
|
||||
name?: string // 名字
|
||||
sex?: number // 性别
|
||||
birthday?: string | Dayjs // 出生日期
|
||||
description?: string // 简介
|
||||
demo03courses?: Demo03Course[]
|
||||
demo03grade?: Demo03Grade
|
||||
}
|
||||
|
||||
// 学生 API
|
||||
export const Demo03StudentApi = {
|
||||
// 查询学生分页
|
||||
getDemo03StudentPage: async (params: PageParam) => {
|
||||
return await request.get({ url: `/infra/demo03-student-normal/page`, params })
|
||||
},
|
||||
|
||||
// 查询学生详情
|
||||
getDemo03Student: async (id: number) => {
|
||||
return await request.get({ url: `/infra/demo03-student-normal/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增学生
|
||||
createDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.post({ url: `/infra/demo03-student-normal/create`, data })
|
||||
},
|
||||
|
||||
// 修改学生
|
||||
updateDemo03Student: async (data: Demo03Student) => {
|
||||
return await request.post({ url: `/infra/demo03-student-normal/update`, data })
|
||||
},
|
||||
|
||||
// 删除学生
|
||||
deleteDemo03Student: async (id: number) => {
|
||||
return await request.post({ url: `/infra/demo03-student-normal/delete?id=` + id })
|
||||
},
|
||||
|
||||
/** 批量删除学生 */
|
||||
deleteDemo03StudentList: async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: `/infra/demo03-student-normal/delete-list?ids=${ids.join(',')}`
|
||||
})
|
||||
},
|
||||
|
||||
// 导出学生 Excel
|
||||
exportDemo03Student: async (params) => {
|
||||
return await request.download({ url: `/infra/demo03-student-normal/export-excel`, params })
|
||||
},
|
||||
|
||||
// ==================== 子表(学生课程) ====================
|
||||
|
||||
// 获得学生课程列表
|
||||
getDemo03CourseListByStudentId: async (studentId) => {
|
||||
return await request.get({
|
||||
url: `/infra/demo03-student-normal/demo03-course/list-by-student-id?studentId=` + studentId
|
||||
})
|
||||
},
|
||||
|
||||
// ==================== 子表(学生班级) ====================
|
||||
|
||||
// 获得学生班级
|
||||
getDemo03GradeByStudentId: async (studentId) => {
|
||||
return await request.get({
|
||||
url: `/infra/demo03-student-normal/demo03-grade/get-by-student-id?studentId=` + studentId
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
import type { AxiosProgressEvent } from 'axios'
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 文件可见性:PUBLIC 公开图片(稳定地址可保存);PRIVATE 私有文件(仅短时签名地址,业务保存 fileId) */
|
||||
export type FileVisibility = 'PUBLIC' | 'PRIVATE'
|
||||
|
||||
/** 统一文件上传 / 访问地址 Response VO */
|
||||
export interface UnifiedFileRespVO {
|
||||
// 文件编号
|
||||
fileId: number
|
||||
// 原始文件名
|
||||
name: string
|
||||
// 文件类型(服务端检测)
|
||||
contentType: string
|
||||
// 文件大小(字节)
|
||||
size: number
|
||||
// 可见性
|
||||
visibility: FileVisibility
|
||||
// 访问地址:公开文件为稳定相对地址;私有文件为短时签名地址,禁止保存
|
||||
url: string
|
||||
// 签名地址过期时间,公开文件为 null
|
||||
expiresAt: string | null
|
||||
}
|
||||
|
||||
/** 统一文件上传参数 */
|
||||
export interface UnifiedFileUploadReqVO {
|
||||
// 上传的文件
|
||||
file: File | Blob
|
||||
// 业务目录,需匹配 ^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$,例如 notice-pdf、avatar、bpm-sign、editor
|
||||
directory?: string
|
||||
// 是否强制私有(图片默认公开,传 true 时按私有文件存储)
|
||||
forcePrivate?: boolean
|
||||
}
|
||||
|
||||
/** 统一上传接口原始返回结构(request.upload 不拆包) */
|
||||
export interface UnifiedFileUploadResult {
|
||||
code: number
|
||||
data: UnifiedFileRespVO
|
||||
msg: string
|
||||
}
|
||||
|
||||
/** 文件管理分页项 */
|
||||
export interface UnifiedFileVO {
|
||||
// 文件编号
|
||||
id: number
|
||||
// 所属应用编号
|
||||
applicationId?: number
|
||||
// 上传时的应用编码
|
||||
applicationCode?: string
|
||||
// 存储年度
|
||||
storageYear?: number
|
||||
// 存储日期 yyyy-MM-dd
|
||||
storageDate?: string
|
||||
// 原始文件名
|
||||
name: string
|
||||
// 文件类型
|
||||
contentType: string
|
||||
// 文件大小(字节)
|
||||
size: number
|
||||
// 可见性
|
||||
visibility: FileVisibility
|
||||
// 业务模块
|
||||
directory?: string
|
||||
// 来源:PLATFORM 平台上传,OPEN_API 开放接口,MIGRATION 历史迁移
|
||||
source?: string
|
||||
// 仅公开文件返回稳定地址,私有文件为 null
|
||||
url: string | null
|
||||
// 创建人
|
||||
creator?: string
|
||||
// 上传人姓名;用户已删除或上传来源非用户时可能为空
|
||||
creatorName?: string
|
||||
// 创建时间
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
/** 文件管理分页查询参数 */
|
||||
export interface UnifiedFilePageReqVO extends PageParam {
|
||||
// 文件编号,精确匹配
|
||||
id?: number
|
||||
// 所属应用编号
|
||||
applicationId?: number
|
||||
// 存储日期范围 [开始, 结束],yyyy-MM-dd,含首尾
|
||||
storageDate?: string[]
|
||||
// 业务模块,精确匹配
|
||||
directory?: string
|
||||
// 原始文件名,前缀匹配
|
||||
name?: string
|
||||
// 字节数区间,含首尾
|
||||
sizeMin?: number
|
||||
sizeMax?: number
|
||||
// 可见范围
|
||||
visibility?: FileVisibility
|
||||
// 来源
|
||||
source?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件(统一上传入口),返回 CommonResult 原始结构,data 为统一文件对象
|
||||
* @param data 上传参数
|
||||
* @param onUploadProgress 上传进度回调
|
||||
*/
|
||||
export const uploadUnifiedFile = (
|
||||
data: UnifiedFileUploadReqVO,
|
||||
onUploadProgress?: (evt: AxiosProgressEvent) => void
|
||||
): Promise<UnifiedFileUploadResult> => {
|
||||
return request.upload({ url: '/infra/unified-file/upload', data, onUploadProgress })
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本人上传文件的新访问地址(仅限当前用户上传的文件,用于保存前预览 / 下载)
|
||||
* @param fileId 文件编号
|
||||
*/
|
||||
export const getUnifiedFileAccessUrl = (fileId: number) => {
|
||||
return request.post<UnifiedFileRespVO>({
|
||||
url: '/infra/unified-file/access-url',
|
||||
data: { fileId }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件管理:分页查询
|
||||
* @param params 查询参数
|
||||
*/
|
||||
export const getUnifiedFilePage = (params: UnifiedFilePageReqVO) => {
|
||||
return request.get<PageResult<UnifiedFileVO[]>>({ url: '/infra/unified-file/page', params })
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件管理:获取任意文件的新签名访问地址(需 infra:file:query 权限)
|
||||
* @param fileId 文件编号
|
||||
*/
|
||||
export const getManageFileAccessUrl = (fileId: number) => {
|
||||
return request.post<UnifiedFileRespVO>({
|
||||
url: '/infra/unified-file/manage-access-url',
|
||||
data: { fileId }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件管理:删除文件
|
||||
* @param id 文件编号
|
||||
*/
|
||||
export const deleteUnifiedFile = (id: number) => {
|
||||
return request.post({ url: '/infra/unified-file/delete?id=' + id })
|
||||
}
|
||||
|
||||
/** 文件管理的应用筛选项 */
|
||||
export interface FileApplicationOption {
|
||||
id: number
|
||||
name: string
|
||||
applicationCode: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件管理:应用筛选项,当前租户全部应用(需 infra:file:query 权限)
|
||||
*/
|
||||
export const getFileApplicationOptions = () => {
|
||||
return request.get<FileApplicationOption[]>({ url: '/system/application/file-filter-options' })
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface JobVO {
|
||||
id: number
|
||||
name: string
|
||||
status: number
|
||||
handlerName: string
|
||||
handlerParam: string
|
||||
cronExpression: string
|
||||
retryCount: number
|
||||
retryInterval: number
|
||||
monitorTimeout: number
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 任务列表
|
||||
export const getJobPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/job/page', params })
|
||||
}
|
||||
|
||||
// 任务详情
|
||||
export const getJob = (id: number) => {
|
||||
return request.get({ url: '/infra/job/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增任务
|
||||
export const createJob = (data: JobVO) => {
|
||||
return request.post({ url: '/infra/job/create', data })
|
||||
}
|
||||
|
||||
// 修改定时任务调度
|
||||
export const updateJob = (data: JobVO) => {
|
||||
return request.post({ url: '/infra/job/update', data })
|
||||
}
|
||||
|
||||
// 删除定时任务调度
|
||||
export const deleteJob = (id: number) => {
|
||||
return request.post({ url: '/infra/job/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除定时任务调度
|
||||
export const deleteJobList = (ids: number[]) => {
|
||||
return request.post({ url: '/infra/job/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 导出定时任务调度
|
||||
export const exportJob = (params) => {
|
||||
return request.download({ url: '/system/mechanism/export', params })
|
||||
}
|
||||
|
||||
// 任务状态修改
|
||||
export const updateJobStatus = (id: number, status: number) => {
|
||||
const params = {
|
||||
id,
|
||||
status
|
||||
}
|
||||
return request.post({ url: '/infra/job/update-status', params })
|
||||
}
|
||||
|
||||
// 定时任务立即执行一次
|
||||
export const runJob = (id: number) => {
|
||||
return request.post({ url: '/infra/job/trigger?id=' + id })
|
||||
}
|
||||
|
||||
// 获得定时任务的下 n 次执行时间
|
||||
export const getJobNextTimes = (id: number) => {
|
||||
return request.get({ url: '/infra/job/get_next_times?id=' + id })
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface JobLogVO {
|
||||
id: number
|
||||
jobId: number
|
||||
handlerName: string
|
||||
handlerParam: string
|
||||
cronExpression: string
|
||||
executeIndex: string
|
||||
beginTime: Date
|
||||
endTime: Date
|
||||
duration: string
|
||||
status: number
|
||||
createTime: string
|
||||
result: string
|
||||
}
|
||||
|
||||
// 任务日志列表
|
||||
export const getJobLogPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/job-log/page', params })
|
||||
}
|
||||
|
||||
// 任务日志详情
|
||||
export const getJobLog = (id: number) => {
|
||||
return request.get({ url: '/infra/job-log/get?id=' + id })
|
||||
}
|
||||
|
||||
// 导出定时任务日志
|
||||
export const exportJobLog = (params) => {
|
||||
return request.download({
|
||||
url: '/infra/job-log/export-excel',
|
||||
params
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/**
|
||||
* 获取redis 监控信息
|
||||
*/
|
||||
export const getCache = () => {
|
||||
return request.get({ url: '/infra/redis/get-monitor-info' })
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
export interface RedisMonitorInfoVO {
|
||||
info: RedisInfoVO
|
||||
dbSize: number
|
||||
commandStats: RedisCommandStatsVO[]
|
||||
}
|
||||
|
||||
export interface RedisInfoVO {
|
||||
io_threaded_reads_processed: string
|
||||
tracking_clients: string
|
||||
uptime_in_seconds: string
|
||||
cluster_connections: string
|
||||
current_cow_size: string
|
||||
maxmemory_human: string
|
||||
aof_last_cow_size: string
|
||||
master_replid2: string
|
||||
mem_replication_backlog: string
|
||||
aof_rewrite_scheduled: string
|
||||
total_net_input_bytes: string
|
||||
rss_overhead_ratio: string
|
||||
hz: string
|
||||
current_cow_size_age: string
|
||||
redis_build_id: string
|
||||
errorstat_BUSYGROUP: string
|
||||
aof_last_bgrewrite_status: string
|
||||
multiplexing_api: string
|
||||
client_recent_max_output_buffer: string
|
||||
allocator_resident: string
|
||||
mem_fragmentation_bytes: string
|
||||
aof_current_size: string
|
||||
repl_backlog_first_byte_offset: string
|
||||
tracking_total_prefixes: string
|
||||
redis_mode: string
|
||||
redis_git_dirty: string
|
||||
aof_delayed_fsync: string
|
||||
allocator_rss_bytes: string
|
||||
repl_backlog_histlen: string
|
||||
io_threads_active: string
|
||||
rss_overhead_bytes: string
|
||||
total_system_memory: string
|
||||
loading: string
|
||||
evicted_keys: string
|
||||
maxclients: string
|
||||
cluster_enabled: string
|
||||
redis_version: string
|
||||
repl_backlog_active: string
|
||||
mem_aof_buffer: string
|
||||
allocator_frag_bytes: string
|
||||
io_threaded_writes_processed: string
|
||||
instantaneous_ops_per_sec: string
|
||||
used_memory_human: string
|
||||
total_error_replies: string
|
||||
role: string
|
||||
maxmemory: string
|
||||
used_memory_lua: string
|
||||
rdb_current_bgsave_time_sec: string
|
||||
used_memory_startup: string
|
||||
used_cpu_sys_main_thread: string
|
||||
lazyfree_pending_objects: string
|
||||
aof_pending_bio_fsync: string
|
||||
used_memory_dataset_perc: string
|
||||
allocator_frag_ratio: string
|
||||
arch_bits: string
|
||||
used_cpu_user_main_thread: string
|
||||
mem_clients_normal: string
|
||||
expired_time_cap_reached_count: string
|
||||
unexpected_error_replies: string
|
||||
mem_fragmentation_ratio: string
|
||||
aof_last_rewrite_time_sec: string
|
||||
master_replid: string
|
||||
aof_rewrite_in_progress: string
|
||||
lru_clock: string
|
||||
maxmemory_policy: string
|
||||
run_id: string
|
||||
latest_fork_usec: string
|
||||
tracking_total_items: string
|
||||
total_commands_processed: string
|
||||
expired_keys: string
|
||||
errorstat_ERR: string
|
||||
used_memory: string
|
||||
module_fork_in_progress: string
|
||||
errorstat_WRONGPASS: string
|
||||
aof_buffer_length: string
|
||||
dump_payload_sanitizations: string
|
||||
mem_clients_slaves: string
|
||||
keyspace_misses: string
|
||||
server_time_usec: string
|
||||
executable: string
|
||||
lazyfreed_objects: string
|
||||
db0: string
|
||||
used_memory_peak_human: string
|
||||
keyspace_hits: string
|
||||
rdb_last_cow_size: string
|
||||
aof_pending_rewrite: string
|
||||
used_memory_overhead: string
|
||||
active_defrag_hits: string
|
||||
tcp_port: string
|
||||
uptime_in_days: string
|
||||
used_memory_peak_perc: string
|
||||
current_save_keys_processed: string
|
||||
blocked_clients: string
|
||||
total_reads_processed: string
|
||||
expire_cycle_cpu_milliseconds: string
|
||||
sync_partial_err: string
|
||||
used_memory_scripts_human: string
|
||||
aof_current_rewrite_time_sec: string
|
||||
aof_enabled: string
|
||||
process_supervised: string
|
||||
master_repl_offset: string
|
||||
used_memory_dataset: string
|
||||
used_cpu_user: string
|
||||
rdb_last_bgsave_status: string
|
||||
tracking_total_keys: string
|
||||
atomicvar_api: string
|
||||
allocator_rss_ratio: string
|
||||
client_recent_max_input_buffer: string
|
||||
clients_in_timeout_table: string
|
||||
aof_last_write_status: string
|
||||
mem_allocator: string
|
||||
used_memory_scripts: string
|
||||
used_memory_peak: string
|
||||
process_id: string
|
||||
master_failover_state: string
|
||||
errorstat_NOAUTH: string
|
||||
used_cpu_sys: string
|
||||
repl_backlog_size: string
|
||||
connected_slaves: string
|
||||
current_save_keys_total: string
|
||||
gcc_version: string
|
||||
total_system_memory_human: string
|
||||
sync_full: string
|
||||
connected_clients: string
|
||||
module_fork_last_cow_size: string
|
||||
total_writes_processed: string
|
||||
allocator_active: string
|
||||
total_net_output_bytes: string
|
||||
pubsub_channels: string
|
||||
current_fork_perc: string
|
||||
active_defrag_key_hits: string
|
||||
rdb_changes_since_last_save: string
|
||||
instantaneous_input_kbps: string
|
||||
used_memory_rss_human: string
|
||||
configured_hz: string
|
||||
expired_stale_perc: string
|
||||
active_defrag_misses: string
|
||||
used_cpu_sys_children: string
|
||||
number_of_cached_scripts: string
|
||||
sync_partial_ok: string
|
||||
used_memory_lua_human: string
|
||||
rdb_last_save_time: string
|
||||
pubsub_patterns: string
|
||||
slave_expires_tracked_keys: string
|
||||
redis_git_sha1: string
|
||||
used_memory_rss: string
|
||||
rdb_last_bgsave_time_sec: string
|
||||
os: string
|
||||
mem_not_counted_for_evict: string
|
||||
active_defrag_running: string
|
||||
rejected_connections: string
|
||||
aof_rewrite_buffer_length: string
|
||||
total_forks: string
|
||||
active_defrag_key_misses: string
|
||||
allocator_allocated: string
|
||||
aof_base_size: string
|
||||
instantaneous_output_kbps: string
|
||||
second_repl_offset: string
|
||||
rdb_bgsave_in_progress: string
|
||||
used_cpu_user_children: string
|
||||
total_connections_received: string
|
||||
migrate_cached_sockets: string
|
||||
}
|
||||
|
||||
export interface RedisCommandStatsVO {
|
||||
command: string
|
||||
calls: number
|
||||
usec: number
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import request from '@/config/axios'
|
||||
import type { TokenType } from './types'
|
||||
import { formatToken, getAuthSession, type AuthSessionSnapshot } from '@/utils/auth'
|
||||
|
||||
// 使用租户名,获得租户编号
|
||||
export const getTenantIdByName = (name: string) => {
|
||||
return request.get<number>({ url: '/system/tenant/get-id-by-name?name=' + name })
|
||||
}
|
||||
|
||||
// 登出
|
||||
export const loginOut = (session: AuthSessionSnapshot = getAuthSession()) => {
|
||||
return request.post({
|
||||
url: '/system/auth/logout',
|
||||
headers: { isToken: false, Authorization: formatToken(session.accessToken) },
|
||||
authSession: session,
|
||||
skipAuthRefresh: true
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户权限信息
|
||||
export const getInfo = () => {
|
||||
return request.get({ url: '/system/auth/get-permission-info' })
|
||||
}
|
||||
|
||||
/** 当前登录账号可切换的组织身份,岗位仅用于展示。 */
|
||||
export interface OrganizationContext {
|
||||
userId: number
|
||||
nickname: string
|
||||
avatar: string
|
||||
currentOrganizationKey: string | null
|
||||
organizations: {
|
||||
organizationKey: string
|
||||
organizationId: number
|
||||
organizationName: string
|
||||
postNames: string[]
|
||||
/** 组织身份包含的有效副岗、兼职,用于类型标签展示。 */
|
||||
hasDeputy?: boolean
|
||||
hasPart?: boolean
|
||||
selected: boolean
|
||||
}[]
|
||||
}
|
||||
|
||||
/** 从服务端读取当前组织及账号可用身份,不使用浏览器组织缓存。 */
|
||||
export const getOrganizationContext = () => {
|
||||
return request.get<OrganizationContext>({ url: '/system/auth/organization-context' })
|
||||
}
|
||||
|
||||
/** 切换服务端会话的组织身份。 */
|
||||
export const switchOrganization = (organizationKey: string) => {
|
||||
return request.post<boolean>({
|
||||
url: '/system/auth/switch-organization',
|
||||
data: { organizationKey }
|
||||
})
|
||||
}
|
||||
|
||||
// 获取财开云第一方应用的统一登录地址
|
||||
export const getSsoLoginUrl = (applicationCode: string, callbackUrl: string, requestId: string) => {
|
||||
return request.post<string>({
|
||||
url: '/system/sso-client/login-url',
|
||||
params: { applicationCode, callbackUrl, requestId },
|
||||
withCredentials: true,
|
||||
headers: { isToken: false },
|
||||
skipAuthRefresh: true
|
||||
})
|
||||
}
|
||||
|
||||
// 获取财开云第一方应用的统一注销地址
|
||||
export const getSsoLogoutUrl = (applicationCode: string, callbackUrl: string, requestId: string, session: AuthSessionSnapshot) => {
|
||||
return request.post<string>({
|
||||
url: '/system/sso-client/logout-url',
|
||||
params: { applicationCode, callbackUrl, requestId, sessionBinding: session.ssoSessionBinding },
|
||||
withCredentials: true,
|
||||
headers: { isToken: false },
|
||||
authSession: session,
|
||||
skipAuthRefresh: true
|
||||
})
|
||||
}
|
||||
|
||||
// 消费统一登录回调票据并建立当前应用会话
|
||||
export const exchangeSsoTicket = (applicationCode: string, ticket: string, loginRequestId: string, clientType: 0 | 1 = 0) => {
|
||||
return request.post<TokenType>({
|
||||
url: '/system/sso-client/exchange',
|
||||
params: { applicationCode, ticket, loginRequestId, clientType },
|
||||
withCredentials: true,
|
||||
headers: { isToken: false },
|
||||
skipAuthRefresh: true
|
||||
})
|
||||
}
|
||||
|
||||
// 获取验证图片以及 token
|
||||
export const getCode = (data: any) => {
|
||||
return request.postOriginal({
|
||||
url: 'system/captcha/get', data, headers: { isToken: false }, skipAuthRefresh: true
|
||||
})
|
||||
}
|
||||
|
||||
// 滑动或者点选验证
|
||||
export const reqCheck = (data: any) => {
|
||||
return request.postOriginal({
|
||||
url: 'system/captcha/check', data, headers: { isToken: false }, skipAuthRefresh: true
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
export type TokenType = {
|
||||
ssoSessionBinding?: string
|
||||
id: number // 编号
|
||||
accessToken: string // 访问令牌
|
||||
refreshToken: string // 刷新令牌
|
||||
userId: number // 用户编号
|
||||
userType: number //用户类型
|
||||
clientId: string //客户端编号
|
||||
expiresTime: number //过期时间
|
||||
}
|
||||
|
||||
export type UserVO = {
|
||||
id: number
|
||||
username: string
|
||||
nickname: string
|
||||
deptId: number
|
||||
email: string
|
||||
mobile: string
|
||||
sex: number
|
||||
avatar: string
|
||||
loginIp: string
|
||||
loginDate: string
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 门户站内信的移动端(钉钉)提醒记录 */
|
||||
export interface InboxRemindVO {
|
||||
id: number
|
||||
inboxId: number
|
||||
targetType: 'WORK_ITEM' | 'MESSAGE'
|
||||
recipientUserId: number
|
||||
recipientName?: string
|
||||
sourceAppId: string
|
||||
remindType: string
|
||||
title?: string
|
||||
channel: string
|
||||
/** 0 待发送,1 已发送,2 发送失败,3 已跳过 */
|
||||
status: number
|
||||
retryCount: number
|
||||
nextTime?: string
|
||||
sendTime?: string
|
||||
taskId?: string
|
||||
lastError?: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
export interface InboxRemindPageReqVO extends PageParam {
|
||||
recipientUserId?: number
|
||||
sourceAppId?: string
|
||||
remindType?: string
|
||||
channel?: string
|
||||
status?: number
|
||||
title?: string
|
||||
createTime?: string[]
|
||||
}
|
||||
|
||||
/** 分页查询站内信提醒记录。 */
|
||||
export const getInboxRemindPage = (params: InboxRemindPageReqVO): Promise<PageResult<InboxRemindVO[]>> => {
|
||||
return request.get({ url: '/portal/inbox-remind/page', params })
|
||||
}
|
||||
|
||||
/** 提醒记录来源应用选项,以消息中的 appId 作为筛选值。 */
|
||||
export interface InboxRemindApplicationOption {
|
||||
appId: string
|
||||
name: string
|
||||
}
|
||||
|
||||
/** 查询当前租户的提醒来源应用,包含停用应用。 */
|
||||
export const getInboxRemindApplicationOptions = (): Promise<InboxRemindApplicationOption[]> => {
|
||||
return request.get({ url: '/system/application/inbox-remind-filter-options' })
|
||||
}
|
||||
|
||||
/** 重发一条发送失败或已跳过的提醒。 */
|
||||
export const resendInboxRemind = (id: number) => {
|
||||
return request.post({ url: '/portal/inbox-remind/resend?id=' + id })
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface IntegrationEventVO {
|
||||
id: number
|
||||
eventId: string
|
||||
sourceAppId: string
|
||||
eventType: 'WORK_ITEM' | 'MESSAGE'
|
||||
operation: string
|
||||
sourceObjectId: string
|
||||
sourceVersion: number
|
||||
processStatus: number
|
||||
retryCount: number
|
||||
resultMessage?: string
|
||||
createTime: string
|
||||
}
|
||||
|
||||
export interface IntegrationEventPageReqVO extends PageParam {
|
||||
sourceAppId?: string
|
||||
eventType?: string
|
||||
operation?: string
|
||||
processStatus?: number
|
||||
eventId?: string
|
||||
sourceObjectId?: string
|
||||
createTime?: string[]
|
||||
}
|
||||
|
||||
/** 查询第三方系统通过 MQ 送达平台的统一事件。 */
|
||||
export const getIntegrationEventPage = (
|
||||
params: IntegrationEventPageReqVO
|
||||
): Promise<PageResult<IntegrationEventVO[]>> => {
|
||||
return request.get({ url: '/portal/events/page', params })
|
||||
}
|
||||
|
||||
/** 重试一条处理失败的入站事件。 */
|
||||
export const retryIntegrationEvent = (id: number) => {
|
||||
return request.post({ url: '/portal/events/retry?id=' + id })
|
||||
}
|
||||
@@ -0,0 +1,429 @@
|
||||
import request from '@/config/axios'
|
||||
import { MenuPermission } from '@/utils/menuPermission'
|
||||
import type { DeptVO } from '@/api/system/dept'
|
||||
|
||||
/** 应用类型:1 内置(平台自有应用,带内置数据范围),2 业务应用。 */
|
||||
export enum ApplicationType {
|
||||
BUILT_IN = 1,
|
||||
BUSINESS = 2
|
||||
}
|
||||
|
||||
/** 应用详情,对应后端 ApplicationRespVO */
|
||||
export interface ApplicationVO {
|
||||
id: number
|
||||
/** 应用所属组织,决定管理台应用管理范围 */
|
||||
deptId: number
|
||||
deptName?: string
|
||||
name: string
|
||||
shortName?: string
|
||||
applicationCode: string
|
||||
applicationType: number
|
||||
defaultApplication: boolean
|
||||
icon?: string
|
||||
homeUrl?: string
|
||||
/** 是否在移动端门户展示 */
|
||||
mobileSupported: boolean
|
||||
/** 移动端展示时必须配置的独立应用地址 */
|
||||
mobileHomeUrl?: string
|
||||
sort: number
|
||||
/** 是否在 PC 工作台展示;不影响移动端入口、SSO 与开放接口权限 */
|
||||
portalVisible?: boolean
|
||||
/** 是否向本租户所有已登录用户展示已开启的门户入口 */
|
||||
allUsersVisible?: boolean
|
||||
/** 开放接口授权总开关 */
|
||||
apiAccessEnabled?: boolean
|
||||
/** 是否旧单点接入(致远兼容) */
|
||||
legacySeeyonEnabled?: boolean
|
||||
/** 是否旧单点接入(数新认证中心兼容) */
|
||||
legacyDatanewEnabled?: boolean
|
||||
status: number
|
||||
description?: string
|
||||
/** MQ 渠道编码,应用的消息 SDK 启动时读取;为空表示未接入消息队列 */
|
||||
mqChannel?: string
|
||||
/** 移动端提醒渠道,逗号分隔(目前只有 DINGTALK);为空表示不提醒 */
|
||||
mobileRemindChannels?: string
|
||||
/** 移动端提醒范围,逗号分隔的站内信类型 */
|
||||
mobileRemindTypes?: string
|
||||
appId: string
|
||||
secretMask?: string
|
||||
keyVersion: number
|
||||
accessTokenValiditySeconds: number
|
||||
refreshTokenValiditySeconds: number
|
||||
authVersion: number
|
||||
version: number
|
||||
ssoEnabled?: boolean
|
||||
createTime: Date | string
|
||||
}
|
||||
|
||||
/** 应用精简信息,对应后端 ApplicationSimpleRespVO */
|
||||
export interface ApplicationSimpleVO {
|
||||
id: number
|
||||
/** 应用所属组织 */
|
||||
deptId: number
|
||||
deptName?: string
|
||||
mobileHomeUrl?: string
|
||||
name: string
|
||||
shortName?: string
|
||||
applicationCode: string
|
||||
applicationType: number
|
||||
defaultApplication: boolean
|
||||
icon?: string
|
||||
homeUrl?: string
|
||||
status: number
|
||||
/** MQ 渠道编码,为空表示未接入消息队列 */
|
||||
mqChannel?: string
|
||||
}
|
||||
|
||||
/** 应用分页查询,对应后端 ApplicationPageReqVO */
|
||||
export interface ApplicationPageReqVO extends PageParam {
|
||||
keyword?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
/** 创建应用,对应后端 ApplicationCreateReqVO */
|
||||
export interface ApplicationCreateReqVO {
|
||||
/** 必须属于当前用户所属或分管组织及其下级范围 */
|
||||
deptId: number
|
||||
applicationCode: string
|
||||
name: string
|
||||
shortName?: string
|
||||
icon?: string
|
||||
/** 是否在 PC 工作台展示;创建时不传按不展示处理,更新时不传保持原值 */
|
||||
portalVisible?: boolean
|
||||
/** 是否全员可见;仅影响门户入口展示 */
|
||||
allUsersVisible?: boolean
|
||||
/** PC 端应用地址,PC 展示开启时必填,须为完整 HTTP/HTTPS 地址 */
|
||||
homeUrl?: string
|
||||
/** 是否在移动端门户展示 */
|
||||
mobileSupported: boolean
|
||||
/** 移动端展示开启时必填 */
|
||||
mobileHomeUrl?: string
|
||||
sort: number
|
||||
description?: string
|
||||
/** MQ 渠道编码;传空串表示不登记(更新时会清空已登记的渠道) */
|
||||
mqChannel?: string
|
||||
/** 移动端提醒渠道,逗号分隔;传空串表示不提醒,更新时不传保持原值 */
|
||||
mobileRemindChannels?: string
|
||||
/** 移动端提醒范围,逗号分隔;更新时不传保持原值 */
|
||||
mobileRemindTypes?: string
|
||||
accessTokenValiditySeconds: number
|
||||
refreshTokenValiditySeconds: number
|
||||
}
|
||||
|
||||
/** 创建应用结果;原始密钥只会在本次响应中返回 */
|
||||
export interface ApplicationCreateRespVO {
|
||||
applicationId: number
|
||||
appId: string
|
||||
appSecretKey: string
|
||||
adminRoleId: number
|
||||
status: number
|
||||
}
|
||||
|
||||
/** 更新应用,对应后端 ApplicationUpdateReqVO */
|
||||
export interface ApplicationUpdateReqVO extends ApplicationCreateReqVO {
|
||||
id: number
|
||||
version: number
|
||||
}
|
||||
|
||||
export interface ApplicationUpdateStatusReqVO {
|
||||
id: number
|
||||
status: number
|
||||
version: number
|
||||
}
|
||||
|
||||
export interface ApplicationRotateSecretRespVO {
|
||||
appSecretKey: string
|
||||
keyVersion: number
|
||||
authVersion: number
|
||||
}
|
||||
|
||||
/** 独立 SSO 配置,对应后端 ApplicationSsoConfigReqVO */
|
||||
export interface ApplicationSsoConfigReqVO {
|
||||
applicationId: number
|
||||
ssoEnabled: boolean
|
||||
launchUrl?: string
|
||||
callbackUrl?: string
|
||||
}
|
||||
|
||||
export type ApplicationSsoConfigRespVO = ApplicationSsoConfigReqVO
|
||||
|
||||
/** 旧单点接入(致远兼容)配置,对应后端 ApplicationLegacySeeyonConfigVO */
|
||||
export interface ApplicationLegacySeeyonConfigVO {
|
||||
applicationId: number
|
||||
enabled: boolean
|
||||
/** 第三方单点回调地址(原致远第三方系统注册里登记的地址) */
|
||||
callbackUrl?: string
|
||||
/** 致远中该应用的 ID */
|
||||
seeyonAppId?: string
|
||||
/** 推送待办、消息使用的系统注册编码 */
|
||||
registerCode?: string
|
||||
/** 回调参数 from,默认 A8 */
|
||||
fromCode?: string
|
||||
/** 回调参数 interneturl */
|
||||
internetUrl?: string
|
||||
restUsername?: string
|
||||
/** 读取时为已保存的密码;保存时为空表示不修改 */
|
||||
restPassword?: string
|
||||
/** 允许的来源 IP,每行一个,支持 IPv4 网段 */
|
||||
allowedIps?: string
|
||||
/** 来源 IP 限制:true 拦截名单外的来源,false 只记录 */
|
||||
ipEnforced?: boolean
|
||||
/** ticket 回查返回的身份:loginName 登录名,telNumber 手机号 */
|
||||
identityField?: 'loginName' | 'telNumber'
|
||||
/** 只读:最近的调用来源 IP,lastTime 为毫秒时间戳 */
|
||||
recentSourceIps?: { ip: string; lastTime?: number }[]
|
||||
/** 只读:兼容层 SSO 回调地址 */
|
||||
ssoCallbackUrl?: string
|
||||
/** 只读:兼容层单点登录地址 */
|
||||
ssoLaunchUrl?: string
|
||||
}
|
||||
|
||||
/** 旧单点接入(数新认证中心兼容)配置,对应后端 ApplicationLegacyDatanewConfigVO */
|
||||
export interface ApplicationLegacyDatanewConfigVO {
|
||||
applicationId: number
|
||||
enabled: boolean
|
||||
/** 原认证中心分配的系统编码 systemCode */
|
||||
systemCode?: string
|
||||
/** 读取时为已保存的密钥;保存时为空表示不修改 */
|
||||
systemSecret?: string
|
||||
/** 原认证中心的租户标识 tenant,默认 default */
|
||||
tenantCode?: string
|
||||
/** 第三方系统单点登录入口地址 */
|
||||
entryUrl?: string
|
||||
/** 允许的回跳地址前缀,每行一个;为空时只允许与入口地址同源 */
|
||||
serviceUrls?: string
|
||||
/** 返回给第三方的用户名:loginName 登录名,telNumber 手机号 */
|
||||
identityField?: 'loginName' | 'telNumber'
|
||||
/** 只读:兼容层 SSO 回调地址 */
|
||||
ssoCallbackUrl?: string
|
||||
/** 只读:兼容层单点登录地址 */
|
||||
ssoLaunchUrl?: string
|
||||
/** 只读:本环境的认证中心地址(第三方 casServerUrlPrefix) */
|
||||
authCenterUrl?: string
|
||||
}
|
||||
|
||||
/** 开放 API 目录授权项 */
|
||||
export interface ApplicationApiGrantItemVO {
|
||||
apiCode: string
|
||||
name: string
|
||||
method: string
|
||||
pathTemplate: string
|
||||
requiredScope?: string
|
||||
granted: boolean
|
||||
qps: number
|
||||
maxConcurrency: number
|
||||
version?: number
|
||||
}
|
||||
|
||||
/** 应用开放 API 授权配置 */
|
||||
export interface ApplicationApiGrantConfigVO {
|
||||
applicationId: number
|
||||
enabled: boolean
|
||||
apiItems: ApplicationApiGrantItemVO[]
|
||||
}
|
||||
|
||||
/** 应用开放 API 授权配置保存参数 */
|
||||
export interface ApplicationApiGrantConfigReqVO {
|
||||
applicationId: number
|
||||
enabled: boolean
|
||||
grantedApiCodes: string[]
|
||||
}
|
||||
|
||||
/** 应用授权服务端分页结果。 */
|
||||
export interface ApplicationApiGrantPageVO {
|
||||
enabled: boolean
|
||||
total: number
|
||||
list: ApplicationApiGrantItemVO[]
|
||||
}
|
||||
|
||||
/** 仅操作当前行授权,不覆盖其他页。 */
|
||||
export interface ApplicationApiGrantStatusReqVO {
|
||||
applicationId: number
|
||||
apiCode: string
|
||||
granted: boolean
|
||||
}
|
||||
|
||||
export const getApplicationApiGrantPage = (params: {
|
||||
applicationId: number
|
||||
pageNo: number
|
||||
pageSize: number
|
||||
keyword?: string
|
||||
}): Promise<ApplicationApiGrantPageVO> =>
|
||||
request.get({ url: '/system/application/api-grant-page', params })
|
||||
|
||||
export const updateApplicationApiGrantStatus = (data: ApplicationApiGrantStatusReqVO): Promise<boolean> =>
|
||||
request.post({ url: '/system/application/api-grant-status', data })
|
||||
|
||||
/** 单独修改授权接口限流参数,不改变应用令牌。 */
|
||||
export interface ApplicationApiRateLimitReqVO {
|
||||
applicationId: number
|
||||
apiCode: string
|
||||
qps: number
|
||||
maxConcurrency: number
|
||||
version: number
|
||||
}
|
||||
|
||||
export const updateApplicationApiRateLimit = (data: ApplicationApiRateLimitReqVO): Promise<boolean> =>
|
||||
request.post({ url: '/system/application/api-rate-limit', data })
|
||||
|
||||
export const updateApplicationApiAccessStatus = (data: {
|
||||
applicationId: number
|
||||
enabled: boolean
|
||||
}): Promise<boolean> =>
|
||||
request.post({ url: '/system/application/api-access-status', data })
|
||||
|
||||
/** 平台全局开放接口目录 */
|
||||
export interface OpenApiVO {
|
||||
id: number
|
||||
apiCode: string
|
||||
name: string
|
||||
method: string
|
||||
pathTemplate: string
|
||||
requiredScope?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type OpenApiSaveReqVO = Omit<OpenApiVO, 'id'> & { id?: number }
|
||||
|
||||
export const getOpenApiList = (): Promise<OpenApiVO[]> =>
|
||||
request.get({ url: '/system/open-api/list' })
|
||||
|
||||
export const getOpenApi = (id: number): Promise<OpenApiVO> =>
|
||||
request.get({ url: '/system/open-api/get', params: { id } })
|
||||
|
||||
export const createOpenApi = (data: OpenApiSaveReqVO): Promise<number> =>
|
||||
request.post({ url: '/system/open-api/create', data })
|
||||
|
||||
export const updateOpenApi = (data: OpenApiSaveReqVO): Promise<boolean> =>
|
||||
request.post({ url: '/system/open-api/update', data })
|
||||
|
||||
export const deleteOpenApi = (id: number): Promise<boolean> =>
|
||||
request.post({ url: '/system/open-api/delete', params: { id } })
|
||||
|
||||
// 查询应用分页
|
||||
export const getApplicationPage = (
|
||||
params: ApplicationPageReqVO,
|
||||
menuCode?: MenuPermission
|
||||
): Promise<PageResult<ApplicationVO[]>> => {
|
||||
return request.get({ url: '/system/application/page', params: { ...params, menuCode } })
|
||||
}
|
||||
|
||||
// 查询应用精简列表;菜单范围为空时保留历史全量查询语义。
|
||||
export const getSimpleApplicationList = (menuCode?: MenuPermission): Promise<ApplicationSimpleVO[]> => {
|
||||
return request.get({ url: '/system/application/simple-list', params: { menuCode } })
|
||||
}
|
||||
|
||||
/** 应用归属组织选项,与应用管理列表使用同一组织范围。 */
|
||||
export const getManagedDeptList = (menuCode?: MenuPermission): Promise<DeptVO[]> => {
|
||||
return request.get({ url: '/system/application/managed-dept-list', params: { menuCode } })
|
||||
}
|
||||
|
||||
// 查询应用详情
|
||||
export const getApplication = (id: number): Promise<ApplicationVO> => {
|
||||
return request.get({ url: '/system/application/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增应用;响应包含仅展示一次的原始密钥
|
||||
export const createApplication = (
|
||||
data: ApplicationCreateReqVO
|
||||
): Promise<ApplicationCreateRespVO> => {
|
||||
return request.post({ url: '/system/application/create', data })
|
||||
}
|
||||
|
||||
// 修改应用基础信息
|
||||
export const updateApplication = (data: ApplicationUpdateReqVO) => {
|
||||
return request.post({ url: '/system/application/update', data })
|
||||
}
|
||||
|
||||
// 修改应用状态
|
||||
export const updateApplicationStatus = (data: ApplicationUpdateStatusReqVO) => {
|
||||
return request.post({ url: '/system/application/update-status', data })
|
||||
}
|
||||
|
||||
// 轮换应用密钥;响应中的原始密钥仅展示一次
|
||||
export const rotateApplicationSecret = (id: number): Promise<ApplicationRotateSecretRespVO> => {
|
||||
return request.post({ url: '/system/application/rotate-secret?id=' + id })
|
||||
}
|
||||
|
||||
// 独立保存应用 SSO 配置
|
||||
export const updateApplicationSsoConfig = (data: ApplicationSsoConfigReqVO) => {
|
||||
return request.post({ url: '/system/application/sso-config', data })
|
||||
}
|
||||
|
||||
// 查询应用 SSO 配置
|
||||
export const getApplicationSsoConfig = (
|
||||
applicationId: number
|
||||
): Promise<ApplicationSsoConfigRespVO> => {
|
||||
return request.get({ url: '/system/application/sso-config', params: { applicationId } })
|
||||
}
|
||||
|
||||
/** 查询应用旧单点接入(致远兼容)配置 */
|
||||
export const getApplicationLegacySeeyonConfig = (
|
||||
applicationId: number
|
||||
): Promise<ApplicationLegacySeeyonConfigVO> =>
|
||||
request.get({ url: '/system/application/legacy-seeyon-config', params: { applicationId } })
|
||||
|
||||
/** 保存应用旧单点接入配置;开启时后端同时把 SSO 地址改为兼容层地址 */
|
||||
export const updateApplicationLegacySeeyonConfig = (data: ApplicationLegacySeeyonConfigVO): Promise<boolean> =>
|
||||
request.post({ url: '/system/application/legacy-seeyon-config', data })
|
||||
|
||||
/** 查询应用数新认证中心兼容配置 */
|
||||
export const getApplicationLegacyDatanewConfig = (
|
||||
applicationId: number
|
||||
): Promise<ApplicationLegacyDatanewConfigVO> =>
|
||||
request.get({ url: '/system/application/legacy-datanew-config', params: { applicationId } })
|
||||
|
||||
/** 保存应用数新认证中心兼容配置;开启时后端同时把 SSO 地址改为兼容层地址 */
|
||||
export const updateApplicationLegacyDatanewConfig = (data: ApplicationLegacyDatanewConfigVO): Promise<boolean> =>
|
||||
request.post({ url: '/system/application/legacy-datanew-config', data })
|
||||
|
||||
// 查询应用开放 API 授权配置
|
||||
/** 流程状态通知地址;notifyUrl 为空表示不接收推送 */
|
||||
export interface ApplicationNotifyConfigVO {
|
||||
applicationId: number
|
||||
notifyUrl?: string
|
||||
}
|
||||
|
||||
/** 查询应用流程状态通知地址 */
|
||||
export const getApplicationNotifyConfig = (applicationId: number): Promise<ApplicationNotifyConfigVO> =>
|
||||
request.get({ url: '/system/application/notify-config', params: { applicationId } })
|
||||
|
||||
/** 保存应用流程状态通知地址,传空表示停用推送 */
|
||||
export const saveApplicationNotifyConfig = (data: ApplicationNotifyConfigVO): Promise<boolean> =>
|
||||
request.post({ url: '/system/application/notify-config', data })
|
||||
|
||||
/**
|
||||
* 应用人员、组织数据授权范围,按组织与按数据来源二选一:
|
||||
* 按组织时勾选的组织自动包含全部下级,未勾选即无权获取;按数据来源时 0 全部、1 人事、2 自建
|
||||
*/
|
||||
export interface ApplicationOrgScopeVO {
|
||||
applicationId: number
|
||||
/** 1 按组织,2 按数据来源 */
|
||||
mode?: number
|
||||
deptIds: number[]
|
||||
dataSource?: number
|
||||
}
|
||||
|
||||
/** 查询应用授权范围 */
|
||||
export const getApplicationOrgScope = (applicationId: number): Promise<ApplicationOrgScopeVO> =>
|
||||
request.get({ url: '/system/application/org-scope', params: { applicationId } })
|
||||
|
||||
/** 保存应用授权范围 */
|
||||
export const saveApplicationOrgScope = (data: ApplicationOrgScopeVO): Promise<boolean> =>
|
||||
request.post({ url: '/system/application/org-scope', data })
|
||||
|
||||
export const getApplicationApiGrantConfig = (
|
||||
applicationId: number
|
||||
): Promise<ApplicationApiGrantConfigVO> => {
|
||||
return request.get({ url: '/system/application/api-grant-config', params: { applicationId } })
|
||||
}
|
||||
|
||||
// 全量保存应用开放 API 授权配置
|
||||
export const saveApplicationApiGrantConfig = (data: ApplicationApiGrantConfigReqVO) => {
|
||||
return request.post({ url: '/system/application/api-grant-config', data })
|
||||
}
|
||||
|
||||
// 删除应用
|
||||
export const deleteApplication = (id: number) => {
|
||||
return request.post({ url: '/system/application/delete?id=' + id })
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
import request from '@/config/axios'
|
||||
import type { MenuVO } from '@/api/system/menu'
|
||||
import type { RoleVO } from '@/api/system/role'
|
||||
import type { TagVO } from '@/api/system/tag'
|
||||
|
||||
/** 配置范围与后端枚举保持一致,仅用于文件和本次操作。 */
|
||||
export enum ApplicationConfigSection {
|
||||
MENUS = 'MENUS',
|
||||
ROLES = 'ROLES',
|
||||
TAGS = 'TAGS'
|
||||
}
|
||||
|
||||
/** 应用注册下独立授权的配置迁移按钮。 */
|
||||
export const ApplicationConfigPermission = {
|
||||
EXPORT: 'system:application:config-export',
|
||||
IMPORT: 'system:application:config-import'
|
||||
} as const
|
||||
|
||||
export const applicationConfigSections = [
|
||||
{ value: ApplicationConfigSection.MENUS, label: '菜单配置' },
|
||||
{ value: ApplicationConfigSection.ROLES, label: '角色配置(含权限绑定)' },
|
||||
{ value: ApplicationConfigSection.TAGS, label: '数据权限定义' }
|
||||
]
|
||||
|
||||
/** 与后端导入策略保持一致。 */
|
||||
export enum ApplicationConfigImportMode {
|
||||
MERGE = 'MERGE',
|
||||
REPLACE = 'REPLACE'
|
||||
}
|
||||
|
||||
/** 完整应用配置文件,引用现有字段,不包含人员授权、密钥或接入配置。 */
|
||||
export interface ApplicationConfigPackage {
|
||||
formatVersion: number
|
||||
complete: boolean
|
||||
sections?: ApplicationConfigSection[]
|
||||
applicationName: string
|
||||
applicationCode: string
|
||||
menus: Omit<MenuVO, 'createTime'>[]
|
||||
roles: Omit<RoleVO, 'createTime' | 'tags'>[]
|
||||
tags: Omit<TagVO, 'createTime' | 'roleCount'>[]
|
||||
roleMenus: { roleId: number; menuId: number }[]
|
||||
roleTags: { roleId: number; tagId: number; tagValue?: string }[]
|
||||
departments: { id: number; name: string; orgCode?: string }[]
|
||||
}
|
||||
|
||||
export interface ApplicationConfigChange {
|
||||
category: string
|
||||
action: string
|
||||
name: string
|
||||
detail: string
|
||||
}
|
||||
|
||||
export interface ApplicationConfigDeptMapping {
|
||||
sourceId: number
|
||||
sourceName: string
|
||||
sourceCode?: string
|
||||
targetId?: number
|
||||
targetName?: string
|
||||
}
|
||||
|
||||
export interface ApplicationConfigPreview {
|
||||
token?: string
|
||||
sourceName: string
|
||||
sourceCode: string
|
||||
targetName: string
|
||||
targetCode: string
|
||||
codeMismatch: boolean
|
||||
changes: ApplicationConfigChange[]
|
||||
errors: string[]
|
||||
warnings: string[]
|
||||
departments: ApplicationConfigDeptMapping[]
|
||||
}
|
||||
|
||||
/** 按实际变更在后端逐项校验已有增删改与授权权限。 */
|
||||
export const previewApplicationConfig = (data: {
|
||||
applicationId: number
|
||||
mode: ApplicationConfigImportMode
|
||||
sections: ApplicationConfigSection[]
|
||||
config: ApplicationConfigPackage
|
||||
departmentMappings: Record<number, number>
|
||||
includePresets: boolean
|
||||
}): Promise<ApplicationConfigPreview> =>
|
||||
request.post({ url: '/system/application/config/preview', data })
|
||||
|
||||
export const exportApplicationConfig = (
|
||||
applicationId: number,
|
||||
sections?: ApplicationConfigSection[]
|
||||
): Promise<ApplicationConfigPackage> =>
|
||||
request.get({
|
||||
url: '/system/application/config/export',
|
||||
params: { applicationId, sections: sections?.join(',') }
|
||||
})
|
||||
|
||||
/** 正式执行只提交服务端凭证,不能在确认后偷偷更换文件或目标。 */
|
||||
export const importApplicationConfig = (
|
||||
token: string,
|
||||
confirmCodeMismatch: boolean
|
||||
): Promise<boolean> =>
|
||||
request.post({ url: '/system/application/config/import', data: { token, confirmCodeMismatch } })
|
||||
@@ -0,0 +1,11 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 获得地区树
|
||||
export const getAreaTree = async () => {
|
||||
return await request.get({ url: '/system/area/tree' })
|
||||
}
|
||||
|
||||
// 获得 IP 对应的地区名
|
||||
export const getAreaByIp = async (ip: string) => {
|
||||
return await request.get({ url: '/system/area/get-by-ip?ip=' + ip })
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import request from '@/config/axios'
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
import { MenuPermission } from '@/utils/menuPermission'
|
||||
|
||||
export interface DeptVO {
|
||||
id: number
|
||||
name: string
|
||||
shortName?: string // 组织简称,用于任职列表下方的所属单位展示
|
||||
parentId: number
|
||||
orgType?: string
|
||||
status: number
|
||||
sort: number
|
||||
leaderUserId: number
|
||||
supervisorUserId: number
|
||||
phone: string
|
||||
email: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询部门(精简)列表
|
||||
export const getSimpleDeptList = (): Promise<DeptVO[]> => {
|
||||
return request.get({ url: '/system/dept/simple-list' })
|
||||
}
|
||||
|
||||
/** 按当前菜单查询启用机构树,复用有效任职角色的数据范围。 */
|
||||
export const getMenuDeptTree = (menuCode: MenuPermission): Promise<DeptVO[]> => {
|
||||
return request.get({
|
||||
url: '/system/dept/organization-tree',
|
||||
params: { menuCode, status: CommonStatusEnum.ENABLE }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询部门列表
|
||||
export const getDeptList = (params: Record<string, unknown>) => {
|
||||
return request.get({ url: '/system/dept/list', params })
|
||||
}
|
||||
|
||||
// 查询部门分页
|
||||
export const getDeptPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/system/dept/list', params })
|
||||
}
|
||||
|
||||
// 查询部门详情
|
||||
export const getDept = (id: number) => {
|
||||
return request.get({ url: '/system/dept/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增部门
|
||||
export const createDept = (data: DeptVO) => {
|
||||
return request.post({ url: '/system/dept/create', data })
|
||||
}
|
||||
|
||||
// 修改部门
|
||||
export const updateDept = (data: DeptVO) => {
|
||||
return request.post({ url: '/system/dept/update', data })
|
||||
}
|
||||
|
||||
// 删除部门
|
||||
export const deleteDept = async (id: number) => {
|
||||
return await request.post({ url: '/system/dept/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除部门
|
||||
export const deleteDeptList = async (ids: number[]) => {
|
||||
return await request.post({ url: '/system/dept/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface DictDataVO {
|
||||
id: number
|
||||
sort: number
|
||||
label: string
|
||||
value: string
|
||||
dictType: string
|
||||
status: number
|
||||
colorType: string
|
||||
cssClass: string
|
||||
remark: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询字典数据(精简)列表
|
||||
export const getSimpleDictDataList = () => {
|
||||
return request.get({ url: '/system/dict-data/simple-list' })
|
||||
}
|
||||
|
||||
// 查询字典数据列表
|
||||
/** 字典数据分页查询条件 */
|
||||
export interface DictDataPageReqVO extends PageParam {
|
||||
dictType?: string | string[]
|
||||
label?: string
|
||||
keyword?: string
|
||||
remark?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
export const getDictDataPage = (params: DictDataPageReqVO) => {
|
||||
return request.get({ url: '/system/dict-data/page', params })
|
||||
}
|
||||
|
||||
// 查询字典数据详情
|
||||
export const getDictData = (id: number) => {
|
||||
return request.get({ url: '/system/dict-data/get?id=' + id })
|
||||
}
|
||||
|
||||
// 根据字典类型查询字典数据
|
||||
export const getDictDataByType = (dictType: string) => {
|
||||
return request.get({ url: '/system/dict-data/type?type=' + dictType })
|
||||
}
|
||||
|
||||
// 新增字典数据
|
||||
export const createDictData = (data: DictDataVO) => {
|
||||
return request.post({ url: '/system/dict-data/create', data })
|
||||
}
|
||||
|
||||
// 修改字典数据
|
||||
export const updateDictData = (data: DictDataVO) => {
|
||||
return request.post({ url: '/system/dict-data/update', data })
|
||||
}
|
||||
|
||||
// 删除字典数据
|
||||
export const deleteDictData = (id: number) => {
|
||||
return request.post({ url: '/system/dict-data/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除字典数据
|
||||
export const deleteDictDataList = (ids: number[]) => {
|
||||
return request.post({ url: '/system/dict-data/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 导出字典数据
|
||||
export const exportDictData = (params: Record<string, unknown>) => {
|
||||
return request.download({ url: '/system/dict-data/export-excel', params })
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface DictTypeVO {
|
||||
id: number
|
||||
name: string
|
||||
type: string
|
||||
status: number
|
||||
remark: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询字典(精简)列表
|
||||
export const getSimpleDictTypeList = (): Promise<DictTypeVO[]> => {
|
||||
return request.get({ url: '/system/dict-type/simple-list' })
|
||||
}
|
||||
|
||||
// 查询字典列表
|
||||
export const getDictTypePage = (params: PageParam) => {
|
||||
return request.get({ url: '/system/dict-type/page', params })
|
||||
}
|
||||
|
||||
// 查询字典详情
|
||||
export const getDictType = (id: number) => {
|
||||
return request.get({ url: '/system/dict-type/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增字典
|
||||
export const createDictType = (data: DictTypeVO) => {
|
||||
return request.post({ url: '/system/dict-type/create', data })
|
||||
}
|
||||
|
||||
// 修改字典
|
||||
export const updateDictType = (data: DictTypeVO) => {
|
||||
return request.post({ url: '/system/dict-type/update', data })
|
||||
}
|
||||
|
||||
// 删除字典
|
||||
export const deleteDictType = (id: number) => {
|
||||
return request.post({ url: '/system/dict-type/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除字典类型
|
||||
export const deleteDictTypeList = (ids: number[]) => {
|
||||
return request.post({ url: '/system/dict-type/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 导出字典
|
||||
export const exportDictType = (params) => {
|
||||
return request.download({
|
||||
url: '/system/dict-type/export-excel',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/** 导出选中类型及其全部字典值,包括停用数据。 */
|
||||
export const exportDictPackage = (ids: number[]): Promise<Blob> => {
|
||||
return request.download({
|
||||
url: '/system/dict-type/export-package',
|
||||
params: { ids: ids.join(',') },
|
||||
timeout: DICT_TRANSFER_TIMEOUT
|
||||
})
|
||||
}
|
||||
|
||||
/** 批量文件操作单独延长等待时间,不改全局请求配置。 */
|
||||
const DICT_TRANSFER_TIMEOUT = 120000
|
||||
|
||||
export interface DictImportResult {
|
||||
createdTypes: number
|
||||
updatedTypes: number
|
||||
skippedTypes: number
|
||||
createdValues: number
|
||||
updatedValues: number
|
||||
skippedValues: number
|
||||
}
|
||||
|
||||
/** 使用业务编码匹配已有数据,不提交来源系统主键。 */
|
||||
export const importDictExcel = (file: File, updateSupport: boolean): Promise<DictImportResult> => {
|
||||
const data = new FormData()
|
||||
data.append('file', file)
|
||||
return request.post({
|
||||
url: '/system/dict-type/import-excel',
|
||||
params: { updateSupport },
|
||||
data,
|
||||
headersType: 'multipart/form-data',
|
||||
timeout: DICT_TRANSFER_TIMEOUT
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 钉钉消息类型:文本 / Markdown / 卡片(带按钮,无跳转地址时按 Markdown 发送) */
|
||||
export type DingtalkTemplateMsgType = 'TEXT' | 'MARKDOWN' | 'ACTION_CARD'
|
||||
|
||||
export const DINGTALK_MSG_TYPE_OPTIONS: { label: string; value: DingtalkTemplateMsgType }[] = [
|
||||
{ label: '文本', value: 'TEXT' },
|
||||
{ label: 'Markdown', value: 'MARKDOWN' },
|
||||
{ label: '卡片', value: 'ACTION_CARD' }
|
||||
]
|
||||
|
||||
export const dingtalkMsgTypeLabel = (type?: string) =>
|
||||
DINGTALK_MSG_TYPE_OPTIONS.find((item) => item.value === type)?.label || type || '-'
|
||||
|
||||
/** 钉钉消息模板,业务按编码引用 */
|
||||
export interface DingtalkTemplateVO {
|
||||
id?: number
|
||||
code: string
|
||||
name: string
|
||||
msgType: DingtalkTemplateMsgType
|
||||
title?: string
|
||||
content: string
|
||||
buttonTitle?: string
|
||||
/** 可用参数说明,每行一个,形如“{title} 日程标题” */
|
||||
paramDesc?: string
|
||||
status: number
|
||||
builtIn?: boolean
|
||||
remark?: string
|
||||
updateTime?: number | string
|
||||
}
|
||||
|
||||
export interface DingtalkTemplatePageReqVO extends PageParam {
|
||||
keyword?: string
|
||||
msgType?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
export interface DingtalkTemplatePreviewReqVO {
|
||||
msgType: string
|
||||
title?: string
|
||||
content: string
|
||||
buttonTitle?: string
|
||||
params?: Record<string, string>
|
||||
}
|
||||
|
||||
export interface DingtalkTemplatePreviewRespVO {
|
||||
msgType: string
|
||||
title?: string
|
||||
content: string
|
||||
buttonTitle?: string
|
||||
}
|
||||
|
||||
/** 参数说明中的一项 */
|
||||
export interface DingtalkTemplateParam {
|
||||
name: string
|
||||
desc: string
|
||||
}
|
||||
|
||||
/** 解析参数说明:每行“{参数名} 说明” */
|
||||
export const parseParamDesc = (paramDesc?: string): DingtalkTemplateParam[] =>
|
||||
(paramDesc || '')
|
||||
.split(/\r?\n/)
|
||||
.map((line) => line.trim().match(/^\{(\w+)\}\s*(.*)$/))
|
||||
.filter((match): match is RegExpMatchArray => !!match)
|
||||
.map((match) => ({ name: match[1], desc: match[2] }))
|
||||
|
||||
// 查询模板分页
|
||||
export const getDingtalkTemplatePage = (
|
||||
params: DingtalkTemplatePageReqVO
|
||||
): Promise<PageResult<DingtalkTemplateVO[]>> =>
|
||||
request.get({ url: '/system/dingtalk-template/page', params })
|
||||
|
||||
// 查询模板详情
|
||||
export const getDingtalkTemplate = (id: number): Promise<DingtalkTemplateVO> =>
|
||||
request.get({ url: '/system/dingtalk-template/get', params: { id } })
|
||||
|
||||
// 新增模板
|
||||
export const createDingtalkTemplate = (data: DingtalkTemplateVO): Promise<number> =>
|
||||
request.post({ url: '/system/dingtalk-template/create', data })
|
||||
|
||||
// 修改模板
|
||||
export const updateDingtalkTemplate = (data: DingtalkTemplateVO): Promise<boolean> =>
|
||||
request.post({ url: '/system/dingtalk-template/update', data })
|
||||
|
||||
// 删除模板(内置模板不能删除)
|
||||
export const deleteDingtalkTemplate = (id: number): Promise<boolean> =>
|
||||
request.post({ url: '/system/dingtalk-template/delete?id=' + id })
|
||||
|
||||
// 按编辑中的内容预览
|
||||
export const previewDingtalkTemplate = (
|
||||
data: DingtalkTemplatePreviewReqVO
|
||||
): Promise<DingtalkTemplatePreviewRespVO> =>
|
||||
request.post({ url: '/system/dingtalk-template/preview', data })
|
||||
|
||||
// 按已保存的模板发给当前登录人测试
|
||||
export const sendTestDingtalkTemplate = (data: {
|
||||
id: number
|
||||
params?: Record<string, string>
|
||||
}): Promise<number> => request.post({ url: '/system/dingtalk-template/send-test', data })
|
||||
@@ -0,0 +1,102 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/** 人事同步批次 */
|
||||
export interface EhrSyncBatchVO {
|
||||
id: number
|
||||
/** 触发方式:1 手动,2 定时 */
|
||||
triggerType: number
|
||||
/** 批次状态:0 执行中,1 成功,2 部分成功,3 失败 */
|
||||
status: number
|
||||
personCount: number
|
||||
createdCount: number
|
||||
boundCount: number
|
||||
skippedCount: number
|
||||
failedCount: number
|
||||
balanceUserCount: number
|
||||
balanceFailedCount: number
|
||||
operatorUserId?: number
|
||||
operatorUserName?: string
|
||||
startTime?: number
|
||||
endTime?: number
|
||||
errorMessage?: string
|
||||
}
|
||||
|
||||
/** 人事同步条目:只记新增、关联、跳过和失败 */
|
||||
export interface EhrSyncItemVO {
|
||||
id: number
|
||||
batchId: number
|
||||
/** 对象类型:1 人员,2 假期余额 */
|
||||
objectType: number
|
||||
/** 处理结果:1 新增账号,2 关联已有账号,3 跳过,4 失败 */
|
||||
actionType: number
|
||||
ehrPersonId?: string
|
||||
ehrName?: string
|
||||
ehrNumber?: string
|
||||
ehrPhone?: string
|
||||
ehrDeptPath?: string
|
||||
userId?: number
|
||||
username?: string
|
||||
message?: string
|
||||
createTime?: number
|
||||
}
|
||||
|
||||
/** 员工假期余额 */
|
||||
export interface EhrLeaveBalanceVO {
|
||||
id: number
|
||||
userId: number
|
||||
nickname?: string
|
||||
username?: string
|
||||
mobile?: string
|
||||
deptName?: string
|
||||
leaveName: string
|
||||
balance?: number
|
||||
syncTime?: number
|
||||
}
|
||||
|
||||
export interface EhrSyncBatchPageReqVO extends PageParam {
|
||||
status?: number
|
||||
triggerType?: number
|
||||
}
|
||||
|
||||
export interface EhrSyncItemPageReqVO extends PageParam {
|
||||
batchId: number
|
||||
objectType?: number
|
||||
actionType?: number
|
||||
keyword?: string
|
||||
}
|
||||
|
||||
export interface EhrLeaveBalancePageReqVO extends PageParam {
|
||||
keyword?: string
|
||||
leaveName?: string
|
||||
}
|
||||
|
||||
// 手动执行一次人事同步,后台执行,返回批次编号
|
||||
export const executeEhrSync = (): Promise<number> => {
|
||||
return request.post({ url: '/system/ehr-sync/execute' })
|
||||
}
|
||||
|
||||
// 查询人事同步批次,用于轮询进度
|
||||
export const getEhrSyncBatch = (id: number): Promise<EhrSyncBatchVO> => {
|
||||
return request.get({ url: '/system/ehr-sync/batch/get', params: { id } })
|
||||
}
|
||||
|
||||
// 分页查询人事同步批次
|
||||
export const getEhrSyncBatchPage = (
|
||||
params: EhrSyncBatchPageReqVO
|
||||
): Promise<PageResult<EhrSyncBatchVO[]>> => {
|
||||
return request.get({ url: '/system/ehr-sync/batch/page', params })
|
||||
}
|
||||
|
||||
// 分页查询人事同步条目
|
||||
export const getEhrSyncItemPage = (
|
||||
params: EhrSyncItemPageReqVO
|
||||
): Promise<PageResult<EhrSyncItemVO[]>> => {
|
||||
return request.get({ url: '/system/ehr-sync/item/page', params })
|
||||
}
|
||||
|
||||
// 分页查询员工假期余额
|
||||
export const getEhrLeaveBalancePage = (
|
||||
params: EhrLeaveBalancePageReqVO
|
||||
): Promise<PageResult<EhrLeaveBalanceVO[]>> => {
|
||||
return request.get({ url: '/system/ehr-sync/leave-balance/page', params })
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
/**
|
||||
* 节假日日期统一转为 yyyy-MM-dd:后端返回 "yyyy-MM-dd" 字符串,
|
||||
* 兼容 LocalDate 序列化为 [年, 月, 日] 数组的情况;无法识别时原样转字符串。
|
||||
*/
|
||||
export const formatHolidayDate = (value: unknown): string => {
|
||||
if (value === undefined || value === null) return ''
|
||||
if (Array.isArray(value)) {
|
||||
const [year, month, day] = value.map(Number)
|
||||
if (!year || !month || !day) return ''
|
||||
return `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
|
||||
}
|
||||
return String(value)
|
||||
}
|
||||
|
||||
/** 节假日,用于请假天数等工作日计算 */
|
||||
export interface HolidayVO {
|
||||
id?: number
|
||||
/** 节假日日期 yyyy-MM-dd */
|
||||
holidayDate: string
|
||||
/** 日期类型 */
|
||||
dayType?: number
|
||||
name: string
|
||||
remark?: string
|
||||
createTime?: number | string
|
||||
}
|
||||
|
||||
/** 日期类型:放假不计工作日,调休上班计工作日 */
|
||||
export const HOLIDAY_DAY_TYPE = { HOLIDAY: 1, MAKEUP_WORKDAY: 2 } as const
|
||||
|
||||
export const HOLIDAY_DAY_TYPE_OPTIONS = [
|
||||
{ label: '放假', value: HOLIDAY_DAY_TYPE.HOLIDAY },
|
||||
{ label: '调休上班', value: HOLIDAY_DAY_TYPE.MAKEUP_WORKDAY }
|
||||
]
|
||||
|
||||
export interface HolidayPageReqVO extends PageParam {
|
||||
year?: number
|
||||
name?: string
|
||||
}
|
||||
|
||||
/** 按日期区间批量新增:区间内逐日生成,已存在的日期跳过 */
|
||||
export interface HolidayBatchCreateReqVO {
|
||||
/** 开始日期 yyyy-MM-dd */
|
||||
startDate: string
|
||||
/** 结束日期 yyyy-MM-dd */
|
||||
endDate: string
|
||||
dayType?: number
|
||||
name: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 查询节假日分页
|
||||
export const getHolidayPage = (params: HolidayPageReqVO): Promise<PageResult<HolidayVO[]>> =>
|
||||
request.get({ url: '/system/holiday/page', params })
|
||||
|
||||
// 查询节假日详情
|
||||
export const getHoliday = (id: number): Promise<HolidayVO> =>
|
||||
request.get({ url: '/system/holiday/get', params: { id } })
|
||||
|
||||
// 新增节假日
|
||||
export const createHoliday = (data: HolidayVO): Promise<number> =>
|
||||
request.post({ url: '/system/holiday/create', data })
|
||||
|
||||
// 修改节假日(与平台其他管理接口一致使用 POST)
|
||||
export const updateHoliday = (data: HolidayVO): Promise<boolean> =>
|
||||
request.post({ url: '/system/holiday/update', data })
|
||||
|
||||
// 删除节假日
|
||||
export const deleteHoliday = (id: number): Promise<boolean> =>
|
||||
request.post({ url: '/system/holiday/delete?id=' + id })
|
||||
|
||||
// 按日期区间批量新增节假日,返回值由后端定义(通常为新增条数)
|
||||
export const batchCreateHoliday = (data: HolidayBatchCreateReqVO): Promise<unknown> =>
|
||||
request.post({ url: '/system/holiday/batch-create', data })
|
||||
|
||||
// 查询某年的节假日列表
|
||||
export const getHolidayListByYear = (year: number): Promise<HolidayVO[]> =>
|
||||
request.get({ url: '/system/holiday/list-by-year', params: { year } })
|
||||
@@ -0,0 +1,32 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface LoginLogVO {
|
||||
id: number
|
||||
logType: number
|
||||
clientType?: number
|
||||
traceId: number
|
||||
userId: number
|
||||
userType: number
|
||||
username: string
|
||||
nickname?: string
|
||||
userName?: string
|
||||
result: number
|
||||
status: number
|
||||
userIp: string
|
||||
loginLocation?: string
|
||||
location?: string
|
||||
reason?: string
|
||||
failureReason?: string
|
||||
userAgent: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询登录日志列表
|
||||
export const getLoginLogPage = (params: PageParam) => {
|
||||
return request.get({ url: '/system/login-log/page', params })
|
||||
}
|
||||
|
||||
// 导出登录日志
|
||||
export const exportLoginLog = (params) => {
|
||||
return request.download({ url: '/system/login-log/export-excel', params })
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MailAccountVO {
|
||||
id: number
|
||||
mail: string
|
||||
username: string
|
||||
password: string
|
||||
host: string
|
||||
port: number
|
||||
sslEnable: boolean
|
||||
starttlsEnable: boolean
|
||||
}
|
||||
|
||||
// 查询邮箱账号列表
|
||||
export const getMailAccountPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/system/mail-account/page', params })
|
||||
}
|
||||
|
||||
// 查询邮箱账号详情
|
||||
export const getMailAccount = async (id: number) => {
|
||||
return await request.get({ url: '/system/mail-account/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增邮箱账号
|
||||
export const createMailAccount = async (data: MailAccountVO) => {
|
||||
return await request.post({ url: '/system/mail-account/create', data })
|
||||
}
|
||||
|
||||
// 修改邮箱账号
|
||||
export const updateMailAccount = async (data: MailAccountVO) => {
|
||||
return await request.post({ url: '/system/mail-account/update', data })
|
||||
}
|
||||
|
||||
// 删除邮箱账号
|
||||
export const deleteMailAccount = async (id: number) => {
|
||||
return await request.post({ url: '/system/mail-account/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除邮箱账号
|
||||
export const deleteMailAccountList = async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: '/system/mail-account/delete-list',
|
||||
params: { ids: ids.join(',') }
|
||||
})
|
||||
}
|
||||
|
||||
// 获得邮箱账号精简列表
|
||||
export const getSimpleMailAccountList = async () => {
|
||||
return request.get({ url: '/system/mail-account/simple-list' })
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MailLogVO {
|
||||
id: number
|
||||
userId: number
|
||||
userType: number
|
||||
toMails: string[]
|
||||
ccMails?: string[]
|
||||
bccMails?: string[]
|
||||
accountId: number
|
||||
fromMail: string
|
||||
templateId: number
|
||||
templateCode: string
|
||||
templateNickname: string
|
||||
templateTitle: string
|
||||
templateContent: string
|
||||
templateParams: string
|
||||
sendStatus: number
|
||||
sendTime: Date
|
||||
sendMessageId: string
|
||||
sendException: string
|
||||
}
|
||||
|
||||
// 查询邮件日志列表
|
||||
export const getMailLogPage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/system/mail-log/page', params })
|
||||
}
|
||||
|
||||
// 查询邮件日志详情
|
||||
export const getMailLog = async (id: number) => {
|
||||
return await request.get({ url: '/system/mail-log/get?id=' + id })
|
||||
}
|
||||
|
||||
// 导出邮件日志
|
||||
export const exportMailLog = (params) => {
|
||||
return request.download({ url: '/system/mail-log/export-excel', params })
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface MailTemplateVO {
|
||||
id?: number
|
||||
name: string
|
||||
code: string
|
||||
accountId: number
|
||||
nickname: string
|
||||
title: string
|
||||
content: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export interface MailSendReqVO {
|
||||
toMails: string[]
|
||||
ccMails?: string[]
|
||||
bccMails?: string[]
|
||||
templateCode: string
|
||||
templateParams: Map<String, Object>
|
||||
}
|
||||
|
||||
// 查询邮件模版列表
|
||||
export const getMailTemplatePage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/system/mail-template/page', params })
|
||||
}
|
||||
|
||||
// 查询邮件模版详情
|
||||
export const getMailTemplate = async (id: number) => {
|
||||
return await request.get({ url: '/system/mail-template/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增邮件模版
|
||||
export const createMailTemplate = async (data: MailTemplateVO) => {
|
||||
return await request.post({ url: '/system/mail-template/create', data })
|
||||
}
|
||||
|
||||
// 修改邮件模版
|
||||
export const updateMailTemplate = async (data: MailTemplateVO) => {
|
||||
return await request.post({ url: '/system/mail-template/update', data })
|
||||
}
|
||||
|
||||
// 删除邮件模版
|
||||
export const deleteMailTemplate = async (id: number) => {
|
||||
return await request.post({ url: '/system/mail-template/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除邮件模版
|
||||
export const deleteMailTemplateList = async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: '/system/mail-template/delete-list',
|
||||
params: { ids: ids.join(',') }
|
||||
})
|
||||
}
|
||||
|
||||
// 发送邮件
|
||||
export const sendMail = (data: MailSendReqVO) => {
|
||||
return request.post({ url: '/system/mail-template/send-mail', data })
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import request from '@/config/axios'
|
||||
import type { MenuPermission } from '@/utils/menuPermission'
|
||||
|
||||
export interface MenuVO {
|
||||
id: number
|
||||
applicationId?: number
|
||||
menuCode: string
|
||||
name: string
|
||||
permission: string
|
||||
type: number
|
||||
sort: number
|
||||
parentId: number
|
||||
path: string
|
||||
icon: string
|
||||
component: string
|
||||
componentName?: string
|
||||
status: number
|
||||
visible: boolean
|
||||
keepAlive: boolean
|
||||
alwaysShow?: boolean
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询菜单(精简)列表
|
||||
export const getSimpleMenusList = (params?: { applicationId?: number; menuCode?: MenuPermission }) => {
|
||||
return request.get({ url: '/system/menu/simple-list', params })
|
||||
}
|
||||
|
||||
// 查询菜单列表
|
||||
export const getMenuList = (params: Record<string, unknown>) => {
|
||||
return request.get({ url: '/system/menu/list', params })
|
||||
}
|
||||
|
||||
// 获取菜单详情
|
||||
export const getMenu = (id: number) => {
|
||||
return request.get({ url: '/system/menu/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增菜单
|
||||
export const createMenu = (data: MenuVO) => {
|
||||
return request.post({ url: '/system/menu/create', data })
|
||||
}
|
||||
|
||||
// 修改菜单
|
||||
export const updateMenu = (data: MenuVO) => {
|
||||
return request.post({ url: '/system/menu/update', data })
|
||||
}
|
||||
|
||||
// 删除菜单
|
||||
export const deleteMenu = (id: number) => {
|
||||
return request.post({ url: '/system/menu/delete?id=' + id })
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
import request from '@/config/axios'
|
||||
import type { UnifiedFileRespVO } from '@/api/infra/file'
|
||||
import type { DeptVO } from '@/api/system/dept'
|
||||
import type { PostVO } from '@/api/system/post'
|
||||
import type { UserVO } from '@/api/system/user'
|
||||
import type { UserGroupVO } from '@/api/system/userGroup'
|
||||
|
||||
/** 信息发布菜单授权的表单及选人选项;发布人组织回显不代表可选范围。 */
|
||||
export interface NoticePublishOptions {
|
||||
all: boolean
|
||||
/** 全部数据或集团有效任职对应角色具有本级及以下权限。 */
|
||||
canPublishGroup: boolean
|
||||
depts: DeptVO[]
|
||||
users: UserVO[]
|
||||
posts: PostVO[]
|
||||
groups: UserGroupVO[]
|
||||
publishDeptId: number
|
||||
publishDeptName: string
|
||||
publishOrgId?: number
|
||||
publishOrgName: string
|
||||
}
|
||||
|
||||
/** 固定按信息发布菜单权限计算,避免借用其他菜单范围。 */
|
||||
export const getNoticePublishOptions = (): Promise<NoticePublishOptions> =>
|
||||
request.get({ url: '/system/notice/publish-options' })
|
||||
|
||||
/** PDF 转图结果,按页序返回公开稳定图片地址。 */
|
||||
export interface NoticePdfImage {
|
||||
fileId: number
|
||||
name: string
|
||||
url: string
|
||||
}
|
||||
|
||||
/** 将本人上传的 PDF 逐页转换为正文图片。 */
|
||||
export const convertNoticePdf = (fileId: number): Promise<NoticePdfImage[]> => {
|
||||
return request.post({ url: '/system/notice/convert-pdf', params: { fileId }, timeout: 180000 })
|
||||
}
|
||||
|
||||
export type PublishScope = 'GROUP' | 'CURRENT' | 'SELECTED_COMPANIES' | 'SPECIFIED_USERS'
|
||||
export type ContentFormat = 'ONLINE' | 'PDF'
|
||||
export type PublishChannel = 'INTERNAL' | 'WEBSITE' | 'WECHAT'
|
||||
|
||||
export enum PublishStatus {
|
||||
DRAFT = 0,
|
||||
PUBLISHED = 1,
|
||||
REVOKED = 2
|
||||
}
|
||||
|
||||
export interface NoticeVO {
|
||||
id?: number
|
||||
title: string
|
||||
type: number
|
||||
category?: number
|
||||
templateCode?: string
|
||||
publishScope: PublishScope
|
||||
scopeDeptIds: number[]
|
||||
scopeUserIds: number[]
|
||||
publisherName: string
|
||||
/** 原发布部门,仅用于编辑时解析所属单位,不提交修改发布身份。 */
|
||||
publishDeptId?: number
|
||||
publishDeptName: string
|
||||
publishOrgName: string
|
||||
contentFormat: ContentFormat
|
||||
content: string
|
||||
// PDF 文件编号(保存时提交,须为本人上传或公告原有文件)
|
||||
pdfFileId?: number
|
||||
// PDF 文件名(详情返回)
|
||||
pdfName?: string
|
||||
// PDF 访问地址(仅详情返回的短时签名地址,历史公告可能为旧地址),禁止回传保存
|
||||
pdfUrl?: string
|
||||
/** 附件只保存文件编号,访问地址仅详情返回。 */
|
||||
attachmentFileIds?: number[]
|
||||
attachments?: UnifiedFileRespVO[]
|
||||
coverUrl?: string
|
||||
viewCount?: number
|
||||
isCarousel?: boolean
|
||||
channels: PublishChannel[]
|
||||
status: number
|
||||
publishStatus: number
|
||||
publishTime?: string | Date
|
||||
/** 公众号草稿同步状态:1 同步中、2 已同步、3 同步失败;未勾选公众号或未发布时为空。 */
|
||||
wechatSyncStatus?: WechatSyncStatus
|
||||
/** 公众号草稿同步结果说明,失败时为原因。 */
|
||||
wechatSyncMessage?: string
|
||||
wechatSyncTime?: string | Date
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 公众号草稿同步状态。 */
|
||||
export enum WechatSyncStatus {
|
||||
SYNCING = 1,
|
||||
SUCCESS = 2,
|
||||
FAILED = 3
|
||||
}
|
||||
|
||||
// 查询公告列表
|
||||
export const getNoticePage = (
|
||||
params: PageParam & { title?: string; category?: number; channel?: string }
|
||||
) => {
|
||||
return request.get({ url: '/system/notice/page', params })
|
||||
}
|
||||
|
||||
// 查询公告详情
|
||||
export const getNotice = (id: number) => {
|
||||
return request.get({ url: '/system/notice/get?id=' + id })
|
||||
}
|
||||
|
||||
/** 附件访问前重新校验引用关系并刷新签名地址。 */
|
||||
export const getNoticeAttachment = (id: number, fileId: number): Promise<UnifiedFileRespVO> => {
|
||||
return request.get({ url: '/system/notice/attachment', params: { id, fileId } })
|
||||
}
|
||||
|
||||
// 新增公告
|
||||
export const createNotice = (data: NoticeVO) => {
|
||||
return request.post({ url: '/system/notice/create', data })
|
||||
}
|
||||
|
||||
// 修改公告
|
||||
export const updateNotice = (data: NoticeVO) => {
|
||||
return request.post({ url: '/system/notice/update', data })
|
||||
}
|
||||
|
||||
// 删除公告
|
||||
export const deleteNotice = (id: number) => {
|
||||
return request.post({ url: '/system/notice/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除公告
|
||||
export const deleteNoticeList = (ids: number[]) => {
|
||||
return request.post({ url: '/system/notice/delete-list', params: { ids: ids.join(',') } })
|
||||
}
|
||||
|
||||
// 推送公告
|
||||
export const pushNotice = (id: number) => {
|
||||
return request.post({ url: '/system/notice/push?id=' + id })
|
||||
}
|
||||
|
||||
export const updateNoticePublishStatus = (id: number, publishStatus: PublishStatus) => {
|
||||
return request.post({
|
||||
url: '/system/notice/update-publish-status',
|
||||
params: { id, publishStatus }
|
||||
})
|
||||
}
|
||||
|
||||
/** 将已发布且勾选公众号的信息同步到公众号草稿箱(失败重试或内容变更后重推)。 */
|
||||
export const syncNoticeWechat = (id: number) => {
|
||||
return request.post({ url: '/system/notice/sync-wechat', params: { id }, timeout: 180000 })
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import request from '@/config/axios'
|
||||
import qs from 'qs'
|
||||
|
||||
export interface NotifyMessageVO {
|
||||
id: number
|
||||
userId: number
|
||||
userType: number
|
||||
templateId: number
|
||||
templateCode: string
|
||||
templateNickname: string
|
||||
templateContent: string
|
||||
templateType: number
|
||||
templateParams: string
|
||||
readStatus: boolean
|
||||
readTime: Date
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询站内信消息列表
|
||||
export const getNotifyMessagePage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/system/notify-message/page', params })
|
||||
}
|
||||
|
||||
// 获得我的站内信分页
|
||||
export const getMyNotifyMessagePage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/system/notify-message/my-page', params })
|
||||
}
|
||||
|
||||
// 批量标记已读
|
||||
export const updateNotifyMessageRead = async (ids) => {
|
||||
return await request.post({
|
||||
url: '/system/notify-message/update-read?' + qs.stringify({ ids: ids }, { indices: false })
|
||||
})
|
||||
}
|
||||
|
||||
// 标记所有站内信为已读
|
||||
export const updateAllNotifyMessageRead = async () => {
|
||||
return await request.post({ url: '/system/notify-message/update-all-read' })
|
||||
}
|
||||
|
||||
// 获取当前用户的最新站内信列表
|
||||
export const getUnreadNotifyMessageList = async () => {
|
||||
return await request.get({ url: '/system/notify-message/get-unread-list' })
|
||||
}
|
||||
|
||||
// 获得当前用户的未读站内信数量
|
||||
export const getUnreadNotifyMessageCount = async () => {
|
||||
return await request.get({ url: '/system/notify-message/get-unread-count' })
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface NotifyTemplateVO {
|
||||
id?: number
|
||||
name: string
|
||||
nickname: string
|
||||
code: string
|
||||
content: string
|
||||
type?: number
|
||||
params: string
|
||||
status: number
|
||||
remark: string
|
||||
}
|
||||
|
||||
export interface NotifySendReqVO {
|
||||
userId: number | null
|
||||
templateCode: string
|
||||
templateParams: Map<String, Object>
|
||||
}
|
||||
|
||||
// 查询站内信模板列表
|
||||
export const getNotifyTemplatePage = async (params: PageParam) => {
|
||||
return await request.get({ url: '/system/notify-template/page', params })
|
||||
}
|
||||
|
||||
// 查询站内信模板详情
|
||||
export const getNotifyTemplate = async (id: number) => {
|
||||
return await request.get({ url: '/system/notify-template/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增站内信模板
|
||||
export const createNotifyTemplate = async (data: NotifyTemplateVO) => {
|
||||
return await request.post({ url: '/system/notify-template/create', data })
|
||||
}
|
||||
|
||||
// 修改站内信模板
|
||||
export const updateNotifyTemplate = async (data: NotifyTemplateVO) => {
|
||||
return await request.post({ url: '/system/notify-template/update', data })
|
||||
}
|
||||
|
||||
// 删除站内信模板
|
||||
export const deleteNotifyTemplate = async (id: number) => {
|
||||
return await request.post({ url: '/system/notify-template/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除站内信模板
|
||||
export const deleteNotifyTemplateList = async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: '/system/notify-template/delete-list',
|
||||
params: { ids: ids.join(',') }
|
||||
})
|
||||
}
|
||||
|
||||
// 发送站内信
|
||||
export const sendNotify = (data: NotifySendReqVO) => {
|
||||
return request.post({ url: '/system/notify-template/send-notify', data })
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import request from '@/config/axios'
|
||||
import { MenuPermission } from '@/utils/menuPermission'
|
||||
|
||||
export interface OAuth2ClientVO {
|
||||
id: number
|
||||
code?: string
|
||||
applicationCode?: string
|
||||
appCode?: string
|
||||
clientId: string
|
||||
secret: string
|
||||
name: string
|
||||
applicationName?: string
|
||||
appName?: string
|
||||
logo: string
|
||||
description: string
|
||||
status: number
|
||||
defaultApplication?: boolean
|
||||
applicationType?: number
|
||||
protocol?: string
|
||||
mobile?: boolean | number
|
||||
supportMobile?: boolean | number
|
||||
trustLevel?: string | number
|
||||
ssoStatus?: number
|
||||
sort?: number
|
||||
pcUrl?: string
|
||||
workbenchUrl?: string
|
||||
logoutUrl?: string
|
||||
issuer?: string
|
||||
accessTokenValiditySeconds: number
|
||||
refreshTokenValiditySeconds: number
|
||||
redirectUris: string[]
|
||||
autoApprove: boolean
|
||||
authorizedGrantTypes: string[]
|
||||
scopes: string[]
|
||||
autoApproveScopes?: string[]
|
||||
authorities: string[]
|
||||
resourceIds: string[]
|
||||
additionalInformation: string
|
||||
isAdditionalInformationJson: boolean
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询 OAuth2 客户端的列表
|
||||
export const getOAuth2ClientPage = (params: PageParam) => {
|
||||
return request.get({ url: '/system/oauth2-client/page', params })
|
||||
}
|
||||
|
||||
// 查询 OAuth2 客户端的精简列表
|
||||
export const getSimpleOAuth2ClientList = (menuCode?: MenuPermission): Promise<OAuth2ClientVO[]> => {
|
||||
return request.get({ url: '/system/application/simple-list', params: { menuCode } })
|
||||
}
|
||||
|
||||
// 查询 OAuth2 客户端的详情
|
||||
export const getOAuth2Client = (id: number) => {
|
||||
return request.get({ url: '/system/oauth2-client/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增 OAuth2 客户端
|
||||
export const createOAuth2Client = (data: OAuth2ClientVO) => {
|
||||
return request.post({ url: '/system/oauth2-client/create', data })
|
||||
}
|
||||
|
||||
// 修改 OAuth2 客户端
|
||||
export const updateOAuth2Client = (data: OAuth2ClientVO) => {
|
||||
return request.post({ url: '/system/oauth2-client/update', data })
|
||||
}
|
||||
|
||||
// 删除 OAuth2
|
||||
export const deleteOAuth2Client = (id: number) => {
|
||||
return request.post({ url: '/system/oauth2-client/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 批量删除 OAuth2 客户端
|
||||
export const deleteOAuth2ClientList = (ids: number[]) => {
|
||||
return request.post({
|
||||
url: '/system/oauth2-client/delete-list',
|
||||
params: { ids: ids.join(',') }
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface OAuth2TokenVO {
|
||||
id: number
|
||||
accessToken: string
|
||||
refreshToken: string
|
||||
userId: number
|
||||
userType: number
|
||||
clientId: string
|
||||
/** 客户端对应的应用名称;历史客户端无法匹配应用时为空。 */
|
||||
applicationName?: string
|
||||
/** 在线菜单授权范围内的用户展示信息,由后端批量填写。 */
|
||||
username?: string
|
||||
nickname?: string
|
||||
deptPath?: string
|
||||
/** 登录渠道:0 PC端、1 移动端;历史令牌可能为空。 */
|
||||
clientType?: number | null
|
||||
createTime: Date
|
||||
expiresTime: Date
|
||||
}
|
||||
|
||||
export interface OAuth2TokenPageReqVO extends PageParam {
|
||||
userId?: number
|
||||
userType?: number
|
||||
clientId?: string
|
||||
}
|
||||
|
||||
// 查询 token列表
|
||||
export const getAccessTokenPage = (
|
||||
params: OAuth2TokenPageReqVO
|
||||
): Promise<PageResult<OAuth2TokenVO[]>> => {
|
||||
return request.get({ url: '/system/oauth2-token/page', params })
|
||||
}
|
||||
|
||||
// 删除 token
|
||||
export const deleteAccessToken = (accessToken: string) => {
|
||||
return request.post({ url: '/system/oauth2-token/delete', params: { accessToken } })
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type OperateLogVO = {
|
||||
id: number
|
||||
traceId: string
|
||||
userType: number
|
||||
userId: number
|
||||
userName: string
|
||||
userAccount?: string
|
||||
type: string
|
||||
subType: string
|
||||
bizId: number
|
||||
/** 业务对象名称快照。 */
|
||||
bizName?: string
|
||||
action: string
|
||||
extra: string
|
||||
requestMethod: string
|
||||
requestUrl: string
|
||||
userIp: string
|
||||
userAgent: string
|
||||
creator: string
|
||||
creatorName: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
// 查询操作日志列表
|
||||
export const getOperateLogPage = (params: PageParam) => {
|
||||
return request.get({ url: '/system/operate-log/page', params })
|
||||
}
|
||||
// 导出操作日志
|
||||
export const exportOperateLog = (params: Record<string, unknown>) => {
|
||||
return request.download({ url: '/system/operate-log/export-excel', params })
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
import request from '@/config/axios'
|
||||
import { MenuPermission } from '@/utils/menuPermission'
|
||||
import type { PostVO } from '@/api/system/post'
|
||||
|
||||
/** 组织管理人员、候选人员精简信息 */
|
||||
export interface OrganizationUser {
|
||||
id: number
|
||||
nickname: string
|
||||
mobile?: string
|
||||
disabled?: boolean // 已停用或离职
|
||||
}
|
||||
|
||||
/** 组织信息 */
|
||||
export interface Organization {
|
||||
id: number // 组织id
|
||||
name?: string // 组织名称
|
||||
shortName?: string // 组织简称(兼容页面展示)
|
||||
orgCode?: string // 组织编号(现有部门数据暂无此字段)
|
||||
orgType?: string // 组织类型
|
||||
parentId: number // 父组织id
|
||||
parentName?: string // 父组织名称
|
||||
sort?: number // 显示顺序
|
||||
managerUserIds?: number[] // 部门经理
|
||||
deputyManagerUserIds?: number[] // 部门副经理
|
||||
postIds?: number[] // 选中的岗位;编辑时不传则保留原有关联
|
||||
posts?: PostVO[] // 详情回显当前用户可管理的已有岗位
|
||||
supervisorUserId?: number // 分管领导
|
||||
managerUsers?: OrganizationUser[]
|
||||
deputyManagerUsers?: OrganizationUser[]
|
||||
supervisorUser?: OrganizationUser
|
||||
phone?: string // 联系电话
|
||||
email?: string // 邮箱
|
||||
taxNum?: string // 税号(兼容历史页面字段)
|
||||
contactName?: string // 联系人
|
||||
contactMobile?: string // 联系手机
|
||||
status?: number // 状态
|
||||
remark?: string // 备注
|
||||
dataSource?: number // 数据来源:1 人事、2 自建
|
||||
employeeCount?: number // 在职人员数量
|
||||
createTime?: Date
|
||||
children?: Organization[]
|
||||
}
|
||||
|
||||
interface DeptRecord {
|
||||
id: number
|
||||
name: string
|
||||
orgCode?: string
|
||||
shortName?: string
|
||||
orgType?: string
|
||||
parentId?: number
|
||||
sort?: number
|
||||
managerUserIds?: number[]
|
||||
deputyManagerUserIds?: number[]
|
||||
posts?: PostVO[]
|
||||
supervisorUserId?: number
|
||||
managerUsers?: OrganizationUser[]
|
||||
deputyManagerUsers?: OrganizationUser[]
|
||||
supervisorUser?: OrganizationUser
|
||||
phone?: string
|
||||
email?: string
|
||||
status?: number
|
||||
remark?: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
interface DeptSavePayload {
|
||||
id?: number
|
||||
name: string
|
||||
orgCode: string
|
||||
shortName?: string
|
||||
orgType?: string
|
||||
parentId: number
|
||||
sort: number
|
||||
managerUserIds: number[]
|
||||
deputyManagerUserIds: number[]
|
||||
postIds?: number[] // 不传时兼容原有新增、编辑请求
|
||||
phone?: string
|
||||
email?: string
|
||||
status: number
|
||||
remark?: string
|
||||
}
|
||||
|
||||
const toOrganization = (dept: DeptRecord): Organization => ({
|
||||
...dept,
|
||||
parentId: dept.parentId ?? 0,
|
||||
shortName: dept.shortName,
|
||||
orgType: dept.orgType || (dept.parentId ? 'department' : 'group'),
|
||||
contactMobile: dept.phone
|
||||
})
|
||||
|
||||
const toDeptSavePayload = (organization: Organization): DeptSavePayload => ({
|
||||
id: organization.id,
|
||||
name: organization.name || '',
|
||||
orgCode: organization.orgCode || '',
|
||||
shortName: organization.shortName,
|
||||
orgType: organization.orgType,
|
||||
parentId: organization.parentId ?? 0,
|
||||
sort: organization.sort ?? 0,
|
||||
managerUserIds: organization.managerUserIds || [],
|
||||
deputyManagerUserIds: organization.deputyManagerUserIds || [],
|
||||
postIds: organization.postIds,
|
||||
phone: organization.phone || organization.contactMobile,
|
||||
email: organization.email,
|
||||
status: organization.status ?? 0,
|
||||
remark: organization.remark
|
||||
})
|
||||
|
||||
export interface OrganizationPageReqVO extends PageParam {
|
||||
name?: string
|
||||
orgCode?: string
|
||||
parentId?: number
|
||||
taxNum?: string
|
||||
contactName?: string
|
||||
contactMobile?: string
|
||||
status?: number
|
||||
createTime?: string[]
|
||||
}
|
||||
|
||||
/** 合并拆分影响预览中的人员。 */
|
||||
export interface OrganizationChangeMember {
|
||||
id: number
|
||||
name: string
|
||||
username?: string
|
||||
deptId: number
|
||||
}
|
||||
|
||||
/** 影响范围内的启用岗位。 */
|
||||
export interface OrganizationChangePosition {
|
||||
id: number
|
||||
name: string
|
||||
code: string
|
||||
}
|
||||
|
||||
/** 合并拆分前的组织关联数据。 */
|
||||
export interface OrganizationChangeImpact {
|
||||
members: OrganizationChangeMember[]
|
||||
directMembers: OrganizationChangeMember[]
|
||||
childCount: number
|
||||
positions: OrganizationChangePosition[]
|
||||
roleCount: number
|
||||
}
|
||||
|
||||
/** 合并组织时可选的岗位和角色范围迁移。 */
|
||||
export interface OrganizationMergeRequest {
|
||||
sourceId: number
|
||||
targetId: number
|
||||
migrateMembers: boolean
|
||||
migrateSubOrgs: boolean
|
||||
migratePositions: boolean
|
||||
migrateRoles: boolean
|
||||
}
|
||||
|
||||
/** 拆分组织时新组织与源组织同级。 */
|
||||
export interface OrganizationSplitRequest {
|
||||
sourceId: number
|
||||
name: string
|
||||
orgCode: string
|
||||
orgType: string
|
||||
childIds: number[]
|
||||
userIds: number[]
|
||||
migrateUserPositions: boolean
|
||||
copyRoles: boolean
|
||||
}
|
||||
|
||||
// 组织 API
|
||||
export const OrganizationApi = {
|
||||
/** 顶部组织切换使用通用启用组织列表,不依赖组织架构菜单权限。 */
|
||||
getSwitcherOrganizations: async (): Promise<Organization[]> => {
|
||||
const list = await request.get<DeptRecord[]>({ url: '/system/dept/simple-list' })
|
||||
return (list || []).map(toOrganization)
|
||||
},
|
||||
/** 查询合并拆分影响。 */
|
||||
getChangeImpact: (id: number): Promise<OrganizationChangeImpact> =>
|
||||
request.get({ url: '/system/dept/change-impact', params: { id } }),
|
||||
|
||||
/** 按当前拆分选择刷新影响范围。 */
|
||||
getSplitImpact: (id: number, childIds: number[], userIds: number[]): Promise<OrganizationChangeImpact> =>
|
||||
request.get({ url: '/system/dept/split-impact', params: {
|
||||
id,
|
||||
...(childIds.length ? { childIds: childIds.join(',') } : {}),
|
||||
...(userIds.length ? { userIds: userIds.join(',') } : {})
|
||||
} }),
|
||||
|
||||
/** 合并组织及直属关联。 */
|
||||
mergeOrganization: (data: OrganizationMergeRequest): Promise<boolean> =>
|
||||
request.post({ url: '/system/dept/merge', data }),
|
||||
|
||||
/** 从现有组织拆出同级组织。 */
|
||||
splitOrganization: (data: OrganizationSplitRequest): Promise<number> =>
|
||||
request.post({ url: '/system/dept/split', data }),
|
||||
|
||||
/** 查询组织架构树,使用组织架构菜单的任职数据范围。 */
|
||||
getOrganizationPage: async (params: OrganizationPageReqVO) => {
|
||||
const list = await request.get<DeptRecord[]>({
|
||||
url: '/system/dept/organization-tree',
|
||||
params: {
|
||||
menuCode: MenuPermission.ORGANIZATION,
|
||||
name: params.name,
|
||||
status: params.status
|
||||
}
|
||||
})
|
||||
const organizations = list.map(toOrganization)
|
||||
return {
|
||||
list: organizations,
|
||||
total: organizations.length
|
||||
} as PageResult<Organization[]>
|
||||
},
|
||||
|
||||
// 查询组织详情
|
||||
getOrganization: async (id: number) => {
|
||||
const dept = await request.get<DeptRecord>({ url: '/system/dept/get?id=' + id })
|
||||
return toOrganization(dept)
|
||||
},
|
||||
|
||||
/** 当前租户全部未停用的在职人员,供选择部门经理、副经理。 */
|
||||
getOrganizationMembers: (deptId?: number): Promise<OrganizationUser[]> =>
|
||||
request.get({ url: '/system/dept/member-simple-list', params: { deptId } }),
|
||||
|
||||
// 新增组织
|
||||
createOrganization: async (data: Organization) => {
|
||||
return await request.post({ url: '/system/dept/create', data: toDeptSavePayload(data) })
|
||||
},
|
||||
|
||||
// 修改组织
|
||||
updateOrganization: async (data: Organization) => {
|
||||
return await request.post({ url: '/system/dept/update', data: toDeptSavePayload(data) })
|
||||
},
|
||||
|
||||
// 批量保存同级组织的显示顺序
|
||||
updateOrganizationSortBatch: async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: '/system/dept/update-sort-batch',
|
||||
params: { ids: ids.join(',') }
|
||||
})
|
||||
},
|
||||
|
||||
// 删除组织
|
||||
deleteOrganization: async (id: number) => {
|
||||
return await request.post({ url: '/system/dept/delete?id=' + id })
|
||||
},
|
||||
|
||||
/** 批量删除组织 */
|
||||
deleteOrganizationList: async (ids: number[]) => {
|
||||
return await request.post({
|
||||
url: '/system/dept/delete-list',
|
||||
params: { ids: ids.join(',') }
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export type ParamValueType = 'string' | 'number' | 'boolean' | 'json'
|
||||
|
||||
export interface ParamVO {
|
||||
id: number | undefined
|
||||
category: string
|
||||
name: string
|
||||
key: string
|
||||
value: string
|
||||
type?: number
|
||||
valueType: ParamValueType
|
||||
status: number
|
||||
visible: boolean
|
||||
remark: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
export type ParamSaveVO = Pick<
|
||||
ParamVO,
|
||||
'id' | 'category' | 'name' | 'key' | 'value' | 'valueType' | 'status' | 'visible' | 'remark'
|
||||
>
|
||||
|
||||
const toParamSaveVO = (data: ParamVO): ParamSaveVO => ({
|
||||
id: data.id,
|
||||
category: data.category,
|
||||
name: data.name,
|
||||
key: data.key,
|
||||
value: data.value,
|
||||
valueType: data.valueType,
|
||||
status: data.status,
|
||||
visible: data.visible,
|
||||
remark: data.remark
|
||||
})
|
||||
|
||||
// 查询参数设置列表
|
||||
export const getParamPage = (params: PageParam) => {
|
||||
return request.get({ url: '/infra/config/page', params })
|
||||
}
|
||||
|
||||
// 查询参数设置详情
|
||||
export const getParam = (id: number) => {
|
||||
return request.get({ url: '/infra/config/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增参数设置
|
||||
export const createParam = (data: ParamVO) => {
|
||||
return request.post({ url: '/infra/config/create', data: toParamSaveVO(data) })
|
||||
}
|
||||
|
||||
// 修改参数设置
|
||||
export const updateParam = (data: ParamVO) => {
|
||||
return request.post({ url: '/infra/config/update', data: toParamSaveVO(data) })
|
||||
}
|
||||
|
||||
// 删除参数设置
|
||||
export const deleteParam = (id: number) => {
|
||||
return request.post({ url: '/infra/config/delete?id=' + id })
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
import request from '@/config/axios'
|
||||
import type { MenuPermission } from '@/utils/menuPermission'
|
||||
|
||||
/** 同一应用所有有权管理员共享的两类角色预设。 */
|
||||
export interface ApplicationRolePresetVO {
|
||||
applicationId: number
|
||||
defaultRoleIds: number[]
|
||||
externalRoleIds: number[]
|
||||
}
|
||||
|
||||
/** 查询应用角色预设,也用于新增用户回显。 */
|
||||
export const getApplicationRolePreset = (applicationId: number, menuCode?: MenuPermission): Promise<ApplicationRolePresetVO> =>
|
||||
request.get({ url: '/system/permission/role-preset', params: { applicationId, menuCode } })
|
||||
|
||||
/** 用户角色页范围外可选择的预设,仅提供启用预设角色。 */
|
||||
export interface UserRolePresetPreviewVO {
|
||||
applicationId: number
|
||||
applicationName: string
|
||||
applicationShortName?: string
|
||||
roleId: number
|
||||
roleName: string
|
||||
roleCode: string
|
||||
defaultPreset: boolean
|
||||
externalPreset: boolean
|
||||
/** 编辑时回显实际授权;新增时由预设类型决定勾选状态。 */
|
||||
assigned: boolean
|
||||
}
|
||||
|
||||
/** 查询当前租户管理范围外的启用预设;编辑时校验目标用户范围。 */
|
||||
export const getUserRolePresetPreview = (userId?: number, menuCode?: MenuPermission): Promise<UserRolePresetPreviewVO[]> =>
|
||||
request.get({ url: '/system/permission/user-role-preset-preview', params: { userId, menuCode } })
|
||||
|
||||
/** 保存同一应用的两类角色预设。 */
|
||||
export const saveApplicationRolePreset = (data: ApplicationRolePresetVO): Promise<boolean> =>
|
||||
request.post({ url: '/system/permission/role-preset', data })
|
||||
|
||||
export interface PermissionAssignUserRoleReqVO {
|
||||
userId: number
|
||||
roleIds: number[]
|
||||
}
|
||||
|
||||
export interface PermissionAssignRoleMenuReqVO {
|
||||
applicationId?: number
|
||||
roleId: number
|
||||
menuIds: number[]
|
||||
}
|
||||
|
||||
export interface PermissionAssignRoleDataScopeReqVO {
|
||||
applicationId?: number
|
||||
roleId: number
|
||||
dataScope: number
|
||||
dataScopeDeptIds: number[]
|
||||
}
|
||||
|
||||
/** 权限变更日志 */
|
||||
export interface PermissionChangeLogVO {
|
||||
id: number
|
||||
username: string
|
||||
name: string
|
||||
type: string
|
||||
targetType: string
|
||||
targetId?: number
|
||||
targetName: string
|
||||
content: string
|
||||
userIp?: string
|
||||
createTime: string | Date
|
||||
}
|
||||
|
||||
export interface PermissionChangeLogPageReqVO extends PageParam {
|
||||
keyword?: string
|
||||
type?: string
|
||||
}
|
||||
|
||||
// 查询角色拥有的菜单权限
|
||||
export const getRoleMenuList = async (roleId: number) => {
|
||||
return await request.get({ url: '/system/permission/list-role-menus?roleId=' + roleId })
|
||||
}
|
||||
|
||||
// 赋予角色菜单权限
|
||||
export const assignRoleMenu = async (data: PermissionAssignRoleMenuReqVO) => {
|
||||
return await request.post({ url: '/system/permission/assign-role-menu', data })
|
||||
}
|
||||
|
||||
// 赋予角色数据权限
|
||||
export const assignRoleDataScope = async (data: PermissionAssignRoleDataScopeReqVO) => {
|
||||
return await request.post({ url: '/system/permission/assign-role-data-scope', data })
|
||||
}
|
||||
|
||||
// 查询用户拥有的角色数组
|
||||
export const getUserRoleList = async (userId: number, menuCode?: MenuPermission) => {
|
||||
return await request.get({ url: '/system/permission/list-user-roles', params: { userId, menuCode } })
|
||||
}
|
||||
|
||||
// 赋予用户角色
|
||||
export const assignUserRole = async (data: PermissionAssignUserRoleReqVO, menuCode?: MenuPermission) => {
|
||||
return await request.post({ url: '/system/permission/assign-user-role', data, params: { menuCode } })
|
||||
}
|
||||
|
||||
// 查询权限变更日志分页
|
||||
export const getPermissionChangeLogPage = (
|
||||
params: PermissionChangeLogPageReqVO
|
||||
): Promise<PageResult<PermissionChangeLogVO[]>> => {
|
||||
return request.get({ url: '/system/permission-log/page', params })
|
||||
}
|
||||
|
||||
// 查询权限变更日志详情
|
||||
export const getPermissionChangeLog = (id: number): Promise<PermissionChangeLogVO> => {
|
||||
return request.get({ url: '/system/permission-log/get', params: { id } })
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface PortalCardVO {
|
||||
id: number
|
||||
cardName: string
|
||||
cardCode: string
|
||||
description?: string
|
||||
sort: number
|
||||
status: number
|
||||
visibleType: 'ALL' | 'CUSTOM'
|
||||
visibleOrgCount: number
|
||||
visibleGroupCount: number
|
||||
visibleUserCount: number
|
||||
version: number
|
||||
creator?: string
|
||||
createTime?: Date | string
|
||||
updater?: string
|
||||
updateTime?: Date | string
|
||||
}
|
||||
|
||||
export interface PortalCardPageReqVO extends PageParam {
|
||||
keyword?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
export interface PortalCardUpdateStatusReqVO {
|
||||
id: number
|
||||
status: number
|
||||
version: number
|
||||
}
|
||||
|
||||
export interface ResourceVisibilityValue {
|
||||
visibleType: 'ALL' | 'CUSTOM'
|
||||
visibleOrgIds: number[]
|
||||
visibleGroupIds: number[]
|
||||
visibleUserIds: number[]
|
||||
}
|
||||
|
||||
export interface PortalCardVisibilityVO extends ResourceVisibilityValue {
|
||||
id: number
|
||||
cardName: string
|
||||
version: number
|
||||
}
|
||||
|
||||
export interface PortalCardVisibilityUpdateReqVO extends ResourceVisibilityValue {
|
||||
id: number
|
||||
version: number
|
||||
}
|
||||
|
||||
// 查询门户卡片列表
|
||||
export const getPortalCardPage = (params: PortalCardPageReqVO) => {
|
||||
return request.get<PageResult<PortalCardVO[]>>({ url: '/portal/cards/page', params })
|
||||
}
|
||||
|
||||
// 修改门户卡片状态
|
||||
export const updatePortalCardStatus = (data: PortalCardUpdateStatusReqVO) => {
|
||||
return request.post({ url: '/portal/cards/update-status', data })
|
||||
}
|
||||
|
||||
// 查询门户卡片授权范围
|
||||
export const getPortalCardVisibility = (id: number): Promise<PortalCardVisibilityVO> => {
|
||||
return request.get({ url: '/portal/cards/visibility', params: { id } })
|
||||
}
|
||||
|
||||
// 修改门户卡片授权范围
|
||||
export const updatePortalCardVisibility = (data: PortalCardVisibilityUpdateReqVO) => {
|
||||
return request.post({ url: '/portal/cards/update-visibility', data })
|
||||
}
|
||||
|
||||
/** 定时主题时间选择方式。 */
|
||||
export enum PortalStyleTimeTypeEnum {
|
||||
Date = 'date',
|
||||
DateTime = 'datetime'
|
||||
}
|
||||
|
||||
export interface PortalStyleScheduleVO {
|
||||
id: number
|
||||
name: string
|
||||
themeColor?: string
|
||||
colorPlacement: 'ambient' | 'nav' | 'immersive'
|
||||
timeType: PortalStyleTimeTypeEnum
|
||||
startTime: string
|
||||
endTime: string
|
||||
status: number
|
||||
remark?: string
|
||||
}
|
||||
|
||||
export interface PortalStyleSchedulePageReqVO extends PageParam {
|
||||
name?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
export const getPortalStyleSchedulePage = (params: PortalStyleSchedulePageReqVO) =>
|
||||
request.get<PageResult<PortalStyleScheduleVO[]>>({ url: '/portal/style-schedules/page', params })
|
||||
|
||||
export const createPortalStyleSchedule = (data: Omit<PortalStyleScheduleVO, 'id'>) =>
|
||||
request.post({ url: '/portal/style-schedules/create', data })
|
||||
|
||||
export const updatePortalStyleSchedule = (data: PortalStyleScheduleVO) =>
|
||||
request.post({ url: '/portal/style-schedules/update', data })
|
||||
|
||||
export const updatePortalStyleScheduleStatus = (data: Pick<PortalStyleScheduleVO, 'id' | 'status'>) =>
|
||||
request.post({ url: '/portal/style-schedules/update-status', data })
|
||||
|
||||
export const deletePortalStyleSchedule = (id: number) =>
|
||||
request.post({ url: '/portal/style-schedules/delete', params: { id } })
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user