yxuse 3.0.8 → 3.0.11

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/package.json CHANGED
@@ -1,151 +1,150 @@
1
- {
2
- "name": "yxuse",
3
- "version": "3.0.8",
4
- "private": false,
5
- "keywords": [
6
- "yx"
7
- ],
8
- "scripts": {
9
- "dev": "node ./build/log.ts dev && vite",
10
- "build": "node ./build/log.ts build && vite build --mode production && node ./build/log.ts end",
11
- "preview": "vite preview",
12
- "build-only": "vite build",
13
- "type-check": "vue-tsc --noEmit",
14
- "lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",
15
- "lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"",
16
- "lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
17
- "prepare": "husky install",
18
- "lint:lint-staged": "lint-staged",
19
- "commit": "git pull && git add -A && git-cz && git push",
20
- "tsc": "tsc --noEmit --watch"
21
- },
22
- "files": [
23
- "lib",
24
- "types"
25
- ],
26
- "main": "lib/index.es.js",
27
- "module": "lib/index.es.js",
28
- "types": "types/index.d.ts",
29
- "exports": {
30
- ".": {
31
- "import": "./lib/index.es.js",
32
- "require": "./lib/index.cls.js",
33
- "types": "./types/index.d.ts"
34
- },
35
- "./utils": {
36
- "import": "./lib/utils.es.js",
37
- "require": "./lib/utils.cls.js",
38
- "types": "./types/utils/index.d.ts"
39
- },
40
- "./api": {
41
- "import": "./lib/api.es.js",
42
- "require": "./lib/api.cls.js",
43
- "types": "./types/api/index.d.ts"
44
- },
45
- "./theme": {
46
- "import": "./lib/theme.es.js",
47
- "require": "./lib/theme.cls.js",
48
- "types": "./types/theme/index.d.ts"
49
- },
50
- "./directives": {
51
- "import": "./lib/directives.es.js",
52
- "require": "./lib/directives.cls.js",
53
- "types": "./types/directives/index.d.ts"
54
- },
55
- "./icons": {
56
- "import": "./lib/icons.es.js",
57
- "require": "./lib/icons.cls.js",
58
- "types": "./types/icons/index.d.ts"
59
- },
60
- "./components": {
61
- "import": "./lib/components.es.js",
62
- "require": "./lib/components.cls.js",
63
- "types": "./types/components/index.d.ts"
64
- },
65
- "./style": {
66
- "import": "./lib/style.css",
67
- "require": "./lib/style.css"
68
- }
69
- },
70
- "dependencies": {
71
- "axios": "^1.3.3",
72
- "element-plus": "^2.4.4",
73
- "file-saver": "^2.0.5",
74
- "mqtt": "^4.0.1",
75
- "nprogress": "^0.2.0",
76
- "pinia": "^2.0.30",
77
- "qs": "^6.11.0",
78
- "sortablejs": "^1.15.0",
79
- "vue": "^3.3.9",
80
- "vue-router": "^4.1.6",
81
- "xlsx": "^0.18.5"
82
- },
83
- "devDependencies": {
84
- "@commitlint/cli": "^17.5.1",
85
- "@commitlint/config-conventional": "^17.4.4",
86
- "@rushstack/eslint-patch": "^1.2.0",
87
- "@types/node": "^18.14.0",
88
- "@types/nprogress": "^0.2.0",
89
- "@typescript-eslint/eslint-plugin": "^6.19.0",
90
- "@typescript-eslint/parser": "^6.19.0",
91
- "@vitejs/plugin-vue": "^5.0.2",
92
- "@vitejs/plugin-vue-jsx": "^3.1.0",
93
- "@vue/eslint-config-prettier": "^7.0.0",
94
- "@vue/eslint-config-typescript": "^11.0.2",
95
- "@vue/tsconfig": "^0.1.3",
96
- "autoprefixer": "^10.4.13",
97
- "commitizen": "^4.3.0",
98
- "cssnano": "^5.1.15",
99
- "cz-git": "^1.6.1",
100
- "eslint": "^8.56.0",
101
- "eslint-plugin-vue": "^9.20.1",
102
- "figlet": "^1.6.0",
103
- "husky": "^8.0.3",
104
- "lint-staged": "^13.2.0",
105
- "npm-run-all": "^4.1.5",
106
- "pinia-plugin-persistedstate": "^3.1.0",
107
- "postcss": "^8.4.21",
108
- "postcss-html": "^1.5.0",
109
- "postcss-import": "^15.1.0",
110
- "postcss-nesting": "^11.2.2",
111
- "postcss-preset-env": "^8.4.2",
112
- "postcss-px-to-viewport": "^1.1.1",
113
- "postcss-scss": "^4.0.6",
114
- "prettier": "^2.8.4",
115
- "rollup-plugin-visualizer": "^5.9.2",
116
- "sass": "^1.58.3",
117
- "stylelint": "^15.6.0",
118
- "stylelint-config-html": "^1.1.0",
119
- "stylelint-config-prettier": "^9.0.3",
120
- "stylelint-config-recess-order": "^4.0.0",
121
- "stylelint-config-recommended-scss": "^11.0.0",
122
- "stylelint-config-recommended-vue": "^1.4.0",
123
- "stylelint-config-standard": "^33.0.0",
124
- "stylelint-config-standard-scss": "^9.0.0",
125
- "tailwindcss": "^3.2.7",
126
- "typescript": "~5.3.3",
127
- "unplugin-auto-import": "^0.16.6",
128
- "unplugin-element-plus": "^0.8.0",
129
- "unplugin-vue-components": "^0.25.1",
130
- "vite": "^5.0.10",
131
- "vite-plugin-compression": "^0.5.1",
132
- "vite-plugin-dts": "^3.7.0",
133
- "vite-plugin-remove-console": "^2.1.0",
134
- "vite-plugin-windicss": "^1.9.3",
135
- "vite-svg-loader": "^4.0.0",
136
- "vue-tsc": "^1.1.4"
137
- },
138
- "pnpm": {
139
- "peerDependencyRules": {
140
- "ignoreMissing": [
141
- "rollup",
142
- "webpack"
143
- ]
144
- }
145
- },
146
- "config": {
147
- "commitizen": {
148
- "path": "node_modules/cz-git"
149
- }
150
- }
151
- }
1
+ {
2
+ "name": "yxuse",
3
+ "version": "3.0.11",
4
+ "private": false,
5
+ "keywords": [
6
+ "yx"
7
+ ],
8
+ "scripts": {
9
+ "dev": "node ./build/log.ts dev && vite",
10
+ "build": "node ./build/log.ts build && vite build --mode production && node ./build/log.ts end",
11
+ "preview": "vite preview",
12
+ "build-only": "vite build",
13
+ "type-check": "vue-tsc --noEmit",
14
+ "lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",
15
+ "lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"",
16
+ "lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
17
+ "prepare": "husky install",
18
+ "lint:lint-staged": "lint-staged",
19
+ "commit": "git pull && git add -A && git-cz && git push",
20
+ "tsc": "tsc --noEmit --watch"
21
+ },
22
+ "files": [
23
+ "lib",
24
+ "types"
25
+ ],
26
+ "main": "lib/index.es.js",
27
+ "module": "lib/index.es.js",
28
+ "types": "types/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "import": "./lib/index.es.js",
32
+ "require": "./lib/index.cls.js",
33
+ "types": "./types/index.d.ts"
34
+ },
35
+ "./utils": {
36
+ "import": "./lib/utils.es.js",
37
+ "require": "./lib/utils.cls.js",
38
+ "types": "./types/utils/index.d.ts"
39
+ },
40
+ "./api": {
41
+ "import": "./lib/api.es.js",
42
+ "require": "./lib/api.cls.js",
43
+ "types": "./types/api/index.d.ts"
44
+ },
45
+ "./theme": {
46
+ "import": "./lib/theme.es.js",
47
+ "require": "./lib/theme.cls.js",
48
+ "types": "./types/theme/index.d.ts"
49
+ },
50
+ "./directives": {
51
+ "import": "./lib/directives.es.js",
52
+ "require": "./lib/directives.cls.js",
53
+ "types": "./types/directives/index.d.ts"
54
+ },
55
+ "./icons": {
56
+ "import": "./lib/icons.es.js",
57
+ "require": "./lib/icons.cls.js",
58
+ "types": "./types/icons/index.d.ts"
59
+ },
60
+ "./components": {
61
+ "import": "./lib/components.es.js",
62
+ "require": "./lib/components.cls.js",
63
+ "types": "./types/components/index.d.ts"
64
+ },
65
+ "./style": {
66
+ "import": "./lib/style.css",
67
+ "require": "./lib/style.css"
68
+ }
69
+ },
70
+ "dependencies": {
71
+ "axios": "^1.3.3",
72
+ "element-plus": "^2.4.4",
73
+ "file-saver": "^2.0.5",
74
+ "mqtt": "^4.0.1",
75
+ "nprogress": "^0.2.0",
76
+ "pinia": "^2.0.30",
77
+ "qs": "^6.11.0",
78
+ "sortablejs": "^1.15.0",
79
+ "vue": "^3.3.9",
80
+ "vue-router": "^4.1.6",
81
+ "xlsx": "^0.18.5"
82
+ },
83
+ "devDependencies": {
84
+ "@commitlint/cli": "^17.5.1",
85
+ "@commitlint/config-conventional": "^17.4.4",
86
+ "@rushstack/eslint-patch": "^1.2.0",
87
+ "@types/node": "^18.14.0",
88
+ "@types/nprogress": "^0.2.0",
89
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
90
+ "@typescript-eslint/parser": "^6.19.0",
91
+ "@vitejs/plugin-vue": "^5.0.2",
92
+ "@vitejs/plugin-vue-jsx": "^3.1.0",
93
+ "@vue/eslint-config-prettier": "^7.0.0",
94
+ "@vue/eslint-config-typescript": "^11.0.2",
95
+ "@vue/tsconfig": "^0.1.3",
96
+ "autoprefixer": "^10.4.13",
97
+ "commitizen": "^4.3.0",
98
+ "cssnano": "^5.1.15",
99
+ "cz-git": "^1.6.1",
100
+ "eslint": "^8.56.0",
101
+ "eslint-plugin-vue": "^9.20.1",
102
+ "figlet": "^1.6.0",
103
+ "husky": "^8.0.3",
104
+ "lint-staged": "^13.2.0",
105
+ "npm-run-all": "^4.1.5",
106
+ "pinia-plugin-persistedstate": "^3.1.0",
107
+ "postcss": "^8.4.21",
108
+ "postcss-html": "^1.5.0",
109
+ "postcss-import": "^15.1.0",
110
+ "postcss-nesting": "^11.2.2",
111
+ "postcss-preset-env": "^8.4.2",
112
+ "postcss-px-to-viewport": "^1.1.1",
113
+ "postcss-scss": "^4.0.6",
114
+ "prettier": "^2.8.4",
115
+ "rollup-plugin-visualizer": "^5.9.2",
116
+ "sass": "^1.58.3",
117
+ "stylelint": "^15.6.0",
118
+ "stylelint-config-prettier": "^9.0.3",
119
+ "stylelint-config-recess-order": "^4.0.0",
120
+ "stylelint-config-recommended-scss": "^11.0.0",
121
+ "stylelint-config-recommended-vue": "^1.4.0",
122
+ "stylelint-config-standard": "^33.0.0",
123
+ "stylelint-config-standard-scss": "^9.0.0",
124
+ "tailwindcss": "^3.2.7",
125
+ "typescript": "~5.3.3",
126
+ "unplugin-auto-import": "^0.16.6",
127
+ "unplugin-element-plus": "^0.8.0",
128
+ "unplugin-vue-components": "^0.25.1",
129
+ "vite": "^5.0.10",
130
+ "vite-plugin-compression": "^0.5.1",
131
+ "vite-plugin-dts": "^3.7.0",
132
+ "vite-plugin-remove-console": "^2.1.0",
133
+ "vite-plugin-windicss": "^1.9.3",
134
+ "vite-svg-loader": "^4.0.0",
135
+ "vue-tsc": "^1.1.4"
136
+ },
137
+ "pnpm": {
138
+ "peerDependencyRules": {
139
+ "ignoreMissing": [
140
+ "rollup",
141
+ "webpack"
142
+ ]
143
+ }
144
+ },
145
+ "config": {
146
+ "commitizen": {
147
+ "path": "node_modules/cz-git"
148
+ }
149
+ }
150
+ }
@@ -2,11 +2,12 @@
2
2
  export declare const removeToken: (systemName?: string) => void;
3
3
  /**@description 获取token */
4
4
  export declare const getToken: (systemName?: string) => any;
5
+ interface LoginParams {
6
+ userName: string;
7
+ password: string;
8
+ }
5
9
  /**@description 自动登录 */
6
- export declare const autoLogin: ({ userName, password }: {
7
- userName: any;
8
- password: any;
9
- }, systemName?: string) => Promise<null | undefined>;
10
+ export declare const autoLogin: ({ userName, password }: LoginParams, systemName?: string) => Promise<void>;
10
11
  /**@description 获取用户信息 */
11
12
  export declare const getUserInfo: (systemName?: string) => any;
12
13
  export declare const getUserRouteList: () => Promise<any>;
@@ -15,7 +16,13 @@ export declare const jumpToLogin: () => void;
15
16
  /**@description 自动跳转home */
16
17
  export declare const jumpToHome: () => void;
17
18
  /**获取当前部署的系统前缀 */
18
- export declare const getHomeUrl: () => string;
19
+ export declare const getHomeUrl: () => any;
20
+ /**设置系统配置信息 */
21
+ export declare const setSystemConfig: (config: any) => void;
22
+ /**获取系统配置信息 */
23
+ export declare const getSystemConfig: (key: string) => any;
24
+ /**当前系统环境是否是生产环境 */
25
+ export declare const isProduction: () => boolean;
19
26
  /**
20
27
  *
21
28
  * @param systemName 系统名称
@@ -48,3 +55,4 @@ export declare const getUserRouter: (userMenuList: any, viewModules: any, viewCo
48
55
  * @param routeTag
49
56
  */
50
57
  export declare const getUserIsHaveBtnPower: (routeTag: string) => boolean;
58
+ export {};
@@ -18,6 +18,10 @@ interface ThemeConfig {
18
18
  /** Toolbar的配置 */
19
19
  interface ToolbarConfig {
20
20
  theme: ThemeConfig[];
21
+ /** 是否渲染工单 */
22
+ isRenderIssue?: boolean;
23
+ /** 是否渲染切换语言 */
24
+ isRenderLang?: boolean;
21
25
  }
22
26
  /**
23
27
  * 悬浮球工具
@@ -1 +1,12 @@
1
1
  export declare const ttcFontFamily: string;
2
+ export declare const defaultConfig: {
3
+ loginUrl: string;
4
+ homeUrl: string;
5
+ lang: string;
6
+ themeApiUrl: string;
7
+ loginApiUrl: string;
8
+ translateApiUrl: string;
9
+ environment: string;
10
+ isRenderToolbar: boolean;
11
+ isRenderIssue: boolean;
12
+ };
@@ -1,18 +1,10 @@
1
- interface ThemeDTO {
2
- id: number;
3
- defaultTheme: number;
4
- theme: string;
5
- themeUrl: string;
6
- }
1
+ import type { ThemeDTO, YxuseOptions } from "./type.ts";
7
2
  /**
8
3
  * @description:注册主题下的css变量
9
4
  * @options isRenderToolbar :是否需要渲染Toolbar
10
5
  * @param isJumpLogin :是否在没有token或token过期时自动跳转至登录页
11
6
  */
12
- export declare const install: ({ isRenderToolbar, isJumpLogin }: {
13
- isRenderToolbar?: boolean | undefined;
14
- isJumpLogin?: boolean | undefined;
15
- }) => Promise<void>;
7
+ export declare const install: (config: YxuseOptions) => Promise<void>;
16
8
  /**
17
9
  * @description:修改主题
18
10
  * @param theme 主题
@@ -39,7 +31,12 @@ export declare const getCurThemeCssVar: () => any;
39
31
  * @param groupName 名称
40
32
  */
41
33
  export declare const getGroupColor: (groupName: string) => object;
42
- export {};
34
+ /**
35
+ * @description:判断当前css变量的色值是否在所有主题中
36
+ * @param cssVarName 色值变量
37
+ * @param color 名称
38
+ */
39
+ export declare const findColorByTheme: (cssVarName: string, color: string) => string | null;
43
40
  /**
44
41
  * @description:注册当前系统私有css变量
45
42
  * @param systemName 系统名称
@@ -0,0 +1,28 @@
1
+ export interface ThemeDTO {
2
+ id: number;
3
+ defaultTheme: number;
4
+ theme: string;
5
+ themeUrl: string;
6
+ }
7
+ export interface YxuseOptions {
8
+ /** 是否渲染悬浮球*/
9
+ isRenderToolbar: boolean;
10
+ /** 是否加载工单*/
11
+ isRenderIssue?: boolean;
12
+ /** 是否加载语言切换*/
13
+ isRenderLang?: boolean;
14
+ /** 登录页地址*/
15
+ loginUrl?: string;
16
+ /** 自定义登录api,非运管系统项目使用*/
17
+ loginApiUrl?: string;
18
+ /** 翻译Api地址,非运管系统项目使用*/
19
+ translateApiUrl?: string;
20
+ /** 主题列表接口,非运管系统项目使用*/
21
+ themeApiUrl?: string;
22
+ /** 首页地址*/
23
+ homeUrl?: string;
24
+ /** 系统语言*/
25
+ lang?: string;
26
+ /** 当前环境*/
27
+ environment: "development" | "production";
28
+ }
@@ -30,4 +30,9 @@ export declare const enumToArray: <T extends Record<string, string | number>>(en
30
30
  label: string;
31
31
  value: string | number;
32
32
  }[];
33
+ /**
34
+ * @description 判断该色值是否是深色
35
+ * @param color 色值
36
+ */
37
+ export declare const isDarkColor: (color: string) => boolean | null;
33
38
  export {};