diff --git a/eslint.config.js b/eslint.config.js index 00537e3..8829830 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,4 +1,5 @@ import { defineConfig } from '@soybeanjs/eslint-config'; +import tsEslintPlugin from '@typescript-eslint/eslint-plugin'; export default defineConfig( { vue: true, unocss: true }, @@ -20,5 +21,22 @@ export default defineConfig( ], 'unocss/order-attributify': 'off' } + }, + { + files: ['**/*.ts', '**/*.tsx', '**/*.vue'], + plugins: { + '@typescript-eslint': tsEslintPlugin + }, + rules: { + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + varsIgnorePattern: '^_', + argsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + ignoreRestSiblings: true + } + ] + } } ); diff --git a/src/constants/business.ts b/src/constants/business.ts index c0f2cd5..83e8a93 100644 --- a/src/constants/business.ts +++ b/src/constants/business.ts @@ -67,3 +67,11 @@ export const menuRouteKindRecord: Record = { + management: '管理岗', + technical: '技术岗', + business: '业务岗' +}; + +export const postTypeOptions = transformRecordToOption(postTypeRecord); diff --git a/src/layouts/modules/global-header/index.vue b/src/layouts/modules/global-header/index.vue index 44e92b4..164daa0 100644 --- a/src/layouts/modules/global-header/index.vue +++ b/src/layouts/modules/global-header/index.vue @@ -40,12 +40,6 @@ const { isFullscreen, toggle } = useFullscreen();
- themeStore.layout.scrollMode === 'wra placeholder="CN-RDMS" /> - - - - + diff --git a/src/service/api/system-manage.ts b/src/service/api/system-manage.ts index 2359844..b6d25ce 100644 --- a/src/service/api/system-manage.ts +++ b/src/service/api/system-manage.ts @@ -243,6 +243,59 @@ export function fetchGetPostSimpleList() { }); } +/** 获取岗位分页 */ +export function fetchGetPostPage(params?: Api.SystemManage.PostSearchParams) { + return request({ + url: `${POST_PREFIX}/page`, + method: 'get', + params + }); +} + +/** 获取岗位详情 */ +export function fetchGetPost(id: number) { + return request({ + url: `${POST_PREFIX}/get`, + method: 'get', + params: { id } + }); +} + +/** 创建岗位 */ +export function fetchCreatePost(data: Api.SystemManage.SavePostParams) { + return request({ + url: `${POST_PREFIX}/create`, + method: 'post', + data + }); +} + +/** 更新岗位 */ +export function fetchUpdatePost(data: { id: number } & Api.SystemManage.SavePostParams) { + return request({ + url: `${POST_PREFIX}/update`, + method: 'put', + data + }); +} + +/** 删除岗位 */ +export function fetchDeletePost(id: number) { + return request({ + url: `${POST_PREFIX}/delete`, + method: 'delete', + params: { id } + }); +} + +/** 批量删除岗位 */ +export function fetchBatchDeletePost(ids: number[]) { + return request({ + url: `${POST_PREFIX}/delete-list?${createBatchDeleteQuery(ids)}`, + method: 'delete' + }); +} + /** 获取用户分页 */ export function fetchGetUserPage(params?: Api.SystemManage.UserSearchParams) { return request({ diff --git a/src/theme/settings.ts b/src/theme/settings.ts index da587b2..eea9427 100644 --- a/src/theme/settings.ts +++ b/src/theme/settings.ts @@ -28,7 +28,7 @@ export const themeSettings: App.Theme.ThemeSetting = { showIcon: true }, multilingual: { - visible: true + visible: false }, globalSearch: { visible: true diff --git a/src/typings/api/system-manage.d.ts b/src/typings/api/system-manage.d.ts index ee9030f..71784a4 100644 --- a/src/typings/api/system-manage.d.ts +++ b/src/typings/api/system-manage.d.ts @@ -177,6 +177,18 @@ declare namespace Api { type PostType = 'management' | 'technical' | 'business'; + interface Post { + id: number; + name: string; + code?: string | null; + postType?: PostType | null; + levelRank?: number | null; + sort?: number | null; + status: CommonStatus; + remark?: string | null; + createTime: number; + } + interface PostSimple { id: number; name: string; @@ -188,6 +200,14 @@ declare namespace Api { type PostSimpleList = PostSimple[]; + type PostSearchParams = CommonType.RecordNullable> & PageParams; + + type SavePostParams = Pick & { + remark?: string | null; + }; + + type PostList = PageResult; + type RoleSimple = Pick; type RoleSimpleList = RoleSimple[]; diff --git a/src/views/_builtin/login/index.vue b/src/views/_builtin/login/index.vue index 50c699b..f9ea20e 100644 --- a/src/views/_builtin/login/index.vue +++ b/src/views/_builtin/login/index.vue @@ -3,7 +3,6 @@ import { computed } from 'vue'; import type { Component } from 'vue'; import { getPaletteColorByNumber, mixColor } from '@sa/color'; import { loginModuleRecord } from '@/constants/app'; -import { useAppStore } from '@/store/modules/app'; import { useThemeStore } from '@/store/modules/theme'; import { $t } from '@/locales'; import PwdLogin from './modules/pwd-login.vue'; @@ -18,7 +17,6 @@ interface Props { const props = defineProps(); -const appStore = useAppStore(); const themeStore = useThemeStore(); interface LoginModule { @@ -61,13 +59,6 @@ const bgColor = computed(() => { class="text-20px lt-sm:text-18px" @switch="themeStore.toggleThemeScheme" /> -
diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index 7bf29ea..9ec9af5 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -1,3 +1,319 @@ + + + + diff --git a/src/views/system/post/modules/post-operate-dialog.vue b/src/views/system/post/modules/post-operate-dialog.vue new file mode 100644 index 0000000..33f576e --- /dev/null +++ b/src/views/system/post/modules/post-operate-dialog.vue @@ -0,0 +1,202 @@ + + + + + diff --git a/src/views/system/post/modules/post-search.vue b/src/views/system/post/modules/post-search.vue new file mode 100644 index 0000000..3a3171b --- /dev/null +++ b/src/views/system/post/modules/post-search.vue @@ -0,0 +1,64 @@ + + + + +