diff --git a/.env b/.env index 6b20d11..db9e66f 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ # 应用名称 -VITE_APP_TITLE="Vite 模板" +VITE_APP_TITLE="车辆监控中心" # 平台本地运行端口号 VITE_PORT=7000 diff --git a/.prettierrc.js b/.prettierrc.js index 154480d..1bc4c23 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,46 +1,46 @@ -module.exports = { - // (x)=>{},单个参数箭头函数是否显示小括号。(always:始终显示;avoid:省略括号。默认:always) - arrowParens: "always", - // 开始标签的右尖括号是否跟随在最后一行属性末尾,默认false - bracketSameLine: false, - // 对象字面量的括号之间打印空格 (true - Example: { foo: bar } ; false - Example: {foo:bar}) - bracketSpacing: true, - // 是否格式化一些文件中被嵌入的代码片段的风格(auto|off;默认auto) - embeddedLanguageFormatting: "auto", - // 指定 HTML 文件的空格敏感度 (css|strict|ignore;默认css) - htmlWhitespaceSensitivity: "ignore", - // 当文件已经被 Prettier 格式化之后,是否会在文件顶部插入一个特殊的 @format 标记,默认false - insertPragma: false, - // 在 JSX 中使用单引号替代双引号,默认false - jsxSingleQuote: false, - // 每行最多字符数量,超出换行(默认100) - printWidth: 100, - // 超出打印宽度 (always | never | preserve ) - proseWrap: "preserve", - // 对象属性是否使用引号(as-needed | consistent | preserve;默认as-needed:对象的属性需要加引号才添加;) - quoteProps: "as-needed", - // 是否只格式化在文件顶部包含特定注释(@prettier| @format)的文件,默认false - requirePragma: false, - // 结尾添加分号 - semi: true, - // 使用单引号 (true:单引号;false:双引号) - singleQuote: false, - // 缩进空格数,默认2个空格 - tabWidth: 2, - // 元素末尾是否加逗号,默认es5: ES5中的 objects, arrays 等会添加逗号,TypeScript 中的 type 后不加逗号 - trailingComma: "es5", - // 指定缩进方式,空格或tab,默认false,即使用空格 - useTabs: false, - // vue 文件中是否缩进 diff --git a/src/assets/images/bg-header.png b/src/assets/images/bg-header.png new file mode 100644 index 0000000..869b6a0 Binary files /dev/null and b/src/assets/images/bg-header.png differ diff --git a/src/assets/images/bg-middle.png b/src/assets/images/bg-middle.png new file mode 100644 index 0000000..cc0ff8d Binary files /dev/null and b/src/assets/images/bg-middle.png differ diff --git a/src/assets/images/bg-side.png b/src/assets/images/bg-side.png new file mode 100644 index 0000000..1739cdf Binary files /dev/null and b/src/assets/images/bg-side.png differ diff --git a/src/assets/images/bg.png b/src/assets/images/bg.png new file mode 100644 index 0000000..39dffc5 Binary files /dev/null and b/src/assets/images/bg.png differ diff --git a/src/assets/images/footer-39.png b/src/assets/images/footer-39.png new file mode 100644 index 0000000..e3683c8 Binary files /dev/null and b/src/assets/images/footer-39.png differ diff --git a/src/assets/images/footer-rectangle.png b/src/assets/images/footer-rectangle.png new file mode 100644 index 0000000..e2dd2a1 Binary files /dev/null and b/src/assets/images/footer-rectangle.png differ diff --git a/src/assets/images/icon-1.png b/src/assets/images/icon-1.png new file mode 100644 index 0000000..0ba550c Binary files /dev/null and b/src/assets/images/icon-1.png differ diff --git a/src/assets/images/icon-2.png b/src/assets/images/icon-2.png new file mode 100644 index 0000000..57443cf Binary files /dev/null and b/src/assets/images/icon-2.png differ diff --git a/src/assets/images/icon-3.png b/src/assets/images/icon-3.png new file mode 100644 index 0000000..892a88b Binary files /dev/null and b/src/assets/images/icon-3.png differ diff --git a/src/layout/components/AppMain/index.vue b/src/layout/components/AppMain/index.vue new file mode 100644 index 0000000..3d94f54 --- /dev/null +++ b/src/layout/components/AppMain/index.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/src/layout/components/Footer/index.vue b/src/layout/components/Footer/index.vue new file mode 100644 index 0000000..975b54b --- /dev/null +++ b/src/layout/components/Footer/index.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/src/layout/components/NavBar/index.vue b/src/layout/components/NavBar/index.vue new file mode 100644 index 0000000..e257420 --- /dev/null +++ b/src/layout/components/NavBar/index.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/src/layout/index.vue b/src/layout/index.vue index 1e544d7..6a25821 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,26 +1,22 @@ - + - + diff --git a/src/views/error-page/404.vue b/src/views/error-page/404.vue index f8e1007..8494b71 100644 --- a/src/views/error-page/404.vue +++ b/src/views/error-page/404.vue @@ -1,232 +1,237 @@ diff --git a/src/views/redirect/index.vue b/src/views/redirect/index.vue index 56f37a6..9951b21 100644 --- a/src/views/redirect/index.vue +++ b/src/views/redirect/index.vue @@ -1,9 +1,9 @@ diff --git a/uno.config.ts b/uno.config.ts index 5e8798b..2ba0311 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -1,33 +1,36 @@ import { - defineConfig, - presetAttributify, - presetIcons, - presetTypography, - presetUno, - presetWebFonts, - transformerDirectives, - transformerVariantGroup, -} from 'unocss'; + defineConfig, + presetAttributify, + presetIcons, + presetTypography, + presetUno, + presetWebFonts, + transformerDirectives, + transformerVariantGroup, +} from "unocss"; export default defineConfig({ - shortcuts: [ - // ... - ], - theme: { - colors: { - // ... - }, - }, - presets: [ - presetUno(), - presetAttributify(), - presetIcons(), - presetTypography(), - presetWebFonts({ - fonts: { - // ... - }, - }), - ], - transformers: [transformerDirectives(), transformerVariantGroup()], + shortcuts: { + "flex-center": "flex justify-center items-center", + "flex-x-between": "flex items-center justify-between", + "flex-x-around": "flex items-center justify-around", + "flex-y-center": "flex flex-col flex-wrap justify-center items-center", + }, + theme: { + colors: { + // ... + }, + }, + presets: [ + presetUno(), + presetAttributify(), + presetIcons(), + presetTypography(), + presetWebFonts({ + fonts: { + // ... + }, + }), + ], + transformers: [transformerDirectives(), transformerVariantGroup()], }); diff --git a/vite.config.ts b/vite.config.ts index 5d49c98..893cdab 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,33 +1,57 @@ -import { defineConfig } from 'vite'; -import { plugins } from './build/plugins'; -import { resolve } from './build/resolve'; -import { buildEnv } from './build/buildEnv'; -import { define } from './build/define'; -import { root, wrapperEnv } from './build/utils'; -import { server } from './build/server'; -import { exclude, include } from './build/optimize'; +import { defineConfig } from "vite"; +import { plugins } from "./build/plugins"; +import { resolve } from "./build/resolve"; +import { buildEnv } from "./build/buildEnv"; +import { define } from "./build/define"; +import { root, wrapperEnv } from "./build/utils"; +import { server } from "./build/server"; +import { exclude, include } from "./build/optimize"; +import postCssPxToViewport8plugin from "postcss-px-to-viewport-8-plugin"; // https://vite.dev/config/ export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => { - const env = wrapperEnv(mode, 'VITE'); + const env = wrapperEnv(mode, "VITE"); - return { - root, - base: env.VITE_PUBLIC_PATH, - define: define(), - plugins: plugins(mode), - resolve: resolve(), - esbuild: { - jsxFactory: 'h', - jsxFragment: 'Fragment', - jsxInject: "import { h } from 'vue';", - }, - logLevel: 'info', - // 设为 false 可以避免 Vite 清屏而错过在终端中打印某些关键信息 - clearScreen: false, - build: buildEnv(), - server: server(mode), - preview: server(mode), - optimizeDeps: { include, exclude }, - }; + return { + root, + base: env.VITE_PUBLIC_PATH, + define: define(), + plugins: plugins(mode), + resolve: resolve(), + esbuild: { + jsxFactory: "h", + jsxFragment: "Fragment", + jsxInject: "import { h } from 'vue';", + }, + css: { + postcss: { + plugins: [ + postCssPxToViewport8plugin({ + unitToConvert: "px", + viewportWidth: 1920, // 设计稿的宽度 + unitPrecision: 5, // 单位转换后保留的精度 + propList: ["*"], // 能转化为vw的属性列表 + viewportUnit: "vw", // 希望使用的视口单位 + fontViewportUnit: "vw", // 字体使用的视口单位 + selectorBlackList: [], // 需要忽略的CSS选择器,不会转为视口单位,使用原有的px等单位。 + minPixelValue: 1, // 设置最小的转换数值,如果为1的话,只有大于1的值会被转换 + mediaQuery: true, // 媒体查询里的单位是否需要转换单位 + replace: true, // 是否直接更换属性值,而不添加备用属性 + exclude: [/node_modules/], // 忽略某些文件夹下的文件或特定文件,例如 'node_modules' 下的文件 + include: [], // 如果设置了include,那将只有匹配到的文件才会被转换 + landscape: false, // 是否添加根据 landscapeWidth 生成的媒体查询条件 @media (orientation: landscape) + landscapeUnit: "vw", // 横屏时使用的单位 + landscapeWidth: 1024, // 横屏时使用的视口宽度 + }), + ], + }, + }, + logLevel: "info", + // 设为 false 可以避免 Vite 清屏而错过在终端中打印某些关键信息 + clearScreen: false, + build: buildEnv(), + server: server(mode), + preview: server(mode), + optimizeDeps: { include, exclude }, + }; });