diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000000000000000000000000000000000..cfc877d6cdb8bb6afbad7b032477a6f54ac013f6 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,18 @@ + +*.sh +node_modules +lib +*.md +*.scss +*.woff +*.ttf +.vscode +.idea +dist +mock +public +bin +build +config +index.html +src/assets \ No newline at end of file diff --git a/package.json b/package.json index 263a7ee66cf8f4d52d424613e9fdd0f316000e6d..35fda1704cce15b6771e0dc44f8b05ca3f557603 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "0.0.0", "scripts": { "dev": "vite", - "build": "vite build" + "build": "vite build", + "lint-fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/" }, "dependencies": { "element-plus": "^2.2.2", @@ -20,11 +21,11 @@ "@types/js-cookie": "^3.0.2", "@types/sortablejs": "^1.10.6", "@typescript-eslint/eslint-plugin": "^5.27.0", - "@typescript-eslint/parser": "^5.27.0", + "@typescript-eslint/parser": "^5.27.0", "@vitejs/plugin-vue": "^2.3.3", "@vue/compiler-sfc": "^3.0.4", "eslint": "^8.17.0", - "eslint-plugin-vue": "^9.1.0", + "eslint-plugin-vue": "^9.1.0", "sass": "^1.30.0", "sass-loader": "^10.1.0", "typescript": "^4.1.2", diff --git a/src/App.vue b/src/App.vue index 94305ebdbdfa9a92d88ddfa74b23a1245a2a2acb..1c3ae781b71ac88b790590a5aef26135b75e4341 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,7 +5,7 @@ \ No newline at end of file diff --git a/src/layout/component/header.vue b/src/layout/component/header.vue index e3ee2c15b94884c9b61b0400eb4d9b40c91c9d5b..67df5e790100ebdfe3c6d77141c1eccd0fca3562 100644 --- a/src/layout/component/header.vue +++ b/src/layout/component/header.vue @@ -1,13 +1,13 @@ \ No newline at end of file diff --git a/src/layout/component/main.vue b/src/layout/component/main.vue index 4298ec8ad05467a034ee1586aad82e7deae03fcd..314f6b2e551c76157e27aa9400c004a10bc3e5d2 100644 --- a/src/layout/component/main.vue +++ b/src/layout/component/main.vue @@ -1,35 +1,35 @@ diff --git a/src/layout/fashion.vue b/src/layout/fashion.vue index 91c2d8fb4b4cfc91a78f64e85d88145883cd49de..340b7318f78a800c0d380942de225ceed28da587 100644 --- a/src/layout/fashion.vue +++ b/src/layout/fashion.vue @@ -1,15 +1,15 @@ \ No newline at end of file diff --git a/src/layout/index.vue b/src/layout/index.vue index 2634abca4ea2a5ce590698fb21c3b54d980366c7..b71dbdd949feb81f40a03b867ba5f82e41181026 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,11 +1,11 @@ \ No newline at end of file diff --git a/src/layout/logo/index.vue b/src/layout/logo/index.vue index 8130e472ae5047e2f24072e5616cbc30464d376c..ee47a589588e09b77714239341472d15ae264b08 100644 --- a/src/layout/logo/index.vue +++ b/src/layout/logo/index.vue @@ -1,9 +1,9 @@ \ No newline at end of file diff --git a/src/layout/navBars/breadcrumb/breadcrumb.vue b/src/layout/navBars/breadcrumb/breadcrumb.vue index c100283b6aca485d4893707bb9ce8a89c4b487cc..b52df53a711489fab55dfbdbd4a36c818a05c8d2 100644 --- a/src/layout/navBars/breadcrumb/breadcrumb.vue +++ b/src/layout/navBars/breadcrumb/breadcrumb.vue @@ -1,47 +1,47 @@ diff --git a/src/layout/navBars/breadcrumb/index.vue b/src/layout/navBars/breadcrumb/index.vue index 0e4598cc7962d04291c1437fdac6d27c95a67549..306c42b44a66c73dcfd502077cdb97c99fc7ab4b 100644 --- a/src/layout/navBars/breadcrumb/index.vue +++ b/src/layout/navBars/breadcrumb/index.vue @@ -1,16 +1,16 @@ diff --git a/src/layout/navBars/breadcrumb/seting.vue b/src/layout/navBars/breadcrumb/seting.vue index 88596f70b32089425c0e319d1ed729ccb9f5c659..f913ce191e1644f2a7b4c6e4fedb31fce2f37e2a 100644 --- a/src/layout/navBars/breadcrumb/seting.vue +++ b/src/layout/navBars/breadcrumb/seting.vue @@ -1,9 +1,9 @@ \ No newline at end of file diff --git a/src/layout/navBars/breadcrumb/user.vue b/src/layout/navBars/breadcrumb/user.vue index 7b49ec802beede0b3e364f0b4f54188a07720c00..f284b9e046d6ba61dc71bb4d1095c5536754f2f1 100644 --- a/src/layout/navBars/breadcrumb/user.vue +++ b/src/layout/navBars/breadcrumb/user.vue @@ -1,30 +1,30 @@ diff --git a/src/layout/navBars/index.vue b/src/layout/navBars/index.vue index 556a6fc390e59520114e21db1223c2ed78f2e15e..9ebed20dbba4ba82dc6ddfee4d2e677787859965 100644 --- a/src/layout/navBars/index.vue +++ b/src/layout/navBars/index.vue @@ -1,16 +1,16 @@ diff --git a/src/layout/navBars/tagsView/contextmenu.vue b/src/layout/navBars/tagsView/contextmenu.vue index bb287104817c237c2c54395b4d57b494207039ca..7c4cc8efbff18be44aeb863f69f9486210b1ea86 100644 --- a/src/layout/navBars/tagsView/contextmenu.vue +++ b/src/layout/navBars/tagsView/contextmenu.vue @@ -1,69 +1,69 @@ diff --git a/src/layout/navBars/tagsView/scroll.vue b/src/layout/navBars/tagsView/scroll.vue index 4388ca8913fc79262261d73c05e9f21f9fec119d..7e27e043d65dc79f391e0a3a34efc81375c3b32a 100644 --- a/src/layout/navBars/tagsView/scroll.vue +++ b/src/layout/navBars/tagsView/scroll.vue @@ -1,70 +1,70 @@ \ No newline at end of file diff --git a/src/layout/navBars/tagsView/tagsView.vue b/src/layout/navBars/tagsView/tagsView.vue index 4e3f65cb1094ebc457ab426bc235b441cfc54579..36e6bcc55f320d28edca22bef671d9c9e51af4ae 100644 --- a/src/layout/navBars/tagsView/tagsView.vue +++ b/src/layout/navBars/tagsView/tagsView.vue @@ -1,111 +1,111 @@ diff --git a/src/layout/navMenu/subItem.vue b/src/layout/navMenu/subItem.vue index 7497a85adf22262a29041d538d24c081beddd769..964bd0f90300a5f8ca02ea4a0648132cd209f7e5 100644 --- a/src/layout/navMenu/subItem.vue +++ b/src/layout/navMenu/subItem.vue @@ -1,41 +1,41 @@ diff --git a/src/layout/navMenu/vertical.vue b/src/layout/navMenu/vertical.vue index ceb649465f39c237d2cb5076e7a57ee19594e1a1..05c37fd51174008a0659bc7585de6784aeafbbf4 100644 --- a/src/layout/navMenu/vertical.vue +++ b/src/layout/navMenu/vertical.vue @@ -1,52 +1,52 @@ diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index 81e3a581c795978b32733cc812f6f17647a00cbb..0df5f79c87aa07800c3065f3df92ae5b7003e4b5 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -1,75 +1,76 @@ export function formatDate(date: Date, format: string) { - let we = date.getDay() - let qut = Math.floor((date.getMonth() + 3) / 3).toString() - const opt: any = { - "Y+": date.getFullYear().toString(), - "m+": (date.getMonth() + 1).toString(), - "d+": date.getDate().toString(), - "H+": date.getHours().toString(), - "M+": date.getMinutes().toString(), - "S+": date.getSeconds().toString(), - "q+": qut, - } - const week: any = { - "0": "日", - "1": "一", - "2": "二", - "3": "三", - "4": "四", - "5": "五", - "6": "六", - } - const quarter: any = { - "1": "一", - "2": "二", - "3": "三", - "4": "四", - } - if (/(W+)/.test(format)) format = format.replace(RegExp.$1, RegExp.$1.length > 1 ? RegExp.$1.length > 2 ? "星期" + week[we] : "周" + week[we] : week[we]) - if (/(Q+)/.test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 4 ? "第" + quarter[qut] + "季度" : quarter[qut]) - for (let k in opt) { - let r = new RegExp("(" + k + ")").exec(format); - if (r) format = format.replace(r[1], RegExp.$1.length == 1 ? opt[k] : opt[k].padStart(RegExp.$1.length, "0")) - } - return format + let we = date.getDay(); + let qut = Math.floor((date.getMonth() + 3) / 3).toString(); + const opt: any = { + 'Y+': date.getFullYear().toString(), + 'm+': (date.getMonth() + 1).toString(), + 'd+': date.getDate().toString(), + 'H+': date.getHours().toString(), + 'M+': date.getMinutes().toString(), + 'S+': date.getSeconds().toString(), + 'q+': qut, + }; + const week: any = { + '0': '日', + '1': '一', + '2': '二', + '3': '三', + '4': '四', + '5': '五', + '6': '六', + }; + const quarter: any = { + '1': '一', + '2': '二', + '3': '三', + '4': '四', + }; + if (/(W+)/.test(format)) + format = format.replace(RegExp.$1, RegExp.$1.length > 1 ? (RegExp.$1.length > 2 ? '星期' + week[we] : '周' + week[we]) : week[we]); + if (/(Q+)/.test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 4 ? '第' + quarter[qut] + '季度' : quarter[qut]); + for (let k in opt) { + let r = new RegExp('(' + k + ')').exec(format); + if (r) format = format.replace(r[1], RegExp.$1.length == 1 ? opt[k] : opt[k].padStart(RegExp.$1.length, '0')); + } + return format; } -export function formatPast(param: any, format: string = "YYYY-mm-dd") { - let t: any, s: any - let time: any = new Date().getTime() - typeof param === "string" || "object" ? (t = new Date(param).getTime()) : (t = param) - time = Number.parseInt(`${time - t}`) - if (time < 10000) { - return "刚刚" - } else if (time < 60000 && time >= 10000) { - s = Math.floor(time / 1000) - return `${s}秒前` - } else if (time < 3600000 && time >= 60000) { - s = Math.floor(time / 60000) - return `${s}分钟前` - } else if (time < 86400000 && time >= 3600000) { - s = Math.floor(time / 3600000) - return `${s}小时前` - } else if (time < 259200000 && time >= 86400000) { - s = Math.floor(time / 86400000) - return `${s}天前` - } else { - let date = typeof param === "string" || "object" ? new Date(param) : param - return formatDate(date, format); - } +export function formatPast(param: any, format: string = 'YYYY-mm-dd') { + let t: any, s: any; + let time: any = new Date().getTime(); + typeof param === 'string' || 'object' ? (t = new Date(param).getTime()) : (t = param); + time = Number.parseInt(`${time - t}`); + if (time < 10000) { + return '刚刚'; + } else if (time < 60000 && time >= 10000) { + s = Math.floor(time / 1000); + return `${s}秒前`; + } else if (time < 3600000 && time >= 60000) { + s = Math.floor(time / 60000); + return `${s}分钟前`; + } else if (time < 86400000 && time >= 3600000) { + s = Math.floor(time / 3600000); + return `${s}小时前`; + } else if (time < 259200000 && time >= 86400000) { + s = Math.floor(time / 86400000); + return `${s}天前`; + } else { + let date = typeof param === 'string' || 'object' ? new Date(param) : param; + return formatDate(date, format); + } } /** * formatAxis(new Date()) */ export function formatAxis(param: any) { - let hour: number = new Date(param).getHours() - if (hour < 6) return "凌晨好" - else if (hour < 9) return "早上好" - else if (hour < 12) return "上午好" - else if (hour < 14) return "中午好" - else if (hour < 17) return "下午好" - else if (hour < 19) return "傍晚好" - else if (hour < 22) return "晚上好" - else return "夜里好" + let hour: number = new Date(param).getHours(); + if (hour < 6) return '凌晨好'; + else if (hour < 9) return '早上好'; + else if (hour < 12) return '上午好'; + else if (hour < 14) return '中午好'; + else if (hour < 17) return '下午好'; + else if (hour < 19) return '傍晚好'; + else if (hour < 22) return '晚上好'; + else return '夜里好'; } diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 8c7788f56ad0409aa4d28f83ed5302a24ca266ae..d8ab73f488293b26e6265ec4f156f3e8956d0a30 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -1,10 +1,9 @@ - - - \ No newline at end of file + home + + +