@fmdevui/fm-dev 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/es/component.mjs +1 -1
- package/es/core/api/base/index.d.ts +19 -0
- package/es/core/api/index.d.ts +4 -0
- package/es/core/api/login/index.d.ts +7 -0
- package/es/core/api/sys/index.d.ts +39 -0
- package/es/core/api/utils/request.d.ts +36 -0
- package/es/core/auth/index.d.ts +40 -0
- package/es/core/directive/authDirective.d.ts +8 -0
- package/es/core/directive/customDirective.d.ts +21 -0
- package/es/core/directive/index.d.ts +9 -0
- package/es/core/index.d.ts +8 -0
- package/es/core/stores/index.d.ts +6 -0
- package/es/core/stores/inpinia.d.ts +3 -0
- package/es/core/stores/keepAliveNames.d.ts +17 -0
- package/es/core/stores/requestOldRoutes.d.ts +9 -0
- package/es/core/stores/routesList.d.ts +14 -0
- package/es/core/stores/tagsViewRoutes.d.ts +11 -0
- package/es/core/stores/themeConfig.d.ts +5 -0
- package/es/core/stores/userInfo.d.ts +21 -0
- package/es/core/utils/array/index.d.ts +23 -0
- package/es/core/utils/base64/index.d.ts +30 -0
- package/es/core/utils/comm/commonFunction.d.ts +17 -0
- package/es/core/utils/comm/data-signature.d.ts +17 -0
- package/es/core/utils/comm/download.d.ts +46 -0
- package/es/core/utils/comm/formatTime.d.ts +37 -0
- package/es/core/utils/comm/idleTimeout.d.ts +45 -0
- package/es/core/utils/comm/index.d.ts +7 -0
- package/es/core/utils/comm/setIconfont.d.ts +12 -0
- package/es/core/utils/comm/signalR.d.ts +3 -0
- package/es/core/utils/comm/sysInfo.d.ts +2 -0
- package/es/core/utils/comm/theme.d.ts +13 -0
- package/es/core/utils/comm/toolsValidate.d.ts +148 -0
- package/es/core/utils/comm/uploadfileurl.d.ts +2 -0
- package/es/core/utils/const/index.d.ts +11 -0
- package/es/core/utils/emit/index.d.ts +4 -0
- package/es/core/utils/index.d.ts +7 -0
- package/es/core/utils/other/index.d.ts +69 -0
- package/es/core/utils/storage/index.d.ts +27 -0
- package/es/core/utils/watermark/index.d.ts +10 -0
- package/es/index.d.ts +1 -0
- package/es/index.mjs +26 -3
- package/es/packages/core/api/base/index.mjs +179 -0
- package/es/packages/core/api/index.mjs +4 -0
- package/es/packages/core/api/login/index.mjs +35 -0
- package/es/packages/core/api/sys/index.mjs +201 -0
- package/es/packages/core/api/utils/request.mjs +173 -0
- package/es/packages/core/auth/index.mjs +34 -0
- package/es/packages/core/directive/authDirective.mjs +38 -0
- package/es/packages/core/directive/customDirective.mjs +147 -0
- package/es/packages/core/directive/index.mjs +10 -0
- package/es/packages/core/index.mjs +29 -0
- package/es/packages/core/stores/index.mjs +6 -0
- package/es/packages/core/stores/inpinia.mjs +5 -0
- package/es/packages/core/stores/keepAliveNames.mjs +29 -0
- package/es/packages/core/stores/requestOldRoutes.mjs +14 -0
- package/es/packages/core/stores/routesList.mjs +26 -0
- package/es/packages/core/stores/tagsViewRoutes.mjs +22 -0
- package/es/packages/core/stores/themeConfig.mjs +161 -0
- package/es/packages/core/stores/userInfo.mjs +156 -0
- package/es/packages/core/ui/login/style/index.mjs +1 -0
- package/es/packages/core/utils/array/index.mjs +59 -0
- package/es/packages/core/utils/base64/index.mjs +57 -0
- package/es/packages/core/utils/comm/calendar.mjs +785 -0
- package/es/packages/core/utils/comm/commonFunction.mjs +83 -0
- package/es/packages/core/utils/comm/data-signature.mjs +39 -0
- package/es/packages/core/utils/comm/download.mjs +78 -0
- package/es/packages/core/utils/comm/formatTime.mjs +110 -0
- package/es/packages/core/utils/comm/idleTimeout.mjs +124 -0
- package/es/packages/core/utils/comm/index.mjs +7 -0
- package/es/packages/core/utils/comm/setIconfont.mjs +36 -0
- package/es/packages/core/utils/comm/signalR.mjs +45 -0
- package/es/packages/core/utils/comm/sysInfo.mjs +54 -0
- package/es/packages/core/utils/comm/theme.mjs +54 -0
- package/es/packages/core/utils/comm/toolsValidate.mjs +140 -0
- package/es/packages/core/utils/comm/uploadfileurl.mjs +12 -0
- package/es/packages/core/utils/const/index.mjs +13 -0
- package/es/packages/core/utils/emit/index.mjs +5 -0
- package/es/packages/core/utils/index.mjs +13 -0
- package/es/packages/core/utils/other/index.mjs +137 -0
- package/es/packages/core/utils/storage/index.mjs +55 -0
- package/es/packages/core/utils/watermark/index.mjs +39 -0
- package/global.d.ts +0 -1
- package/index.js +22990 -5106
- package/index.min.js +42 -10
- package/index.min.mjs +42 -10
- package/index.mjs +22916 -5104
- package/lib/component.js +1 -1
- package/lib/core/api/base/index.d.ts +19 -0
- package/lib/core/api/index.d.ts +4 -0
- package/lib/core/api/login/index.d.ts +7 -0
- package/lib/core/api/sys/index.d.ts +39 -0
- package/lib/core/api/utils/request.d.ts +36 -0
- package/lib/core/auth/index.d.ts +40 -0
- package/lib/core/directive/authDirective.d.ts +8 -0
- package/lib/core/directive/customDirective.d.ts +21 -0
- package/lib/core/directive/index.d.ts +9 -0
- package/lib/core/index.d.ts +8 -0
- package/lib/core/stores/index.d.ts +6 -0
- package/lib/core/stores/inpinia.d.ts +3 -0
- package/lib/core/stores/keepAliveNames.d.ts +17 -0
- package/lib/core/stores/requestOldRoutes.d.ts +9 -0
- package/lib/core/stores/routesList.d.ts +14 -0
- package/lib/core/stores/tagsViewRoutes.d.ts +11 -0
- package/lib/core/stores/themeConfig.d.ts +5 -0
- package/lib/core/stores/userInfo.d.ts +21 -0
- package/lib/core/utils/array/index.d.ts +23 -0
- package/lib/core/utils/base64/index.d.ts +30 -0
- package/lib/core/utils/comm/commonFunction.d.ts +17 -0
- package/lib/core/utils/comm/data-signature.d.ts +17 -0
- package/lib/core/utils/comm/download.d.ts +46 -0
- package/lib/core/utils/comm/formatTime.d.ts +37 -0
- package/lib/core/utils/comm/idleTimeout.d.ts +45 -0
- package/lib/core/utils/comm/index.d.ts +7 -0
- package/lib/core/utils/comm/setIconfont.d.ts +12 -0
- package/lib/core/utils/comm/signalR.d.ts +3 -0
- package/lib/core/utils/comm/sysInfo.d.ts +2 -0
- package/lib/core/utils/comm/theme.d.ts +13 -0
- package/lib/core/utils/comm/toolsValidate.d.ts +148 -0
- package/lib/core/utils/comm/uploadfileurl.d.ts +2 -0
- package/lib/core/utils/const/index.d.ts +11 -0
- package/lib/core/utils/emit/index.d.ts +4 -0
- package/lib/core/utils/index.d.ts +7 -0
- package/lib/core/utils/other/index.d.ts +69 -0
- package/lib/core/utils/storage/index.d.ts +27 -0
- package/lib/core/utils/watermark/index.d.ts +10 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +113 -9
- package/lib/packages/core/api/base/index.js +181 -0
- package/lib/packages/core/api/index.js +26 -0
- package/lib/packages/core/api/login/index.js +37 -0
- package/lib/packages/core/api/sys/index.js +204 -0
- package/lib/packages/core/api/utils/request.js +190 -0
- package/lib/packages/core/auth/index.js +41 -0
- package/lib/packages/core/directive/authDirective.js +40 -0
- package/lib/packages/core/directive/customDirective.js +151 -0
- package/lib/packages/core/directive/index.js +12 -0
- package/lib/packages/core/index.js +122 -0
- package/lib/packages/core/stores/index.js +17 -0
- package/lib/packages/core/stores/inpinia.js +7 -0
- package/lib/packages/core/stores/keepAliveNames.js +31 -0
- package/lib/packages/core/stores/requestOldRoutes.js +16 -0
- package/lib/packages/core/stores/routesList.js +28 -0
- package/lib/packages/core/stores/tagsViewRoutes.js +24 -0
- package/lib/packages/core/stores/themeConfig.js +163 -0
- package/lib/packages/core/stores/userInfo.js +158 -0
- package/lib/packages/core/ui/login/style/index.js +2 -0
- package/lib/packages/core/utils/array/index.js +64 -0
- package/lib/packages/core/utils/base64/index.js +63 -0
- package/lib/packages/core/utils/comm/calendar.js +789 -0
- package/lib/packages/core/utils/comm/commonFunction.js +87 -0
- package/lib/packages/core/utils/comm/data-signature.js +41 -0
- package/lib/packages/core/utils/comm/download.js +86 -0
- package/lib/packages/core/utils/comm/formatTime.js +115 -0
- package/lib/packages/core/utils/comm/idleTimeout.js +128 -0
- package/lib/packages/core/utils/comm/index.js +50 -0
- package/lib/packages/core/utils/comm/setIconfont.js +42 -0
- package/lib/packages/core/utils/comm/signalR.js +66 -0
- package/lib/packages/core/utils/comm/sysInfo.js +57 -0
- package/lib/packages/core/utils/comm/theme.js +56 -0
- package/lib/packages/core/utils/comm/toolsValidate.js +165 -0
- package/lib/packages/core/utils/comm/uploadfileurl.js +14 -0
- package/lib/packages/core/utils/const/index.js +15 -0
- package/lib/packages/core/utils/emit/index.js +9 -0
- package/lib/packages/core/utils/index.js +69 -0
- package/lib/packages/core/utils/other/index.js +149 -0
- package/lib/packages/core/utils/storage/index.js +58 -0
- package/lib/packages/core/utils/watermark/index.js +41 -0
- package/package.json +3 -3
- package/es/fmcore/index.d.ts +0 -3
- package/es/fmcore/locales/index.d.ts +0 -1
- package/es/fmcore/types/axios/index.d.ts +0 -11
- package/es/packages/fmcore/index.mjs +0 -4
- package/es/packages/fmcore/locales/index.mjs +0 -1
- package/es/packages/fmcore/types/axios/index.mjs +0 -2
- package/lib/fmcore/index.d.ts +0 -3
- package/lib/fmcore/locales/index.d.ts +0 -1
- package/lib/fmcore/types/axios/index.d.ts +0 -11
- package/lib/packages/fmcore/index.js +0 -16
- package/lib/packages/fmcore/locales/index.js +0 -12
- package/lib/packages/fmcore/types/axios/index.js +0 -28
- /package/es/{fmcore/locales/i18n.d.ts → core/locales/index.d.ts} +0 -0
- /package/es/{fmcore → core}/locales/lang/de.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/en.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/es.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/fi.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/fr.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/id.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/it.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/ja.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/ko.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/ms.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/no.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/pl.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/pt.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/ru.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/th.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/zh-CN.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/zh-HK.d.ts +0 -0
- /package/es/{fmcore → core}/locales/lang/zh-TW.d.ts +0 -0
- /package/es/{fmcore → core}/types/comm/index.d.ts +0 -0
- /package/es/{fmcore → core}/types/emitt/index.d.ts +0 -0
- /package/es/{fmcore → core}/types/index.d.ts +0 -0
- /package/es/{fmcore → core}/types/layout/index.d.ts +0 -0
- /package/es/{fmcore → core}/types/menu/MenuOutput.d.ts +0 -0
- /package/es/{fmcore → core}/types/menu/index.d.ts +0 -0
- /package/es/{fmcore → core}/types/menu/menu-type-enum.d.ts +0 -0
- /package/es/{fmcore → core}/types/menu/status-enum.d.ts +0 -0
- /package/es/{fmcore → core}/types/menu/sys-menu-meta.d.ts +0 -0
- /package/es/{fmcore → core}/types/pinia/index.d.ts +0 -0
- /package/es/{fmcore → core}/types/router/index.d.ts +0 -0
- /package/es/{fmcore → core}/types/table/index.d.ts +0 -0
- /package/es/{fmcore → core}/types/view/index.d.ts +0 -0
- /package/es/{fmcore → core}/ui/login/index.d.ts +0 -0
- /package/es/{fmcore → core}/ui/login/src/index.vue.d.ts +0 -0
- /package/es/{fmcore → core}/ui/login/src/type.d.ts +0 -0
- /package/es/{fmcore → core}/ui/login/style/css.d.ts +0 -0
- /package/es/{fmcore → core}/ui/login/style/index.d.ts +0 -0
- /package/es/packages/{fmcore/locales/vite-env.d.mjs → core/api/types/global.d.mjs} +0 -0
- /package/es/packages/{fmcore/locales/i18n.mjs → core/locales/index.mjs} +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/de.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/en.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/es.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/fi.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/fr.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/id.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/it.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/ja.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/ko.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/ms.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/no.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/pl.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/pt.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/ru.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/th.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/zh-CN.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/zh-HK.mjs +0 -0
- /package/es/packages/{fmcore → core}/locales/lang/zh-TW.mjs +0 -0
- /package/es/packages/{fmcore/types/comm/index.mjs → core/locales/vite-env.d.mjs} +0 -0
- /package/es/packages/{fmcore/types/emitt → core/types/comm}/index.mjs +0 -0
- /package/es/packages/{fmcore/types/layout → core/types/emitt}/index.mjs +0 -0
- /package/es/packages/{fmcore → core}/types/index.mjs +0 -0
- /package/es/packages/{fmcore/types/pinia → core/types/layout}/index.mjs +0 -0
- /package/es/packages/{fmcore → core}/types/menu/MenuOutput.mjs +0 -0
- /package/es/packages/{fmcore → core}/types/menu/index.mjs +0 -0
- /package/es/packages/{fmcore → core}/types/menu/menu-type-enum.mjs +0 -0
- /package/es/packages/{fmcore → core}/types/menu/status-enum.mjs +0 -0
- /package/es/packages/{fmcore → core}/types/menu/sys-menu-meta.mjs +0 -0
- /package/es/packages/{fmcore/types/router → core/types/pinia}/index.mjs +0 -0
- /package/es/packages/{fmcore/types/table → core/types/router}/index.mjs +0 -0
- /package/es/packages/{fmcore/types/view → core/types/table}/index.mjs +0 -0
- /package/es/packages/{fmcore/ui/login/style → core/types/view}/index.mjs +0 -0
- /package/es/packages/{fmcore → core}/ui/login/index.mjs +0 -0
- /package/es/packages/{fmcore → core}/ui/login/src/index.vue.mjs +0 -0
- /package/es/packages/{fmcore → core}/ui/login/src/index.vue2.mjs +0 -0
- /package/es/packages/{fmcore → core}/ui/login/src/type.mjs +0 -0
- /package/es/packages/{fmcore → core}/ui/login/style/css.mjs +0 -0
- /package/lib/{fmcore/locales/i18n.d.ts → core/locales/index.d.ts} +0 -0
- /package/lib/{fmcore → core}/locales/lang/de.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/en.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/es.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/fi.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/fr.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/id.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/it.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/ja.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/ko.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/ms.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/no.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/pl.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/pt.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/ru.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/th.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/zh-CN.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/zh-HK.d.ts +0 -0
- /package/lib/{fmcore → core}/locales/lang/zh-TW.d.ts +0 -0
- /package/lib/{fmcore → core}/types/comm/index.d.ts +0 -0
- /package/lib/{fmcore → core}/types/emitt/index.d.ts +0 -0
- /package/lib/{fmcore → core}/types/index.d.ts +0 -0
- /package/lib/{fmcore → core}/types/layout/index.d.ts +0 -0
- /package/lib/{fmcore → core}/types/menu/MenuOutput.d.ts +0 -0
- /package/lib/{fmcore → core}/types/menu/index.d.ts +0 -0
- /package/lib/{fmcore → core}/types/menu/menu-type-enum.d.ts +0 -0
- /package/lib/{fmcore → core}/types/menu/status-enum.d.ts +0 -0
- /package/lib/{fmcore → core}/types/menu/sys-menu-meta.d.ts +0 -0
- /package/lib/{fmcore → core}/types/pinia/index.d.ts +0 -0
- /package/lib/{fmcore → core}/types/router/index.d.ts +0 -0
- /package/lib/{fmcore → core}/types/table/index.d.ts +0 -0
- /package/lib/{fmcore → core}/types/view/index.d.ts +0 -0
- /package/lib/{fmcore → core}/ui/login/index.d.ts +0 -0
- /package/lib/{fmcore → core}/ui/login/src/index.vue.d.ts +0 -0
- /package/lib/{fmcore → core}/ui/login/src/type.d.ts +0 -0
- /package/lib/{fmcore → core}/ui/login/style/css.d.ts +0 -0
- /package/lib/{fmcore → core}/ui/login/style/index.d.ts +0 -0
- /package/lib/packages/{fmcore/locales/vite-env.d.js → core/api/types/global.d.js} +0 -0
- /package/lib/packages/{fmcore/locales/i18n.js → core/locales/index.js} +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/de.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/en.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/es.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/fi.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/fr.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/id.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/it.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/ja.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/ko.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/ms.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/no.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/pl.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/pt.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/ru.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/th.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/zh-CN.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/zh-HK.js +0 -0
- /package/lib/packages/{fmcore → core}/locales/lang/zh-TW.js +0 -0
- /package/lib/packages/{fmcore/types/comm/index.js → core/locales/vite-env.d.js} +0 -0
- /package/lib/packages/{fmcore/types/emitt → core/types/comm}/index.js +0 -0
- /package/lib/packages/{fmcore/types/layout → core/types/emitt}/index.js +0 -0
- /package/lib/packages/{fmcore → core}/types/index.js +0 -0
- /package/lib/packages/{fmcore/types/pinia → core/types/layout}/index.js +0 -0
- /package/lib/packages/{fmcore → core}/types/menu/MenuOutput.js +0 -0
- /package/lib/packages/{fmcore → core}/types/menu/index.js +0 -0
- /package/lib/packages/{fmcore → core}/types/menu/menu-type-enum.js +0 -0
- /package/lib/packages/{fmcore → core}/types/menu/status-enum.js +0 -0
- /package/lib/packages/{fmcore → core}/types/menu/sys-menu-meta.js +0 -0
- /package/lib/packages/{fmcore/types/router → core/types/pinia}/index.js +0 -0
- /package/lib/packages/{fmcore/types/table → core/types/router}/index.js +0 -0
- /package/lib/packages/{fmcore/types/view → core/types/table}/index.js +0 -0
- /package/lib/packages/{fmcore/ui/login/style → core/types/view}/index.js +0 -0
- /package/lib/packages/{fmcore → core}/ui/login/index.js +0 -0
- /package/lib/packages/{fmcore → core}/ui/login/src/index.vue.js +0 -0
- /package/lib/packages/{fmcore → core}/ui/login/src/index.vue2.js +0 -0
- /package/lib/packages/{fmcore → core}/ui/login/src/type.js +0 -0
- /package/lib/packages/{fmcore → core}/ui/login/style/css.js +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
function verifyNumberPercentage(val) {
|
|
2
|
+
let v = val.replace(/(^\s*)|(\s*$)/g, "");
|
|
3
|
+
v = v.replace(/[^\d]/g, "");
|
|
4
|
+
v = v.replace(/^0/g, "");
|
|
5
|
+
v = v.replace(/^[1-9]\d\d{1,3}$/, "100");
|
|
6
|
+
return v;
|
|
7
|
+
}
|
|
8
|
+
function verifyNumberPercentageFloat(val) {
|
|
9
|
+
let v = verifyNumberIntegerAndFloat(val);
|
|
10
|
+
v = v.replace(/^[1-9]\d\d{1,3}$/, "100");
|
|
11
|
+
v = v.replace(/^100\.$/, "100");
|
|
12
|
+
return v;
|
|
13
|
+
}
|
|
14
|
+
function verifyNumberIntegerAndFloat(val) {
|
|
15
|
+
let v = val.replace(/(^\s*)|(\s*$)/g, "");
|
|
16
|
+
v = v.replace(/[^\d.]/g, "");
|
|
17
|
+
v = v.replace(/^0{2}$/g, "0");
|
|
18
|
+
v = v.replace(/^\./g, "");
|
|
19
|
+
v = v.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
|
20
|
+
v = v.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3");
|
|
21
|
+
return v;
|
|
22
|
+
}
|
|
23
|
+
function verifiyNumberInteger(val) {
|
|
24
|
+
let v = val.replace(/(^\s*)|(\s*$)/g, "");
|
|
25
|
+
v = v.replace(/[\.]*/g, "");
|
|
26
|
+
v = v.replace(/(^0[\d]*)$/g, "0");
|
|
27
|
+
v = v.replace(/^0\d$/g, "0");
|
|
28
|
+
v = v.replace(/[^\d]/g, "");
|
|
29
|
+
return v;
|
|
30
|
+
}
|
|
31
|
+
function verifyCnAndSpace(val) {
|
|
32
|
+
let v = val.replace(/[\u4e00-\u9fa5\s]+/g, "");
|
|
33
|
+
v = v.replace(/(^\s*)|(\s*$)/g, "");
|
|
34
|
+
return v;
|
|
35
|
+
}
|
|
36
|
+
function verifyEnAndSpace(val) {
|
|
37
|
+
let v = val.replace(/[a-zA-Z]+/g, "");
|
|
38
|
+
v = v.replace(/(^\s*)|(\s*$)/g, "");
|
|
39
|
+
return v;
|
|
40
|
+
}
|
|
41
|
+
function verifyAndSpace(val) {
|
|
42
|
+
let v = val.replace(/(^\s*)|(\s*$)/g, "");
|
|
43
|
+
return v;
|
|
44
|
+
}
|
|
45
|
+
function verifyNumberComma(val) {
|
|
46
|
+
let v = verifyNumberIntegerAndFloat(val);
|
|
47
|
+
v = v.toString().split(".");
|
|
48
|
+
v[0] = v[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
49
|
+
v = v.join(".");
|
|
50
|
+
return v;
|
|
51
|
+
}
|
|
52
|
+
function verifyTextColor(val, text = "", color = "red") {
|
|
53
|
+
let v = text.replace(new RegExp(val, "gi"), `<span style='color: ${color}'>${val}</span>`);
|
|
54
|
+
return v;
|
|
55
|
+
}
|
|
56
|
+
function verifyNumberCnUppercase(val, unit = "\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206", v = "") {
|
|
57
|
+
val += "00";
|
|
58
|
+
let lookup = val.indexOf(".");
|
|
59
|
+
if (lookup >= 0) val = val.substring(0, lookup) + val.substr(lookup + 1, 2);
|
|
60
|
+
unit = unit.substr(unit.length - val.length);
|
|
61
|
+
for (let i = 0; i < val.length; i++) {
|
|
62
|
+
v += "\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(val.substr(i, 1), 1) + unit.substr(i, 1);
|
|
63
|
+
}
|
|
64
|
+
v = v.replace(/零角零分$/, "\u6574").replace(/零[仟佰拾]/g, "\u96F6").replace(/零{2,}/g, "\u96F6").replace(/零([亿|万])/g, "$1").replace(/零+元/, "\u5143").replace(/亿零{0,3}万/, "\u4EBF").replace(/^元/, "\u96F6\u5143");
|
|
65
|
+
return v;
|
|
66
|
+
}
|
|
67
|
+
function verifyPhone(val) {
|
|
68
|
+
if (!/^1[3456789][0-9]{9}$/.test(val)) return false;
|
|
69
|
+
else return true;
|
|
70
|
+
}
|
|
71
|
+
function verifyTelPhone(val) {
|
|
72
|
+
if (!/\d{3}-\d{8}|\d{4}-\d{7}/.test(val)) return false;
|
|
73
|
+
else return true;
|
|
74
|
+
}
|
|
75
|
+
function verifyAccount(val) {
|
|
76
|
+
if (!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(val)) return false;
|
|
77
|
+
else return true;
|
|
78
|
+
}
|
|
79
|
+
function verifyPassword(val) {
|
|
80
|
+
if (!/^[a-zA-Z]\w{5,15}$/.test(val)) return false;
|
|
81
|
+
else return true;
|
|
82
|
+
}
|
|
83
|
+
function verifyPasswordPowerful(val) {
|
|
84
|
+
if (!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(val)) return false;
|
|
85
|
+
else return true;
|
|
86
|
+
}
|
|
87
|
+
function verifyPasswordStrength(val) {
|
|
88
|
+
let v = "";
|
|
89
|
+
if (/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(val)) v = "\u5F31";
|
|
90
|
+
if (/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(val)) v = "\u4E2D";
|
|
91
|
+
if (/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(val)) v = "\u5F3A";
|
|
92
|
+
return v;
|
|
93
|
+
}
|
|
94
|
+
function verifyIPAddress(val) {
|
|
95
|
+
if (!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(val)) return false;
|
|
96
|
+
else return true;
|
|
97
|
+
}
|
|
98
|
+
function verifyEmail(val) {
|
|
99
|
+
if (!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(val)) return false;
|
|
100
|
+
else return true;
|
|
101
|
+
}
|
|
102
|
+
function verifyIdCard(val) {
|
|
103
|
+
if (!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(val)) return false;
|
|
104
|
+
else return true;
|
|
105
|
+
}
|
|
106
|
+
function verifyFullName(val) {
|
|
107
|
+
if (!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(val)) return false;
|
|
108
|
+
else return true;
|
|
109
|
+
}
|
|
110
|
+
function verifyPostalCode(val) {
|
|
111
|
+
if (!/^[1-9][0-9]{5}$/.test(val)) return false;
|
|
112
|
+
else return true;
|
|
113
|
+
}
|
|
114
|
+
function verifyUrl(val) {
|
|
115
|
+
if (!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(
|
|
116
|
+
val
|
|
117
|
+
))
|
|
118
|
+
return false;
|
|
119
|
+
else return true;
|
|
120
|
+
}
|
|
121
|
+
function verifyCarNum(val) {
|
|
122
|
+
if (!/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(
|
|
123
|
+
val
|
|
124
|
+
))
|
|
125
|
+
return false;
|
|
126
|
+
else return true;
|
|
127
|
+
}
|
|
128
|
+
function judgementIdCard(idCard) {
|
|
129
|
+
let entity = {};
|
|
130
|
+
let currentDate = /* @__PURE__ */ new Date();
|
|
131
|
+
let yearNow = currentDate.getFullYear();
|
|
132
|
+
let birthDateCode = idCard.substring(6, 14);
|
|
133
|
+
let genderCode = parseInt(idCard.substring(16, 17), 10);
|
|
134
|
+
entity.sex = genderCode % 2 === 0 ? 2 : 1;
|
|
135
|
+
entity.age = yearNow - parseInt(birthDateCode.substring(0, 4));
|
|
136
|
+
entity.birthday = `${birthDateCode.substring(0, 4)}-${birthDateCode.substring(4, 6)}-${birthDateCode.substring(6, 8)}`;
|
|
137
|
+
return entity;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const getFileUrl = (row) => {
|
|
2
|
+
if (row.bucketName == "Local") {
|
|
3
|
+
return `/${row.filePath}/${row.id}${row.suffix}`;
|
|
4
|
+
} else {
|
|
5
|
+
if (row.bucketName && row.bucketName != "")
|
|
6
|
+
return `/${row.bucketName}/${row.filePath}/${row.id}${row.suffix}`;
|
|
7
|
+
else
|
|
8
|
+
return `/${row.filePath}/${row.id}${row.suffix}`;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { getFileUrl };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const PUB = {
|
|
2
|
+
token: "token",
|
|
3
|
+
userInfo: "userInfo",
|
|
4
|
+
constList: "constList",
|
|
5
|
+
tId: "tid",
|
|
6
|
+
isTagsViewCurrenFull: "isTagsViewCurrenFull",
|
|
7
|
+
themeConfig: "themeConfig",
|
|
8
|
+
userTable: "userTable",
|
|
9
|
+
accessTokenKey: "access-token",
|
|
10
|
+
refreshAccessTokenKey: "x-ccess-token"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { PUB };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { clone, isObjectValueEqual, judgementSameArr, removeDuplicate } from './array/index.mjs';
|
|
2
|
+
export { Watermark } from './watermark/index.mjs';
|
|
3
|
+
import './emit/index.mjs';
|
|
4
|
+
export { base64ToFile, blobToFile, dataURLtoBlob, fileToBase64, urlToBase64 } from './base64/index.mjs';
|
|
5
|
+
export { Local, Session } from './storage/index.mjs';
|
|
6
|
+
import './comm/index.mjs';
|
|
7
|
+
export { PUB } from './const/index.mjs';
|
|
8
|
+
export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl } from './comm/toolsValidate.mjs';
|
|
9
|
+
export { formatAxis, formatDate, formatPast, getWeek } from './comm/formatTime.mjs';
|
|
10
|
+
export { useChangeColor } from './comm/theme.mjs';
|
|
11
|
+
export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './comm/download.mjs';
|
|
12
|
+
export { signatureByKSort } from './comm/data-signature.mjs';
|
|
13
|
+
export { getFileUrl } from './comm/uploadfileurl.mjs';
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import { useRouter } from 'vue-router';
|
|
3
|
+
import { pinia } from '../../stores/inpinia.mjs';
|
|
4
|
+
import { storeToRefs } from 'pinia';
|
|
5
|
+
import '../../stores/index.mjs';
|
|
6
|
+
import { useI18n } from 'vue-i18n';
|
|
7
|
+
import { Local } from '../storage/index.mjs';
|
|
8
|
+
import { verifyUrl } from '../comm/toolsValidate.mjs';
|
|
9
|
+
import { useThemeConfig } from '../../stores/themeConfig.mjs';
|
|
10
|
+
|
|
11
|
+
function useTitle() {
|
|
12
|
+
const stores = useThemeConfig(pinia);
|
|
13
|
+
const { themeConfig } = storeToRefs(stores);
|
|
14
|
+
const router = useRouter();
|
|
15
|
+
nextTick(() => {
|
|
16
|
+
let webTitle = "";
|
|
17
|
+
let globalTitle = themeConfig.value.globalTitle;
|
|
18
|
+
const { path, meta } = router.currentRoute.value;
|
|
19
|
+
if (path === "/login") {
|
|
20
|
+
webTitle = meta.title;
|
|
21
|
+
} else {
|
|
22
|
+
webTitle = setTagsViewNameI18n(router.currentRoute.value);
|
|
23
|
+
}
|
|
24
|
+
document.title = `${webTitle} - ${globalTitle}` || globalTitle;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function setTagsViewNameI18n(item) {
|
|
28
|
+
let tagsViewName = "";
|
|
29
|
+
const { query, params, meta } = item;
|
|
30
|
+
const i18n = useI18n();
|
|
31
|
+
const pattern = /^\{("(zh-CN|en|zh-TW)":"[^,]+",?){1,3}}$/;
|
|
32
|
+
if (query?.tagsViewName || params?.tagsViewName) {
|
|
33
|
+
if (pattern.test(query?.tagsViewName) || pattern.test(params?.tagsViewName)) {
|
|
34
|
+
const urlTagsParams = query?.tagsViewName && JSON.parse(query?.tagsViewName) || params?.tagsViewName && JSON.parse(params?.tagsViewName);
|
|
35
|
+
tagsViewName = urlTagsParams[i18n.locale.value];
|
|
36
|
+
} else {
|
|
37
|
+
tagsViewName = query?.tagsViewName || params?.tagsViewName;
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
tagsViewName = i18n.t(`message.menu.${meta.title}`);
|
|
41
|
+
}
|
|
42
|
+
return tagsViewName;
|
|
43
|
+
}
|
|
44
|
+
const lazyImg = (el, arr) => {
|
|
45
|
+
const io = new IntersectionObserver((res) => {
|
|
46
|
+
res.forEach((v) => {
|
|
47
|
+
if (v.isIntersecting) {
|
|
48
|
+
const { img, key } = v.target.dataset;
|
|
49
|
+
v.target.src = img;
|
|
50
|
+
v.target.onload = () => {
|
|
51
|
+
io.unobserve(v.target);
|
|
52
|
+
arr[key]["loading"] = false;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
nextTick(() => {
|
|
58
|
+
document.querySelectorAll(el).forEach((img) => io.observe(img));
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
const globalComponentSize = () => {
|
|
62
|
+
const stores = useThemeConfig(pinia);
|
|
63
|
+
const { themeConfig } = storeToRefs(stores);
|
|
64
|
+
return Local.get("themeConfig")?.globalComponentSize || themeConfig.value?.globalComponentSize;
|
|
65
|
+
};
|
|
66
|
+
function deepClone(obj) {
|
|
67
|
+
let newObj;
|
|
68
|
+
try {
|
|
69
|
+
newObj = obj.push ? [] : {};
|
|
70
|
+
} catch (error) {
|
|
71
|
+
newObj = {};
|
|
72
|
+
}
|
|
73
|
+
for (let attr in obj) {
|
|
74
|
+
if (obj[attr] && typeof obj[attr] === "object") {
|
|
75
|
+
newObj[attr] = deepClone(obj[attr]);
|
|
76
|
+
} else {
|
|
77
|
+
newObj[attr] = obj[attr];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return newObj;
|
|
81
|
+
}
|
|
82
|
+
function isMobile() {
|
|
83
|
+
if (navigator.userAgent.match(/('phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone')/i)) {
|
|
84
|
+
return true;
|
|
85
|
+
} else {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function handleEmpty(list) {
|
|
90
|
+
const arr = [];
|
|
91
|
+
for (const i in list) {
|
|
92
|
+
const d = [];
|
|
93
|
+
for (const j in list[i]) {
|
|
94
|
+
d.push(list[i][j]);
|
|
95
|
+
}
|
|
96
|
+
const leng = d.filter((item) => item === "").length;
|
|
97
|
+
if (leng !== d.length) {
|
|
98
|
+
arr.push(list[i]);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return arr;
|
|
102
|
+
}
|
|
103
|
+
function handleOpenLink(val) {
|
|
104
|
+
const { origin, pathname } = window.location;
|
|
105
|
+
const router = useRouter();
|
|
106
|
+
router.push(val.path);
|
|
107
|
+
if (verifyUrl(val.meta?.isLink)) window.open(val.meta?.isLink);
|
|
108
|
+
else window.open(`${origin}${pathname}#${val.meta?.isLink}`);
|
|
109
|
+
}
|
|
110
|
+
const other = {
|
|
111
|
+
useTitle: () => {
|
|
112
|
+
useTitle();
|
|
113
|
+
},
|
|
114
|
+
setTagsViewNameI18n(route) {
|
|
115
|
+
return setTagsViewNameI18n(route);
|
|
116
|
+
},
|
|
117
|
+
lazyImg: (el, arr) => {
|
|
118
|
+
lazyImg(el, arr);
|
|
119
|
+
},
|
|
120
|
+
globalComponentSize: () => {
|
|
121
|
+
return globalComponentSize();
|
|
122
|
+
},
|
|
123
|
+
deepClone: (obj) => {
|
|
124
|
+
return deepClone(obj);
|
|
125
|
+
},
|
|
126
|
+
isMobile: () => {
|
|
127
|
+
return isMobile();
|
|
128
|
+
},
|
|
129
|
+
handleEmpty: (list) => {
|
|
130
|
+
return handleEmpty(list);
|
|
131
|
+
},
|
|
132
|
+
handleOpenLink: (val) => {
|
|
133
|
+
handleOpenLink(val);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export { deepClone, other as default, globalComponentSize, handleEmpty, handleOpenLink, isMobile, lazyImg, setTagsViewNameI18n, useTitle };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import Cookies from 'js-cookie';
|
|
2
|
+
import { PUB } from '../const/index.mjs';
|
|
3
|
+
|
|
4
|
+
const Local = {
|
|
5
|
+
// 查看 v2.4.3版本更新日志
|
|
6
|
+
setKey(key) {
|
|
7
|
+
return `${__NEXT_NAME__}:${key}`;
|
|
8
|
+
},
|
|
9
|
+
// 设置永久缓存
|
|
10
|
+
set(key, val) {
|
|
11
|
+
window.localStorage.setItem(Local.setKey(key), JSON.stringify(val));
|
|
12
|
+
},
|
|
13
|
+
// 获取永久缓存
|
|
14
|
+
get(key) {
|
|
15
|
+
let json = window.localStorage.getItem(Local.setKey(key));
|
|
16
|
+
return JSON.parse(json);
|
|
17
|
+
},
|
|
18
|
+
// 移除永久缓存
|
|
19
|
+
remove(key) {
|
|
20
|
+
window.localStorage.removeItem(Local.setKey(key));
|
|
21
|
+
},
|
|
22
|
+
// 移除全部永久缓存
|
|
23
|
+
clear() {
|
|
24
|
+
var tid = Local.get(PUB.tId);
|
|
25
|
+
window.localStorage.clear();
|
|
26
|
+
Local.set(PUB.tId, tid);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const Session = {
|
|
30
|
+
// 设置临时缓存
|
|
31
|
+
set(key, val) {
|
|
32
|
+
if (key === PUB.token) return Cookies.set(key, val);
|
|
33
|
+
window.sessionStorage.setItem(Local.setKey(key), JSON.stringify(val));
|
|
34
|
+
},
|
|
35
|
+
// 获取临时缓存
|
|
36
|
+
get(key) {
|
|
37
|
+
if (key === PUB.token) return Cookies.get(key);
|
|
38
|
+
let json = window.sessionStorage.getItem(Local.setKey(key));
|
|
39
|
+
return JSON.parse(json);
|
|
40
|
+
},
|
|
41
|
+
// 移除临时缓存
|
|
42
|
+
remove(key) {
|
|
43
|
+
if (key === PUB.token) return Cookies.remove(key);
|
|
44
|
+
window.sessionStorage.removeItem(Local.setKey(key));
|
|
45
|
+
},
|
|
46
|
+
// 移除全部临时缓存
|
|
47
|
+
clear() {
|
|
48
|
+
Cookies.remove(PUB.token);
|
|
49
|
+
Cookies.remove(PUB.userInfo);
|
|
50
|
+
Cookies.remove(PUB.constList);
|
|
51
|
+
window.sessionStorage.clear();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { Local, Session };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const setWatermark = (str) => {
|
|
2
|
+
const id = "1.23452384164.123412416";
|
|
3
|
+
if (document.getElementById(id) !== null) document.body.removeChild(document.getElementById(id));
|
|
4
|
+
const can = document.createElement("canvas");
|
|
5
|
+
can.width = 400;
|
|
6
|
+
can.height = 200;
|
|
7
|
+
const cans = can.getContext("2d");
|
|
8
|
+
cans.rotate(-20 * Math.PI / 180);
|
|
9
|
+
cans.font = "12px Vedana";
|
|
10
|
+
cans.fillStyle = "rgba(200, 200, 200, 0.30)";
|
|
11
|
+
cans.textBaseline = "middle";
|
|
12
|
+
cans.fillText(str, can.width / 10, can.height, can.width);
|
|
13
|
+
const div = document.createElement("div");
|
|
14
|
+
div.id = id;
|
|
15
|
+
div.style.pointerEvents = "none";
|
|
16
|
+
div.style.top = "0px";
|
|
17
|
+
div.style.left = "0px";
|
|
18
|
+
div.style.position = "fixed";
|
|
19
|
+
div.style.zIndex = "10000000";
|
|
20
|
+
div.style.width = `${document.documentElement.clientWidth}px`;
|
|
21
|
+
div.style.height = `${document.documentElement.clientHeight}px`;
|
|
22
|
+
div.style.background = `url(${can.toDataURL("image/png")}) left top repeat`;
|
|
23
|
+
document.body.appendChild(div);
|
|
24
|
+
return id;
|
|
25
|
+
};
|
|
26
|
+
const Watermark = {
|
|
27
|
+
// 设置水印
|
|
28
|
+
set: (str) => {
|
|
29
|
+
let id = setWatermark(str);
|
|
30
|
+
if (document.getElementById(id) === null) id = setWatermark(str);
|
|
31
|
+
},
|
|
32
|
+
// 删除水印
|
|
33
|
+
del: () => {
|
|
34
|
+
let id = "1.23452384164.123412416";
|
|
35
|
+
if (document.getElementById(id) !== null) document.body.removeChild(document.getElementById(id));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { Watermark };
|