Compare commits

..

No commits in common. "83803e72f91b82160c5bdb41455e67472ceb5b82" and "268a0375a84607144c735851e3a9a54bfb2866d4" have entirely different histories.

8 changed files with 52 additions and 99 deletions

View File

@ -2,61 +2,61 @@
module.exports = { module.exports = {
root: true, root: true,
defaultSeverity: 'error', defaultSeverity: "error",
plugins: ['stylelint-order', 'stylelint-scss'], plugins: ["stylelint-order", "stylelint-less"],
/* 继承某些已有的规则 */ /* 继承某些已有的规则 */
extends: [ extends: [
'stylelint-config-standard', // 配置stylelint拓展插件 "stylelint-config-standard", // 配置stylelint拓展插件
'stylelint-config-html/html', // the shareable html config for Stylelint. "stylelint-config-html/html", // the shareable html config for Stylelint.
'stylelint-config-html/vue', // 配置 vue 中 template 样式格式化 "stylelint-config-html/vue", // 配置 vue 中 template 样式格式化
'stylelint-config-recess-order', // 配置stylelint css属性书写顺序插件, "stylelint-config-recess-order", // 配置stylelint css属性书写顺序插件,
'stylelint-config-prettier', // 配置stylelint和prettier兼容 "stylelint-config-prettier" // 配置stylelint和prettier兼容
], ],
overrides: [ overrides: [
// 扫描 .vue/html 文件中的<style>标签内的样式 // 扫描 .vue/html 文件中的<style>标签内的样式
{ {
files: ['**/*.{vue,html}'], files: ["**/*.{vue,html}"],
customSyntax: 'postcss-html', customSyntax: "postcss-html",
rules: { rules: {
// 禁止未知的伪类选择器 // 禁止未知的伪类选择器
'selector-pseudo-class-no-unknown': [true, { ignorePseudoClasses: ['deep', 'global'] }], "selector-pseudo-class-no-unknown": [true, { ignorePseudoClasses: ["deep", "global"] }],
// 禁止未知的伪元素选择器 // 禁止未知的伪元素选择器
'selector-pseudo-element-no-unknown': [true, { ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted'] }], "selector-pseudo-element-no-unknown": [true, { ignorePseudoElements: ["v-deep", "v-global", "v-slotted"] }]
}, }
}, },
{ {
files: ['*.less', '**/*.less', '*.scss', '**/*.scss'], files: ["*.less", "**/*.less"],
customSyntax: 'postcss-less', customSyntax: "postcss-less",
rules: { rules: {
'less/color-no-invalid-hex': true, "less/color-no-invalid-hex": true,
'less/no-duplicate-variables': true, "less/no-duplicate-variables": true
}, }
}, }
], ],
/** /**
* null => 关闭该规则 * null => 关闭该规则
*/ */
rules: { rules: {
'value-keyword-case': null, // 在 css 中使用 v-bind不报错 "value-keyword-case": null, // 在 css 中使用 v-bind不报错
'no-descending-specificity': null, // 禁止在具有较高优先级的选择器后出现被其覆盖的较低优先级的选择器 "no-descending-specificity": null, // 禁止在具有较高优先级的选择器后出现被其覆盖的较低优先级的选择器
'function-url-quotes': 'always', // 要求或禁止 URL 的引号 "always(必须加上引号)"|"never(没有引号)" "function-url-quotes": "always", // 要求或禁止 URL 的引号 "always(必须加上引号)"|"never(没有引号)"
'string-quotes': 'double', // 指定字符串使用单引号或双引号 "string-quotes": "double", // 指定字符串使用单引号或双引号
'unit-case': null, // 指定单位的大小写 "lower(全小写)"|"upper(全大写)" "unit-case": null, // 指定单位的大小写 "lower(全小写)"|"upper(全大写)"
'color-hex-case': 'lower', // 指定 16 进制颜色的大小写 "lower(全小写)"|"upper(全大写)" "color-hex-case": "lower", // 指定 16 进制颜色的大小写 "lower(全小写)"|"upper(全大写)"
'color-hex-length': 'long', // 指定 16 进制颜色的简写或扩写 "short(16进制简写)"|"long(16进制扩写)" "color-hex-length": "long", // 指定 16 进制颜色的简写或扩写 "short(16进制简写)"|"long(16进制扩写)"
'rule-empty-line-before': 'never', // 要求或禁止在规则之前的空行 "always(规则之前必须始终有一个空行)"|"never(规则前绝不能有空行)"|"always-multi-line(多行规则之前必须始终有一个空行)"|"never-multi-line(多行规则之前绝不能有空行。)" "rule-empty-line-before": "never", // 要求或禁止在规则之前的空行 "always(规则之前必须始终有一个空行)"|"never(规则前绝不能有空行)"|"always-multi-line(多行规则之前必须始终有一个空行)"|"never-multi-line(多行规则之前绝不能有空行。)"
'font-family-no-missing-generic-family-keyword': null, // 禁止在字体族名称列表中缺少通用字体族关键字 "font-family-no-missing-generic-family-keyword": null, // 禁止在字体族名称列表中缺少通用字体族关键字
'block-opening-brace-space-before': 'always', // 要求在块的开大括号之前必须有一个空格或不能有空白符 "always(大括号前必须始终有一个空格)"|"never(左大括号之前绝不能有空格)"|"always-single-line(在单行块中的左大括号之前必须始终有一个空格)"|"never-single-line(在单行块中的左大括号之前绝不能有空格)"|"always-multi-line(在多行块中,左大括号之前必须始终有一个空格)"|"never-multi-line(多行块中的左大括号之前绝不能有空格)" "block-opening-brace-space-before": "always", // 要求在块的开大括号之前必须有一个空格或不能有空白符 "always(大括号前必须始终有一个空格)"|"never(左大括号之前绝不能有空格)"|"always-single-line(在单行块中的左大括号之前必须始终有一个空格)"|"never-single-line(在单行块中的左大括号之前绝不能有空格)"|"always-multi-line(在多行块中,左大括号之前必须始终有一个空格)"|"never-multi-line(多行块中的左大括号之前绝不能有空格)"
'property-no-unknown': null, // 禁止未知的属性(true 为不允许) "property-no-unknown": null, // 禁止未知的属性(true 为不允许)
'no-empty-source': null, // 禁止空源码 "no-empty-source": null, // 禁止空源码
'declaration-block-trailing-semicolon': null, // 要求或不允许在声明块中使用尾随分号 string"always(必须始终有一个尾随分号)"|"never(不得有尾随分号)" "declaration-block-trailing-semicolon": null, // 要求或不允许在声明块中使用尾随分号 string"always(必须始终有一个尾随分号)"|"never(不得有尾随分号)"
'selector-class-pattern': null, // 强制选择器类名的格式 "selector-class-pattern": null, // 强制选择器类名的格式
'value-no-vendor-prefix': null, // 关闭 vendor-prefix(为了解决多行省略 -webkit-box) "value-no-vendor-prefix": null, // 关闭 vendor-prefix(为了解决多行省略 -webkit-box)
'selector-pseudo-class-no-unknown': [ "selector-pseudo-class-no-unknown": [
true, true,
{ {
ignorePseudoClasses: ['global', 'v-deep', 'deep'], ignorePseudoClasses: ["global", "v-deep", "deep"]
}, }
], ]
}, }
}; };

View File

@ -2,7 +2,7 @@ module.exports = {
'*.{js,jsx,ts,tsx}': ['eslint --fix --no-ignore', 'prettier --write'], '*.{js,jsx,ts,tsx}': ['eslint --fix --no-ignore', 'prettier --write'],
'{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'], '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'],
'package.json': ['prettier --write'], 'package.json': ['prettier --write'],
'*.vue': ['eslint --fix --no-ignore', 'prettier --write'], '*.vue': ['eslint --fix --no-ignore', 'prettier --write', 'stylelint --fix'],
'*.{scss,less,styl,html}': ['prettier --write', 'eslint --fix --no-ignore'], // 'stylelint --fix', '*.{scss,less,styl,html}': ['stylelint --fix --no-ignore', 'prettier --write'],
'*.md': ['prettier --write'], '*.md': ['prettier --write'],
}; };

42
package-lock.json generated
View File

@ -20,7 +20,6 @@
"mitt": "^3.0.1", "mitt": "^3.0.1",
"moment": "^2.30.1", "moment": "^2.30.1",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"stylelint-scss": "^6.3.0",
"uuid": "^9.0.1", "uuid": "^9.0.1",
"vue": "^3.4.21", "vue": "^3.4.21",
"vue-cookies": "^1.8.3", "vue-cookies": "^1.8.3",
@ -6926,6 +6925,7 @@
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmmirror.com/cssesc/-/cssesc-3.0.0.tgz", "resolved": "https://registry.npmmirror.com/cssesc/-/cssesc-3.0.0.tgz",
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
"dev": true,
"bin": { "bin": {
"cssesc": "bin/cssesc" "cssesc": "bin/cssesc"
}, },
@ -10062,11 +10062,6 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/known-css-properties": {
"version": "0.30.0",
"resolved": "https://registry.npmmirror.com/known-css-properties/-/known-css-properties-0.30.0.tgz",
"integrity": "sha512-VSWXYUnsPu9+WYKkfmJyLKtIvaRJi1kXUqVmBACORXZQxT5oZDsoZ2vQP+bQFDnWtpI/4eq3MLoRMjI2fnLzTQ=="
},
"node_modules/launch-editor": { "node_modules/launch-editor": {
"version": "2.6.1", "version": "2.6.1",
"resolved": "https://registry.npmmirror.com/launch-editor/-/launch-editor-2.6.1.tgz", "resolved": "https://registry.npmmirror.com/launch-editor/-/launch-editor-2.6.1.tgz",
@ -12069,11 +12064,6 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/postcss-media-query-parser": {
"version": "0.2.3",
"resolved": "https://registry.npmmirror.com/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz",
"integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig=="
},
"node_modules/postcss-merge-longhand": { "node_modules/postcss-merge-longhand": {
"version": "5.1.7", "version": "5.1.7",
"resolved": "https://registry.npmmirror.com/postcss-merge-longhand/-/postcss-merge-longhand-5.1.7.tgz", "resolved": "https://registry.npmmirror.com/postcss-merge-longhand/-/postcss-merge-longhand-5.1.7.tgz",
@ -12412,11 +12402,6 @@
"postcss": "^8.2.15" "postcss": "^8.2.15"
} }
}, },
"node_modules/postcss-resolve-nested-selector": {
"version": "0.1.1",
"resolved": "https://registry.npmmirror.com/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz",
"integrity": "sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw=="
},
"node_modules/postcss-safe-parser": { "node_modules/postcss-safe-parser": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmmirror.com/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz", "resolved": "https://registry.npmmirror.com/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz",
@ -12437,6 +12422,7 @@
"version": "6.0.16", "version": "6.0.16",
"resolved": "https://registry.npmmirror.com/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz", "resolved": "https://registry.npmmirror.com/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz",
"integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==", "integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==",
"dev": true,
"dependencies": { "dependencies": {
"cssesc": "^3.0.0", "cssesc": "^3.0.0",
"util-deprecate": "^1.0.2" "util-deprecate": "^1.0.2"
@ -12479,7 +12465,8 @@
"node_modules/postcss-value-parser": { "node_modules/postcss-value-parser": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "resolved": "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
"dev": true
}, },
"node_modules/prelude-ls": { "node_modules/prelude-ls": {
"version": "1.2.1", "version": "1.2.1",
@ -14179,24 +14166,6 @@
"postcss": "^8.2.15" "postcss": "^8.2.15"
} }
}, },
"node_modules/stylelint-scss": {
"version": "6.3.0",
"resolved": "https://registry.npmmirror.com/stylelint-scss/-/stylelint-scss-6.3.0.tgz",
"integrity": "sha512-8OSpiuf1xC7f8kllJsBOFAOYp/mR/C1FXMVeOFjtJPw+AFvEmC93FaklHt7MlOqU4poxuQ1TkYMyfI0V+1SxjA==",
"dependencies": {
"known-css-properties": "^0.30.0",
"postcss-media-query-parser": "^0.2.3",
"postcss-resolve-nested-selector": "^0.1.1",
"postcss-selector-parser": "^6.0.15",
"postcss-value-parser": "^4.2.0"
},
"engines": {
"node": ">=18.12.0"
},
"peerDependencies": {
"stylelint": "^16.0.2"
}
},
"node_modules/supports-color": { "node_modules/supports-color": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
@ -14828,7 +14797,8 @@
"node_modules/util-deprecate": { "node_modules/util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"dev": true
}, },
"node_modules/utila": { "node_modules/utila": {
"version": "0.4.0", "version": "0.4.0",

View File

@ -32,7 +32,6 @@
"mitt": "^3.0.1", "mitt": "^3.0.1",
"moment": "^2.30.1", "moment": "^2.30.1",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"stylelint-scss": "^6.3.0",
"uuid": "^9.0.1", "uuid": "^9.0.1",
"vue": "^3.4.21", "vue": "^3.4.21",
"vue-cookies": "^1.8.3", "vue-cookies": "^1.8.3",

View File

@ -1,9 +1,6 @@
import { statisticRoutes } from '@/router/module/statisticRoutes'; import { statisticRoutes } from '@/router/module/statisticRoutes';
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'; import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
/** import { pageRoutes } from './module/pageRoutes';
* *
* import { pageRoutes } from './module/pageRoutes';
*/
/** /**
* * appHash路由createWebHashHistory * * appHash路由createWebHashHistory
@ -11,10 +8,8 @@ import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router
*/ */
const router = createRouter({ const router = createRouter({
history: history:
process.env.NODE_ENV === 'production' process.env.NODE_ENV === 'production' ? createWebHashHistory(import.meta.env.BASE_URL) : createWebHistory(import.meta.env.BASE_URL),
? createWebHashHistory(import.meta.env.BASE_URL) routes: [...pageRoutes, ...statisticRoutes],
: createWebHistory(import.meta.env.BASE_URL),
routes: [/* ...pageRoutes, */ ...statisticRoutes],
}); });
export default router; export default router;

View File

@ -1,6 +1,5 @@
import { routeFilenameHelper } from '@/utils/file/routeFileUtil'; import { routeFilenameHelper } from '@/utils/file/routeFileUtil';
import { RouteRecordRaw } from 'vue-router'; import { RouteRecordRaw } from 'vue-router';
import router from '..';
// * 最终路由 // * 最终路由
const routeMap: Record<string, RouteRecordRaw> = {}; const routeMap: Record<string, RouteRecordRaw> = {};
@ -42,13 +41,3 @@ const createRouteList = (context: any, isIndex: boolean) => {
contexts.forEach(({ context, isIndex }) => createRouteList(context, isIndex)); contexts.forEach(({ context, isIndex }) => createRouteList(context, isIndex));
export const pageRoutes: Array<RouteRecordRaw> = [...Object.values(routeMap)]; export const pageRoutes: Array<RouteRecordRaw> = [...Object.values(routeMap)];
/**
* *
*
* 使
*/
pageRoutes.forEach((item, index) => {
// ? router.addRoute('路由的那么', 需要添加路由的值)
index & 1 ? router.addRoute('layout', item) : router.addRoute(item);
});

View File

@ -1,5 +1,5 @@
export const statisticRoutes = [ export const statisticRoutes = [
{ name: 'layout', path: '/', component: () => import('@/views/layout.vue') }, { name: 'index', path: '/', component: () => import('@/views/layout.vue') },
{ {
path: '/403', path: '/403',
name: '403', name: '403',

View File

@ -6,8 +6,6 @@
<RouterLink :to="route.path">{{ `${route.path}${String(route.name)}` }}</RouterLink> <RouterLink :to="route.path">{{ `${route.path}${String(route.name)}` }}</RouterLink>
</li> </li>
</ul> </ul>
<RouterView />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -16,9 +14,11 @@ import { pageRoutes } from '@/router/module/pageRoutes';
<style scoped lang="scss"> <style scoped lang="scss">
ul { ul {
padding-left: 50px; padding-left: 50px;
li { li {
list-style: circle !important; list-style: circle !important;
} }
a { a {
color: #8185a7; color: #8185a7;
} }