Skip to content

feat: Adapt to the new version of SSO #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @Wesley-0808 @WesleyWork-bot @minghua1016 @DDoS-LING
* @Wesley-0808 @WesleyWork-bot @minghua1016 @DDoS-LING @ZHF0208
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- `Index`:
- 修复切换动画时闪目标页面的问题 @Wesley-0808 ([#53](https://github.com/Wesley-Work/MTB-OA/pull/53))
- 修复网页图标无法正确加载的问题 @Wesley-0808 ([#53](https://github.com/Wesley-Work/MTB-OA/pull/53))
- `SuppleRecord`: 修复点击添加借出记录按钮无反馈的问题 @Wesley-0808
- `SuppleRecord`: 修复点击添加借出记录按钮无反馈的问题 @Wesley-0808 ([#55](https://github.com/Wesley-Work/MTB-OA/pull/55))
### 🚧 Others
- `EquipmentManage`: 更新设备列表不会改变分页内容 @Wesley-0808 ([#53](https://github.com/Wesley-Work/MTB-OA/pull/53))
- `UserManage`: 更新用户列表不会改变分页内容 @Wesley-0808 ([#53](https://github.com/Wesley-Work/MTB-OA/pull/53))
Expand Down
8 changes: 4 additions & 4 deletions src/components/numberBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ export default defineComponent({
name: 'NumberInput',
props: {
value: {
type: Number,
default: 6,
type: String,
default: undefined,
},
},
setup(props) {
const { value } = toRefs(props);
const renderItem = () => {
const items = Array.from({ length: value.value }, (_, index) => (
<div class={['codeItem', value.value === index]}>{value.value[index]}</div>
const items = Array.from({ length: value.value?.length }, (_, index) => (
<div class={['codeItem', value.value?.length === index]}>{value.value[index]}</div>
));
return <>{items}</>;
};
Expand Down
69 changes: 50 additions & 19 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ const packageVersion = version;

const routerMap: RouteMaps = [
{
label: '借出/归还',
label: '设备使用登记',
children: [
{
key: 'Lend',
label: '借出',
label: '设备借出',
icon: 'logout',
permissions: ['equipment.lend'],
component: () => import('@pages/equipment/lend.vue'),
},
{
key: 'Return',
label: '归还',
label: '设备归还',
icon: 'login',
permissions: ['equipment.return'],
component: () => import('@pages/equipment/return.vue'),
Expand All @@ -35,21 +35,20 @@ const routerMap: RouteMaps = [
{
key: 'TaskList',
label: '任务列表',
icon: 'server',
permissions: ['task.list'],
component: () => import('@pages/task/TaskList.vue'),
icon: 'task',
component: () => import('@pages/task/taskList.vue'),
},
{
key: 'AddTask',
key: 'TaskManage',
label: '添加任务',
icon: 'root-list',
permissions: ['task.add'],
component: () => import('@pages/task/addTask.vue'),
icon: 'task-setting',
permissions: ['task.post'],
component: () => import('@pages/task/taskManage.vue'),
},
{
key: 'MyTask',
label: '我的任务',
icon: 'control-platform',
icon: 'task-visible',
permissions: [],
component: () => import('@pages/task/myTask.vue'),
},
Expand Down Expand Up @@ -92,6 +91,36 @@ const routerMap: RouteMaps = [
},
],
},
{
label: '上网认证',
children: [
{
key: 'network-portal',
label: '绑定列表',
icon: 'internet',
permissions: ['network.manage'],
component: () => import('@pages/manage/network-portal.vue'),
},
],
},
{
label: '审计审批',
children: [
{
key: 'auditManage',
label: '审批管理',
icon: 'seal',
permissions: ['audit.manage'],
component: () => import('@pages/audit/auditManage.vue'),
},
{
key: 'auditProgress',
label: '审批进度',
icon: 'user-business',
component: () => import('@pages/audit/auditProgress.vue'),
},
],
},
{
label: 'Management',
children: [
Expand All @@ -103,13 +132,13 @@ const routerMap: RouteMaps = [
{
key: 'LendList',
label: '借出列表',
permissions: ['equipment.list'],
permissions: ['equipment.manage.getlist'],
component: () => import('@pages/equipment/list.vue'),
},
{
key: 'LendCheck',
label: '借出查询',
permissions: ['equipment.check'],
permissions: ['equipment.record.get'],
component: () => import('@pages/equipment/check.vue'),
},
],
Expand All @@ -122,7 +151,7 @@ const routerMap: RouteMaps = [
{
key: 'EqList',
label: '设备列表',
permissions: ['equipment.list'],
permissions: ['equipment.manage.getlist'],
component: () => import('@pages/manage/eqList.vue'),
},
{
Expand All @@ -142,13 +171,13 @@ const routerMap: RouteMaps = [
{
key: 'AccountManage',
label: '账号管理',
permissions: ['user.list'],
permissions: ['account.manage.getlist'],
component: () => import('@pages/manage/UserManage.vue'),
},
{
key: 'GroupManage',
label: '组管理',
permissions: ['group.add'],
permissions: ['account.manage.getlist'],
component: () => import('@pages/manage/GroupManage.vue'),
},
],
Expand Down Expand Up @@ -295,10 +324,12 @@ export const routerPrefix = config.routerPrefix;
export { routerMap, config, packageVersion };

export const VERSION = config.version;
export const VersionMode = config.versionMode;
export const SystemName = config.systemName;
export const SystemNameEn = config.systemNameEn;
export const versionMode = config.versionMode;
export const systemName = config.systemName;
export const systemNameEn = config.systemNameEn;
export const pagePermissionVerify = config.pagePermissionVerify;
export const menuPermissionVerify = config.menuPermissionVerify;
export const useViewTransition = config.useViewTransition;
export const allowHotUpdate = config.allowHotUpdate;
export const loginVerify = config.loginVerify;
export const menuUseCollapsed = config.menuUseCollapsed;
1 change: 0 additions & 1 deletion src/hooks/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export function getRoutePathObj(
export function verifyPath(path: string, map = routerMap, deep = 0) {
for (const item of map) {
if (item?.key === path) {
console.warn(item);
return true;
}
if (item?.children) {
Expand Down
39 changes: 17 additions & 22 deletions src/hooks/useBreadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineComponent, ref, toRefs, watch } from 'vue';
import { routerMap } from '../config';
import { Breadcrumb, BreadcrumbItem } from 'tdesign-vue-next';
import type { RouteMaps } from '@type/type';

export default defineComponent({
Expand All @@ -10,28 +11,22 @@ export default defineComponent({
},
},
setup(props) {
// const { value } = toRefs(props)
const { value } = toRefs(props);
const componentValue = ref(value.value);

watch(
() => value.value,
(newVal) => {
value.value = newVal;
componentValue.value = newVal;
},
);
const isHidden = ref(false);

// 通过url判断当前页面
// const getpath = () => {
// const path = window.location.hash.replace('#', '').replace(config.routerPrefix + '/', '');
// return path;
// };

function getIteminMap(
const getItemInMap = (
map: RouteMaps,
value: string,
deep = 0,
): { parent: string | null; current: string | null; fatherCrumb?: string | null } {
): { parent: string | null; current: string | null; fatherCrumb?: string | null } => {
for (const item of map) {
if (item?.key === value) {
isHidden.value = item?.hiddenBreadCrumb ?? false;
Expand All @@ -42,7 +37,7 @@ export default defineComponent({
};
}
if (item?.children) {
const result = getIteminMap(item.children, value, deep + 1);
const result = getItemInMap(item.children, value, deep + 1);
if (result?.current) {
return {
parent: result?.fatherCrumb ?? result?.parent ?? item.label,
Expand All @@ -52,33 +47,33 @@ export default defineComponent({
}
}
return { parent: null, current: null };
}
};

function renderCrumbItem(path: string, level = 0) {
const valuekey = getIteminMap(routerMap, path);
const renderCrumbItem = (path: string, level = 0) => {
const valueKey = getItemInMap(routerMap, path);
if (level === 0) {
return (
<>
<t-breadcrumbItem>媒体部管理系统</t-breadcrumbItem>
{renderCrumbItem(value.value, level + 1)}
<BreadcrumbItem>媒体部管理系统</BreadcrumbItem>
{renderCrumbItem(componentValue.value, level + 1)}
</>
);
}
if (!valuekey?.parent) {
return <t-breadcrumbItem>{valuekey?.current}</t-breadcrumbItem>;
if (!valueKey?.parent) {
return <BreadcrumbItem>{valueKey?.current}</BreadcrumbItem>;
} else {
return (
<>
<t-breadcrumbItem>{valuekey?.parent}</t-breadcrumbItem>
<t-breadcrumbItem>{valuekey?.current}</t-breadcrumbItem>
<BreadcrumbItem>{valueKey?.parent}</BreadcrumbItem>
<BreadcrumbItem>{valueKey?.current}</BreadcrumbItem>
</>
);
}
}
};

return () => (
<div style={isHidden.value ? 'display: none' : 'padding-bottom: 24px; user-select: none;'}>
<t-breadcrumb max-item-width={150}>{renderCrumbItem(value.value)}</t-breadcrumb>
<Breadcrumb max-item-width={150}>{renderCrumbItem(componentValue.value)}</Breadcrumb>
</div>
);
},
Expand Down
Loading
Loading