Русифицировать README и интерфейс HY2XS admin

This commit is contained in:
2026-04-25 23:51:21 +05:00
parent 84a4e94567
commit 2b4a45ad23
167 changed files with 632 additions and 699 deletions
+4 -2
View File
@@ -2,8 +2,10 @@ import type { App } from "vue";
import { hasRole } from "./permission";
// 全局注册 directive
// Глобальная регистрация directive
export function setupDirective(app: App<Element>) {
// 使 v-hasRole 在所有组件中都可用
// Делает v-hasRole доступным во всех компонентах
app.directive("hasRole", hasRole);
}
@@ -2,14 +2,14 @@ import { useAccountStoreHook } from "@/store/modules/account";
import { Directive, DirectiveBinding } from "vue";
/**
* 角色权限
* Ролевые права
*/
export const hasRole: Directive = {
mounted(el: HTMLElement, binding: DirectiveBinding) {
const { value } = binding;
if (value) {
const requiredRoles = value; // DOM绑定需要的角色编码
const requiredRoles = value; // Коды ролей, требуемые DOM-привязкой
const { roles } = useAccountStoreHook();
const hasRole = roles.some((perm) => {
return requiredRoles.includes(perm);
@@ -23,3 +23,5 @@ export const hasRole: Directive = {
}
},
};