@ftlab/one-vue3 0.3.8-5 → 0.4.0

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +36 -140
  2. package/README.md +143 -61
  3. package/assets/css/index.scss +25 -25
  4. package/assets/css/mixin.scss +142 -142
  5. package/assets/css/public.scss +175 -175
  6. package/assets/img/Germany.png +0 -0
  7. package/components.d.ts +6 -3
  8. package/dist/CheckMessageDialog-DygR717d.js +78 -0
  9. package/dist/FtlEntry.js +109 -0
  10. package/dist/FtlMessage.js +186 -0
  11. package/dist/FtlMultipleChoose-D8o09guU.js +312 -0
  12. package/dist/FtlMultipleChoose.js +1 -0
  13. package/dist/FtlNavbar-SsenWatk.js +191 -0
  14. package/dist/FtlNavbar.js +1 -0
  15. package/dist/FtlPasswordDialog-Dj_vS0mC.js +188 -0
  16. package/dist/FtlPasswordDialog.js +1 -0
  17. package/dist/FtlSidebar-D5AkRjgA.js +159 -0
  18. package/dist/FtlSidebar.js +1 -0
  19. package/dist/_plugin-vue_export-helper-Djzt4Yr7.js +7 -0
  20. package/dist/asyncToGenerator-CENKRPhX.js +26 -0
  21. package/dist/configProvider-CFU3sEdy.js +6 -0
  22. package/dist/ftlOne.js +16 -13
  23. package/dist/langSelect-DdbxrMFQ.js +106 -0
  24. package/dist/objectSpread2-Bpgh6RJW.js +57 -0
  25. package/dist/storage-DBeiC15W.js +25 -0
  26. package/dist/store.js +39 -98
  27. package/dist/style.css +2 -1
  28. package/dist/utils-BuLanift.js +10 -0
  29. package/dist/utils.js +558 -475
  30. package/eslint.config.js +34 -0
  31. package/ftlab-one-vue3-0.4.0.tgz +0 -0
  32. package/global.d.ts +63 -63
  33. package/i18n/cn.json +22 -22
  34. package/i18n/de.json +23 -0
  35. package/i18n/en.json +22 -22
  36. package/i18n/es.json +23 -0
  37. package/i18n/fr.json +22 -22
  38. package/package.json +119 -74
  39. package/vitest.config.ts +8 -0
  40. package/.eslintrc.cjs +0 -24
  41. package/.prettierrc.cjs +0 -18
  42. package/dist/CheckMessageDialog-0f85dbee.js +0 -167
  43. package/dist/index-2284be94.js +0 -15036
  44. package/dist/storage-9f2ae3ed.js +0 -30
  45. package/dist/utils-0eda3e43.js +0 -17
  46. package/dist/vuex.esm-bundler-2a047356.js +0 -770
  47. package/function/index.ts +0 -4
  48. package/function/info.js +0 -17
  49. package/function/permission.js +0 -17
  50. package/store/app.js +0 -24
  51. package/store/auth.js +0 -87
  52. package/store/index.ts +0 -10
package/function/index.ts DELETED
@@ -1,4 +0,0 @@
1
- import * as info from './info';
2
- import * as permission from './permission';
3
-
4
- export { info, permission };
package/function/info.js DELETED
@@ -1,17 +0,0 @@
1
- import axios from 'axios';
2
-
3
- const defaultBaseUrl = 'https://gateway-staging.ftlapp.io';
4
-
5
- export async function getInfoResource(baseUrl, route, callBack) {
6
- if (route.query.token) {
7
- localStorage.setItem('token', route.query.token);
8
- const res = await axios.post(`${baseUrl ? baseUrl : defaultBaseUrl}/api/auth/loginWithToken`, null, {
9
- headers: {
10
- Authorization: route.query.token
11
- }
12
- });
13
- if (callBack) {
14
- callBack(res.data);
15
- }
16
- }
17
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * @param {*} asyncRoutes 需要筛选的路由表
3
- * @param {*} resources auth返回的平铺资源列表
4
- * @returns 返回需要筛选路由存在于平铺资源列表里的路由
5
- */
6
- export function filterAsyncRoutes(asyncRoutes, resources) {
7
- const filterRoutes = [];
8
- asyncRoutes.forEach((asy) => {
9
- if (resources.find((res) => res.name === asy.name)) {
10
- if (asy.children) {
11
- asy.children = filterAsyncRoutes(asy.children, resources);
12
- }
13
- filterRoutes.push(asy);
14
- }
15
- });
16
- return filterRoutes;
17
- }
package/store/app.js DELETED
@@ -1,24 +0,0 @@
1
- import storage from '../utils/storage';
2
-
3
-
4
- export default {
5
- namespaced: true,
6
- state: () => ({
7
- language: storage.get('language') || 'cn'
8
- }),
9
- getters: {
10
- language(state) {
11
- return state.language;
12
- },
13
- },
14
- mutations: {
15
- SET_LANG(state, lang) {
16
- state.language = lang;
17
- },
18
- },
19
- actions: {
20
- setLocalLang({ commit }, data) {
21
- commit("SET_LANG", data);
22
- },
23
- },
24
- }
package/store/auth.js DELETED
@@ -1,87 +0,0 @@
1
- import storage from '../utils/storage';
2
-
3
- const userInfo = storage.getAuth();
4
-
5
- // 同步路由的or翻译为路由name
6
- function translateOrToName(arr) {
7
- return arr.map((item) => {
8
- if (item.children && item.children.length) {
9
- item.children = translateOrToName(item.children);
10
- }
11
- return {
12
- ...item,
13
- or: item.name
14
- };
15
- });
16
- }
17
-
18
- export default {
19
- namespaced: true,
20
- state: () => ({
21
- userInfo: userInfo || {},
22
- username: userInfo.username || "",
23
- owner: userInfo.owner || "",
24
- roles: userInfo.roles || [],
25
- menus: [],
26
- resources: [],
27
- }),
28
- getters: {
29
- auth: (state) => state.userInfo,
30
- },
31
- mutations: {
32
- SET_NAME(state, name) {
33
- state.username = name;
34
- },
35
- SET_OWNER(state, owner) {
36
- state.owner = owner;
37
- },
38
- SET_ROLES(state, roles) {
39
- state.roles = roles;
40
- },
41
- SET_MENUS(state, menus) {
42
- if (!menus.length) {
43
- // 在权限返回为空的时候给menus加一条空数据,防止下次路由进入再次空校验
44
- state.menus.push({});
45
- } else {
46
- state.menus = translateOrToName(menus);
47
- }
48
- },
49
- CLEAR_MENUS(state) {
50
- state.menus = [];
51
- },
52
- SET_RESOURCES(state, resources) {
53
- state.resources = translateOrToName(resources);
54
- },
55
- CLEAR_USERINFO(state) {
56
- state.userInfo = {};
57
- },
58
- },
59
- actions: {
60
- setInfo({ commit }, authInfo) {
61
- if (typeof authInfo === "object") {
62
- commit("SET_NAME", authInfo.username);
63
- commit("SET_OWNER", authInfo.owner);
64
- commit("SET_ROLES", authInfo.roles);
65
- storage.setAuth(authInfo);
66
- storage.setToken(authInfo.token);
67
- }
68
- },
69
- setMenu({ commit }, menu) {
70
- commit("SET_MENUS", menu);
71
- },
72
- setResources({ commit }, resources) {
73
- commit("SET_RESOURCES", resources);
74
- },
75
- logout({ commit }) {
76
- commit("SET_NAME", "");
77
- commit("SET_OWNER", "");
78
- commit("SET_ROLES", []);
79
- commit("SET_RESOURCES", []);
80
- commit("CLEAR_MENUS");
81
- commit("CLEAR_USERINFO");
82
- storage.remove("auth");
83
- storage.remove("token");
84
- },
85
- },
86
-
87
- }
package/store/index.ts DELETED
@@ -1,10 +0,0 @@
1
- import { createStore } from 'vuex'
2
- import app from './app'
3
- import auth from './auth'
4
-
5
- export default createStore({
6
- modules: {
7
- app,
8
- auth
9
- }
10
- })