dlzn-ui 1.28.0 → 1.30.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.
@@ -0,0 +1,135 @@
1
+ <style>
2
+ @keyframes landing_slide {
3
+ 0% {
4
+ transform: translate(0, 0);
5
+ }
6
+ 2% {
7
+ transform: translate(33px, 0);
8
+ }
9
+ 12.5% {
10
+ transform: translate(33px, 0);
11
+ }
12
+ 15.5% {
13
+ transform: translate(66px, 0);
14
+ }
15
+ 25% {
16
+ transform: translate(66px, 0);
17
+ }
18
+ 27% {
19
+ transform: translate(66px, 33px);
20
+ }
21
+ 37.5% {
22
+ transform: translate(66px, 33px);
23
+ }
24
+ 39.5% {
25
+ transform: translate(33px, 33px);
26
+ }
27
+ 50% {
28
+ transform: translate(33px, 33px);
29
+ }
30
+ 52% {
31
+ transform: translate(33px, 66px);
32
+ }
33
+ 62.5% {
34
+ transform: translate(33px, 66px);
35
+ }
36
+ 64.5% {
37
+ transform: translate(0, 66px);
38
+ }
39
+ 75% {
40
+ transform: translate(0, 66px);
41
+ }
42
+ 77% {
43
+ transform: translate(0, 33px);
44
+ }
45
+ 87.5% {
46
+ transform: translate(0, 33px);
47
+ }
48
+ 89.5% {
49
+ transform: translate(0, 0);
50
+ }
51
+ 100% {
52
+ transform: translate(0, 0);
53
+ }
54
+ }
55
+ @keyframes landing_gradient1 {
56
+ from {
57
+ stop-color: #4383b8;
58
+ }
59
+ 50% {
60
+ stop-color: #8013b9;
61
+ }
62
+ to {
63
+ stop-color: #4383b8;
64
+ }
65
+ }
66
+ @keyframes landing_gradient2 {
67
+ from {
68
+ stop-color: #002a52;
69
+ }
70
+ 50% {
71
+ stop-color: #b22358;
72
+ }
73
+ to {
74
+ stop-color: #f2f3ff;
75
+ }
76
+ }
77
+ #landing svg #gradient > stop[offset='0%'] {
78
+ animation: landing_gradient1 15s ease 0s infinite;
79
+ }
80
+ #landing svg #gradient > stop[offset='100%'] {
81
+ animation: landing_gradient2 15s ease 0s infinite;
82
+ }
83
+ #landing svg .rect {
84
+ animation: landing_slide 15s ease infinite;
85
+ }
86
+ #landing svg #rect1 {
87
+ animation-delay: 0s;
88
+ }
89
+ #landing svg #rect2 {
90
+ animation-delay: -2.1428571428571s;
91
+ }
92
+ #landing svg #rect3 {
93
+ animation-delay: -4.2857142857143s;
94
+ }
95
+ #landing svg #rect4 {
96
+ animation-delay: -6.4285714285714s;
97
+ }
98
+ #landing svg #rect5 {
99
+ animation-delay: -8.5714285714286s;
100
+ }
101
+ #landing svg #rect6 {
102
+ animation-delay: -10.714285714286s;
103
+ }
104
+ #landing svg #rect7 {
105
+ animation-delay: -12.857142857143s;
106
+ }
107
+ </style>
108
+ <svg class="landing_ele" viewBox="0 0 100 80">
109
+ <defs>
110
+ <linearGradient id="gradient" x1="100%" y1="0%" x2="0%" y2="100%">
111
+ <stop offset="0%" stop-color="#f2f3ff" />
112
+ <stop offset="100%" stop-color="#002a52" />
113
+ </linearGradient>
114
+
115
+ <clipPath id="rects">
116
+ <rect class="rect" id="rect1" x="0" y="0" width="30" height="30" rx="2" ry="2" />
117
+ <rect class="rect" id="rect2" x="0" y="0" width="30" height="30" rx="2" ry="2" />
118
+ <rect class="rect" id="rect3" x="0" y="0" width="30" height="30" rx="2" ry="2" />
119
+ <rect class="rect" id="rect4" x="0" y="0" width="30" height="30" rx="2" ry="2" />
120
+ <rect class="rect" id="rect5" x="0" y="0" width="30" height="30" rx="2" ry="2" />
121
+ <rect class="rect" id="rect6" x="0" y="0" width="30" height="30" rx="2" ry="2" />
122
+ <rect class="rect" id="rect7" x="0" y="0" width="30" height="30" rx="2" ry="2" />
123
+ </clipPath>
124
+ </defs>
125
+ <rect
126
+ id="container"
127
+ transform="translate(50) scale(0.707, 0.707) rotate(45)"
128
+ x="0"
129
+ y="0"
130
+ width="100"
131
+ height="100"
132
+ fill="url(#gradient)"
133
+ clip-path="url(#rects)"
134
+ ></rect>
135
+ </svg>
@@ -0,0 +1,58 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" href="/favicon.ico" />
6
+ <meta
7
+ name="viewport"
8
+ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
9
+ />
10
+ <title><%- title %></title>
11
+ <style>
12
+ html,
13
+ body,
14
+ #app {
15
+ height: 100%;
16
+ margin: 0;
17
+ }
18
+ </style>
19
+ </head>
20
+ <body>
21
+ <div id="app" class="relative"></div>
22
+ <div id="landing">
23
+ <style>
24
+ :root {
25
+ --landing-ele-size: clamp(60px, 8vw, 240px);
26
+ }
27
+ body {
28
+ margin: 0;
29
+ }
30
+ #landing {
31
+ position: fixed;
32
+ width: 100%;
33
+ height: 100%;
34
+ background: #fff;
35
+ z-index: calc(Infinity);
36
+ display: flex;
37
+ justify-content: center;
38
+ align-items: center;
39
+ top: 0;
40
+ left: 0;
41
+ flex-direction: column;
42
+ transition: opacity 1s ease-in-out;
43
+ font-size: clamp(12px, 0.9vw, 24px);
44
+ }
45
+ #landing .landing_ele {
46
+ width: var(--landing-ele-size);
47
+ margin-bottom: 2vw;
48
+ position: relative;
49
+ }
50
+ </style>
51
+ <% if (appId === '1') { %> <%- include('slide-puzzle.ejs') %> <% } %>
52
+ <div style="font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif">
53
+ 正在加载系统资源,请耐心等待
54
+ </div>
55
+ </div>
56
+ <script type="module" src="/src/main.<%- mode %>.ts"></script>
57
+ </body>
58
+ </html>
@@ -178,7 +178,7 @@ var eslintConfig = await antfu({
178
178
  "vue/singleline-html-element-content-newline": "off"
179
179
  } }
180
180
  }, { rules: {
181
- "e18e/ban-dependencies": ["error", { allowed: ["crypto-js"] }],
181
+ "e18e/ban-dependencies": ["error", { allowed: ["crypto-js", "lodash-es"] }],
182
182
  "no-console": "off"
183
183
  } }).override(perfectionistConfig[0].name, { rules: {
184
184
  ...perfectionist$1.configs["recommended-natural"].rules,
@@ -1,4 +1,4 @@
1
- import { resolveOne } from "./utils/index.mjs";
1
+ import { resolveOneFromSelf } from "./utils/index.mjs";
2
2
  //#region node/prettier-config.ts
3
3
  var prettier_config_default = {
4
4
  $schema: "https://json.schemastore.org/prettierrc",
@@ -19,7 +19,7 @@ var prettier_config_default = {
19
19
  singleAttributePerLine: false,
20
20
  singleQuote: true,
21
21
  tabWidth: 2,
22
- tailwindStylesheet: resolveOne(import.meta.url, ["../assets/css/tailwindcss-entry.css", "../src/assets/css/tailwindcss-entry.css"]),
22
+ tailwindStylesheet: resolveOneFromSelf(import.meta.url, ["../assets/css/tailwindcss-entry.css", "../src/assets/css/tailwindcss-entry.css"]),
23
23
  trailingComma: "all",
24
24
  useTabs: false,
25
25
  vueIndentScriptAndStyle: false
@@ -1 +1,2 @@
1
- export declare function resolveOne(metaUrl: string, paths: string[]): string;
1
+ export declare function needPort(target: string): boolean;
2
+ export declare function resolveOneFromSelf(metaUrl: string, paths: string[]): string;
@@ -2,12 +2,15 @@ import { existsSync } from "node:fs";
2
2
  import { dirname, resolve } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  //#region node/utils/index.ts
5
- function resolveOne(metaUrl, paths) {
5
+ function needPort(target) {
6
+ return target.startsWith("http://192.");
7
+ }
8
+ function resolveOneFromSelf(metaUrl, paths) {
6
9
  const here = dirname(fileURLToPath(metaUrl));
7
10
  const arr = paths.map((path) => resolve(here, path));
8
11
  const result = arr.findIndex((file) => existsSync(file));
9
- if (result === -1) throw new Error(`${here}:resolveOne: path not found: ${paths.join(", ")}`);
12
+ if (result === -1) throw new Error(`${here}:resolveOneFromSelf: path not found: ${paths.join(", ")}`);
10
13
  return arr[result];
11
14
  }
12
15
  //#endregion
13
- export { resolveOne };
16
+ export { needPort, resolveOneFromSelf };
@@ -1,8 +1,7 @@
1
1
  import { ConfigEnv, UserConfig } from 'vite';
2
- import { default as tailwindAutoReference } from 'vite-plugin-vue-tailwind-auto-reference';
3
- interface DlznViteOptions {
4
- tailwindAutoReferenceParameters?: TailwindAutoReferenceParameters;
2
+ interface Options {
3
+ root: string;
5
4
  }
6
- type TailwindAutoReferenceParameters = Parameters<typeof tailwindAutoReference>;
7
- declare const _default: (_env: ConfigEnv, options: DlznViteOptions) => UserConfig;
5
+ export declare function commonConfig(_env: ConfigEnv): UserConfig;
6
+ declare const _default: (_env: ConfigEnv, options: Options) => UserConfig;
8
7
  export default _default;
@@ -1,14 +1,153 @@
1
- import { resolveOne } from "./utils/index.mjs";
1
+ import { needPort } from "./utils/index.mjs";
2
+ import { posix, resolve } from "node:path";
2
3
  import tailwindcss from "@tailwindcss/vite";
3
4
  import vue from "@vitejs/plugin-vue";
5
+ import browserslist from "browserslist";
6
+ import { browserslistToTargets } from "lightningcss";
7
+ import { loadEnv, mergeConfig } from "vite";
8
+ import { parseLoadedEnv } from "vite-plugin-env-parse";
9
+ import { createHtmlPlugin } from "vite-plugin-html";
4
10
  import tailwindAutoReference from "vite-plugin-vue-tailwind-auto-reference";
5
11
  //#region node/vite-config.ts
12
+ function commonConfig(_env) {
13
+ return {
14
+ clearScreen: false,
15
+ plugins: [vue({}), tailwindcss()]
16
+ };
17
+ }
18
+ function bypass(req, res, options) {
19
+ if (req.url !== void 0 && options.rewrite !== void 0 && typeof options.target === "string" && res !== void 0) {
20
+ const reqUrl = req.url;
21
+ const proxyUrl = new URL(options.rewrite(reqUrl), options.target).href;
22
+ res.setHeader("X-Res-ProxyUrl", proxyUrl);
23
+ }
24
+ }
6
25
  var vite_config_default = (_env, options) => {
7
- return { plugins: [
8
- vue({}),
9
- tailwindAutoReference(options.tailwindAutoReferenceParameters?.[0] ?? resolveOne(import.meta.url, ["../assets/css/tailwindcss-entry.css", "../src/assets/css/tailwindcss-entry.css"]), options.tailwindAutoReferenceParameters?.[1]),
10
- tailwindcss()
11
- ] };
26
+ const { command, mode } = _env;
27
+ const { root } = options;
28
+ const resolvePath = (p) => resolve(root, p);
29
+ const envDir = resolvePath("build/env");
30
+ const { VITE_API_PROXY_PORT_ARRAY, VITE_APP_ID, VITE_APP_NAME = "", VITE_BASE_URL = "/", VITE_FORCE_PWD_CHANGE = true, VITE_PROXY_TARGET: viteProxyTarget, VITE_USE_LOGIN_CAPTCHA = true } = parseLoadedEnv(loadEnv(mode, envDir));
31
+ const VITE_PROXY_TARGET = Array.isArray(viteProxyTarget) ? viteProxyTarget : [viteProxyTarget];
32
+ console.log({
33
+ command,
34
+ mode,
35
+ VITE_API_PROXY_PORT_ARRAY,
36
+ VITE_APP_ID,
37
+ VITE_APP_NAME,
38
+ VITE_BASE_URL,
39
+ VITE_FORCE_PWD_CHANGE,
40
+ VITE_PROXY_TARGET,
41
+ VITE_USE_LOGIN_CAPTCHA
42
+ });
43
+ const isProduction = mode === "production";
44
+ const getProxyTarget = (index, port) => {
45
+ const target = VITE_PROXY_TARGET.length > 1 ? VITE_PROXY_TARGET[index] : VITE_PROXY_TARGET[0];
46
+ return needPort(target) ? `${target}:${port}` : target;
47
+ };
48
+ return mergeConfig(commonConfig(_env), {
49
+ build: { rolldownOptions: { output: { minify: {
50
+ codegen: true,
51
+ compress: { dropConsole: true },
52
+ mangle: true
53
+ } } } },
54
+ css: {
55
+ lightningcss: { targets: browserslistToTargets(browserslist(">= 0.25%")) },
56
+ transformer: "lightningcss"
57
+ },
58
+ define: {
59
+ VITE_API_PREFIX_ARRAY: JSON.stringify(VITE_API_PROXY_PORT_ARRAY.map(([prefix]) => prefix)),
60
+ VITE_APP_ID: JSON.stringify(VITE_APP_ID),
61
+ VITE_APP_NAME: JSON.stringify(VITE_APP_NAME),
62
+ VITE_BASE_URL: JSON.stringify(VITE_BASE_URL),
63
+ VITE_FORCE_PWD_CHANGE: JSON.stringify(VITE_FORCE_PWD_CHANGE),
64
+ VITE_USE_LOGIN_CAPTCHA: JSON.stringify(VITE_USE_LOGIN_CAPTCHA)
65
+ },
66
+ optimizeDeps: { include: [
67
+ "tdesign-vue-next/dist/tdesign.min.js",
68
+ "path-browserify",
69
+ "lodash-es",
70
+ "pinia-plugin-persistedstate",
71
+ "alova",
72
+ "alova/fetch",
73
+ "alova/vue",
74
+ "@iconify/vue",
75
+ "@formkit/auto-animate",
76
+ "@formkit/auto-animate/vue",
77
+ "dayjs",
78
+ "dayjs/plugin/customParseFormat.js",
79
+ "dayjs/plugin/isSameOrBefore.js",
80
+ "dayjs/plugin/timezone.js",
81
+ "dayjs/plugin/utc.js",
82
+ "wordcloud",
83
+ "echarts/charts",
84
+ "echarts/components",
85
+ "echarts/core",
86
+ "echarts/renderers",
87
+ "@tdesign-vue-next/chat",
88
+ "vue-echarts",
89
+ "dompurify",
90
+ "cron-parser",
91
+ "cronstrue",
92
+ "cronstrue/locales/zh_CN",
93
+ "quartzcron",
94
+ "@bprogress/core",
95
+ "element-plus",
96
+ "element-plus/es/components/config-provider/style/css",
97
+ "element-plus/es/locale/lang/zh-cn",
98
+ "element-plus/es/components/date-picker/style/css",
99
+ "element-plus/es/components/scrollbar/style/css",
100
+ "color",
101
+ "dlzn-ui"
102
+ ] },
103
+ plugins: [createHtmlPlugin({
104
+ inject: {
105
+ data: {
106
+ appId: VITE_APP_ID,
107
+ mode: isProduction ? "prod" : "dev",
108
+ title: VITE_APP_NAME
109
+ },
110
+ ejsOptions: { views: [resolvePath("node_modules/dlzn-ui/build/ejs")] }
111
+ },
112
+ minify: true,
113
+ template: resolvePath("node_modules/dlzn-ui/build/index.html")
114
+ }), tailwindAutoReference(resolvePath("node_modules/dlzn-ui/assets/css/tailwindcss-entry.css"))],
115
+ resolve: {
116
+ alias: [
117
+ {
118
+ find: "@",
119
+ replacement: resolvePath("src")
120
+ },
121
+ {
122
+ find: "img",
123
+ replacement: resolvePath("src/assets/images")
124
+ },
125
+ ...isProduction ? [] : [{
126
+ find: /^.*tdesign-vue-next[/\\]es[/\\].*\.css$/,
127
+ replacement: resolvePath("src/plugins/tdesign-vue-next-for-dev/empty.css")
128
+ }]
129
+ ],
130
+ extensions: [
131
+ ".ts",
132
+ ".mjs",
133
+ ".js"
134
+ ]
135
+ },
136
+ server: {
137
+ host: "0.0.0.0",
138
+ open: false,
139
+ port: VITE_API_PROXY_PORT_ARRAY[0][1] + 1e3,
140
+ proxy: Object.fromEntries(VITE_API_PROXY_PORT_ARRAY.map(([prefix, port], index) => [`${posix.join(VITE_BASE_URL, prefix)}/`, {
141
+ bypass,
142
+ changeOrigin: true,
143
+ rewrite: (p) => {
144
+ return VITE_BASE_URL === "/" ? p : p.replace(new RegExp(VITE_BASE_URL), "");
145
+ },
146
+ target: getProxyTarget(index, port)
147
+ }])),
148
+ strictPort: true
149
+ }
150
+ });
12
151
  };
13
152
  //#endregion
14
- export { vite_config_default as default };
153
+ export { commonConfig, vite_config_default as default };
package/package.json CHANGED
@@ -48,6 +48,7 @@
48
48
  "@types/node": "^26.1.2",
49
49
  "@vitejs/plugin-vue": "^6.0.8",
50
50
  "@vue/tsconfig": "^0.9.1",
51
+ "browserslist": "^4.28.8",
51
52
  "eslint": "^10.8.1",
52
53
  "eslint-config-prettier": "^10.1.8",
53
54
  "eslint-plugin-format": "^2.0.1",
@@ -67,6 +68,8 @@
67
68
  "tdesign-vue-next": "^1.20.5",
68
69
  "typescript": "^6.0.3",
69
70
  "vite": "^8.2.0",
71
+ "vite-plugin-env-parse": "^1.0.15",
72
+ "vite-plugin-html": "^3.2.2",
70
73
  "vite-plugin-vue-tailwind-auto-reference": "^2.0.2",
71
74
  "vue": "^3.5.41",
72
75
  "vue-tsc": "^3.3.9"
@@ -75,6 +78,6 @@
75
78
  "**/*.css"
76
79
  ],
77
80
  "type": "module",
78
- "version": "1.28.0",
81
+ "version": "1.30.0",
79
82
  "scripts": {}
80
83
  }