diff --git a/src/hooks/useDialog.ts b/src/hooks/useDialog.ts new file mode 100644 index 0000000..547f199 --- /dev/null +++ b/src/hooks/useDialog.ts @@ -0,0 +1,31 @@ +import { Ref } from 'vue'; + +interface Options { + title?: string; +} +interface Return { + title: Ref; + visible: Ref; + openDialog: () => void; + closeDialog: () => void; +} +export default (ops?: Options): Return => { + const visible = ref(false); + const title = ref(ops.title || ''); + + const openDialog = () => { + visible.value = true; + }; + + const closeDialog = () => { + visible.value = false; + }; + + return { + title, + visible, + + openDialog, + closeDialog + }; +}; diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 6667d05..5b18a8e 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -14,6 +14,7 @@ interface ImportMetaEnv { VITE_APP_MONITRO_ADMIN: string; VITE_APP_POWERJOB_ADMIN: string; VITE_APP_ENV: string; + VITE_APP_ENCRYPT: string VITE_APP_RSA_PUBLIC_KEY: string; VITE_APP_RSA_PRIVATE_KEY: string; VITE_APP_CLIENT_ID: string; diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 7c1cb3b..63edfbe 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -69,6 +69,7 @@ declare global { /** 乐观锁 */ version?: number; createBy?: any; + createDept?: any; createTime?: string; updateBy?: any; updateTime?: any;