mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-15 21:02:01 +08:00
merge
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
export * from './auth';
|
||||
export * from './menu';
|
||||
export * from './timezone';
|
||||
export * from './user';
|
||||
|
||||
26
playground/src/api/core/timezone.ts
Normal file
26
playground/src/api/core/timezone.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 获取系统支持的时区列表
|
||||
*/
|
||||
export async function getTimezoneOptionsApi() {
|
||||
return await requestClient.get<
|
||||
{
|
||||
label: string;
|
||||
value: string;
|
||||
}[]
|
||||
>('/timezone/getTimezoneOptions');
|
||||
}
|
||||
/**
|
||||
* 获取用户时区
|
||||
*/
|
||||
export async function getTimezoneApi(): Promise<null | string | undefined> {
|
||||
return requestClient.get<null | string | undefined>('/timezone/getTimezone');
|
||||
}
|
||||
/**
|
||||
* 设置用户时区
|
||||
* @param timezone 时区
|
||||
*/
|
||||
export async function setTimezoneApi(timezone: string): Promise<void> {
|
||||
return requestClient.post('/timezone/setTimezone', { timezone });
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import { router } from '#/router';
|
||||
import { initComponentAdapter } from './adapter/component';
|
||||
import { initSetupVbenForm } from './adapter/form';
|
||||
import App from './app.vue';
|
||||
import { initTimezone } from './timezone-init';
|
||||
|
||||
async function bootstrap(namespace: string) {
|
||||
// 初始化组件适配器
|
||||
@@ -46,6 +47,9 @@ async function bootstrap(namespace: string) {
|
||||
// 配置 pinia-tore
|
||||
await initStores(app, { namespace });
|
||||
|
||||
// 初始化时区HANDLER
|
||||
initTimezone();
|
||||
|
||||
// 安装权限指令
|
||||
registerAccessDirective(app);
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"title": "系统管理",
|
||||
"dept": {
|
||||
"list": "部门列表",
|
||||
"createTime": "创建时间",
|
||||
@@ -62,6 +63,5 @@
|
||||
"operation": "操作",
|
||||
"permissions": "权限",
|
||||
"setPermissions": "授权"
|
||||
},
|
||||
"title": "系统管理"
|
||||
}
|
||||
}
|
||||
|
||||
20
playground/src/timezone-init.ts
Normal file
20
playground/src/timezone-init.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { setTimezoneHandler } from '@vben/stores';
|
||||
|
||||
import { getTimezoneApi, getTimezoneOptionsApi, setTimezoneApi } from '#/api';
|
||||
|
||||
/**
|
||||
* 初始化时区处理,通过API保存时区设置
|
||||
*/
|
||||
export function initTimezone() {
|
||||
setTimezoneHandler({
|
||||
getTimezone() {
|
||||
return getTimezoneApi();
|
||||
},
|
||||
setTimezone(timezone: string) {
|
||||
return setTimezoneApi(timezone);
|
||||
},
|
||||
getTimezoneOptions() {
|
||||
return getTimezoneOptionsApi();
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -22,8 +22,8 @@ const props = reactive({
|
||||
leftWidth: 30,
|
||||
resizable: true,
|
||||
rightWidth: 70,
|
||||
splitHandle: false,
|
||||
splitLine: false,
|
||||
splitHandle: true,
|
||||
splitLine: true,
|
||||
});
|
||||
const leftMinWidth = ref(props.leftMinWidth || 1);
|
||||
const leftMaxWidth = ref(props.leftMaxWidth || 100);
|
||||
@@ -42,7 +42,11 @@ const leftMaxWidth = ref(props.leftMaxWidth || 100);
|
||||
<template #left="{ isCollapsed, expand }">
|
||||
<div v-if="isCollapsed" @click="expand">
|
||||
<Tooltip title="点击展开左侧">
|
||||
<Button shape="circle" type="primary">
|
||||
<Button
|
||||
shape="circle"
|
||||
type="primary"
|
||||
class="flex items-center justify-center"
|
||||
>
|
||||
<template #icon>
|
||||
<IconifyIcon class="text-2xl" icon="bi:arrow-right" />
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user