diff --git a/.env.development b/.env.development
index c39cd37..9906167 100644
--- a/.env.development
+++ b/.env.development
@@ -1,8 +1,7 @@
# 页面标题
-VITE_APP_TITLE = 若依管理系统
-
+VITE_APP_TITLE = 智汇管理系统11
# 开发环境配置
VITE_APP_ENV = 'development'
-# 若依管理系统/开发环境
+# 智汇管理系统/开发环境
VITE_APP_BASE_API = 'http://192.168.1.5:8082'
diff --git a/.env.production b/.env.production
index 86e9309..67b9f58 100644
--- a/.env.production
+++ b/.env.production
@@ -1,10 +1,10 @@
# 页面标题
-VITE_APP_TITLE = 若依管理系统
+VITE_APP_TITLE = 智汇管理系统
# 生产环境配置
VITE_APP_ENV = 'production'
-# 若依管理系统/生产环境
+# 智汇管理系统/生产环境
VITE_APP_BASE_API = 'http://192.168.1.5:8082'
# 是否在打包时开启压缩,支持 gzip 和 brotli
diff --git a/.env.staging b/.env.staging
index b11336d..853a4dd 100644
--- a/.env.staging
+++ b/.env.staging
@@ -1,10 +1,10 @@
# 页面标题
-VITE_APP_TITLE = 若依管理系统
+VITE_APP_TITLE = 智汇管理系统
# 生产环境配置
VITE_APP_ENV = 'staging'
-# 若依管理系统/生产环境
+# 智汇管理系统/生产环境
VITE_APP_BASE_API = '/stage-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli
diff --git a/package.json b/package.json
index bea9770..aac205f 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "ruoyi",
"version": "3.9.1",
- "description": "若依管理系统",
+ "description": "智汇管理系统",
"author": "若依",
"license": "MIT",
"type": "module",
diff --git a/src/api/system/user.js b/src/api/system/user.js
index b5e3edd..7d307ea 100644
--- a/src/api/system/user.js
+++ b/src/api/system/user.js
@@ -1,5 +1,5 @@
import request from '@/utils/request'
-import { parseStrEmpty } from "@/utils/ruoyi";
+import { parseStrEmpty } from "@/utils/manage";
// 查询用户列表
export function listUser(query) {
diff --git a/src/assets/styles/btn.scss b/src/assets/styles/btn.scss
index fee3ee1..3590d8d 100644
--- a/src/assets/styles/btn.scss
+++ b/src/assets/styles/btn.scss
@@ -1,4 +1,4 @@
-@use './variables.module.scss' as *;
+@import './variables.module.scss';
@mixin colorBtn($color) {
background: $color;
diff --git a/src/assets/styles/common.css b/src/assets/styles/common.css
new file mode 100644
index 0000000..bfaac0d
--- /dev/null
+++ b/src/assets/styles/common.css
@@ -0,0 +1,21 @@
+
+:root {
+ --mineTable-notFinish-bg-color: #c7ffa5;
+ --mineTable-click-bg-color: #d2f0ff;
+}
+
+.el-table .success-row {
+ background-color: var(--mineTable-notFinish-bg-color) !important;
+}
+
+.el-table__body tr.current-row>td.el-table__cell {
+ background-color: var(--mineTable-click-bg-color) !important;
+}
+
+/* :deep(.el-table__body tr.hover-row>td.el-table__cell){
+ background-color: unset !important;
+}
+
+.el-table {
+ --el-table-row-hover-bg-color: transparent;
+} */
\ No newline at end of file
diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss
index 87898e6..ce7894b 100644
--- a/src/assets/styles/index.scss
+++ b/src/assets/styles/index.scss
@@ -1,9 +1,10 @@
-@use './mixin.scss';
-@use './transition.scss';
-@use './element-ui.scss';
-@use './sidebar.scss';
-@use './btn.scss';
-@use './ruoyi.scss';
+@import './variables.module.scss';
+@import './mixin.scss';
+@import './transition.scss';
+@import './element-ui.scss';
+@import './sidebar.scss';
+@import './btn.scss';
+@import './manage.scss';
body {
height: 100%;
@@ -123,6 +124,16 @@ aside {
//main-container全局样式
.app-container {
padding: 20px;
+ background-color: #ffffff;
+ border-radius: 8px;
+ margin: 24px;
+
+ .el-form{
+ .el-form-item__label{
+ color:rgba(0, 0, 0, .9);
+ font-weight: 500;
+ }
+ }
}
.components-container {
diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/manage.scss
similarity index 91%
rename from src/assets/styles/ruoyi.scss
rename to src/assets/styles/manage.scss
index 6d96a35..1dd3d1d 100644
--- a/src/assets/styles/ruoyi.scss
+++ b/src/assets/styles/manage.scss
@@ -1,6 +1,6 @@
/**
* 通用css样式布局处理
- * Copyright (c) 2019 ruoyi
+ * Copyright (c) 2019
*/
/** 基础通用 **/
@@ -60,14 +60,6 @@
color: inherit;
}
-.el-form--inline {
- .el-form-item {
- .el-input, .el-cascader, .el-select, .el-autocomplete {
- width: 200px;
- }
- }
-}
-
.el-form .el-form-item__label {
font-weight: 700;
}
@@ -156,16 +148,6 @@
width: inherit;
}
-/* horizontal el menu */
-.el-menu--horizontal .el-menu-item .svg-icon + span,
-.el-menu--horizontal .el-sub-menu__title .svg-icon + span {
- margin-left: 3px;
-}
-
-.el-menu--horizontal .el-menu--popup {
- min-width: 120px !important;
-}
-
/** 表格更多操作下拉样式 */
.el-table .el-dropdown-link {
cursor: pointer;
diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss
index 5ee4ac8..e138e6a 100644
--- a/src/assets/styles/sidebar.scss
+++ b/src/assets/styles/sidebar.scss
@@ -1,11 +1,9 @@
-@use './variables.module.scss' as vars;
-
#app {
.main-container {
min-height: 100%;
transition: margin-left .28s;
- margin-left: vars.$base-sidebar-width;
+ margin-left: $base-sidebar-width;
position: relative;
}
@@ -15,7 +13,7 @@
.sidebar-container {
transition: width 0.28s;
- width: vars.$base-sidebar-width !important;
+ width: $base-sidebar-width !important;
height: 100%;
position: fixed;
font-size: 0px;
@@ -24,8 +22,9 @@
left: 0;
z-index: 1001;
overflow: hidden;
- -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
- box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
+ // -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
+ // box-shadow: 2px 0 6px rgba(0,21,41,.35);
+ border-right: 1px solid #e4e4e7;
// reset element-ui css
.horizontal-collapse-transition {
@@ -61,7 +60,7 @@
}
.svg-icon {
- margin-right: 10px !important;
+ margin-right: 16px;
}
.el-menu {
@@ -89,12 +88,12 @@
}
& .theme-dark .is-active > .el-sub-menu__title {
- color: vars.$base-menu-color-active !important;
+ color: $base-menu-color-active !important;
}
& .nest-menu .el-sub-menu>.el-sub-menu__title,
& .el-sub-menu .el-menu-item {
- min-width: vars.$base-sidebar-width !important;
+ min-width: $base-sidebar-width !important;
&:hover {
background-color: rgba(0, 0, 0, 0.06) !important;
@@ -103,10 +102,10 @@
& .theme-dark .nest-menu .el-sub-menu>.el-sub-menu__title,
& .theme-dark .el-sub-menu .el-menu-item {
- background-color: vars.$base-sub-menu-background;
+ background-color: $base-sub-menu-background;
&:hover {
- background-color: vars.$base-sub-menu-hover !important;
+ background-color: $base-sub-menu-hover !important;
}
}
}
@@ -169,7 +168,7 @@
}
.el-menu--collapse .el-menu .el-sub-menu {
- min-width: vars.$base-sidebar-width !important;
+ min-width: $base-sidebar-width !important;
}
// mobile responsive
@@ -180,14 +179,14 @@
.sidebar-container {
transition: transform .28s;
- width: vars.$base-sidebar-width !important;
+ width: $base-sidebar-width !important;
}
&.hideSidebar {
.sidebar-container {
pointer-events: none;
transition-duration: 0.3s;
- transform: translate3d(-(vars.$base-sidebar-width), 0, 0);
+ transform: translate3d(-$base-sidebar-width, 0, 0);
}
}
}
diff --git a/src/assets/styles/transition.scss b/src/assets/styles/transition.scss
index 1f74a7e..073f8c6 100644
--- a/src/assets/styles/transition.scss
+++ b/src/assets/styles/transition.scss
@@ -6,7 +6,7 @@
transition: opacity 0.28s;
}
-.fade-enter-from,
+.fade-enter,
.fade-leave-active {
opacity: 0;
}
@@ -18,7 +18,7 @@
transition: all .5s;
}
-.fade-transform-enter-from {
+.fade-transform-enter {
opacity: 0;
transform: translateX(-30px);
}
@@ -34,7 +34,7 @@
transition: all .5s;
}
-.breadcrumb-enter-from,
+.breadcrumb-enter,
.breadcrumb-leave-active {
opacity: 0;
transform: translateX(20px);
@@ -47,34 +47,3 @@
.breadcrumb-leave-active {
position: absolute;
}
-
-/* 黑暗模式下过渡效果 */
-::view-transition-new(root), ::view-transition-old(root) {
- animation: none !important;
- backface-visibility: hidden;
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
-
-.dark::view-transition-old(root) {
- z-index: 2147483646;
- background: var(--bg-color-dark);
-}
-
-.dark::view-transition-new(root) {
- z-index: 1;
- background: var(--bg-color);
-}
-
-::view-transition-old(root) {
- z-index: 1;
- background: var(--bg-color);
-}
-
-::view-transition-new(root) {
- z-index: 2147483646;
- background: var(--bg-color-dark);
-}
diff --git a/src/assets/styles/variables.module.scss b/src/assets/styles/variables.module.scss
index 3a833b5..8764e13 100644
--- a/src/assets/styles/variables.module.scss
+++ b/src/assets/styles/variables.module.scss
@@ -89,9 +89,6 @@ html.dark {
--el-text-color-regular: #d0d0d0;
--el-border-color: #434343;
--el-border-color-light: #434343;
-
- /* primary */
- --primary-bg: #18212b;
/* 侧边栏 */
--sidebar-bg: #141414;
@@ -130,8 +127,8 @@ html.dark {
--splitpanes-default-bg: #141414;
/* 侧边栏菜单覆盖 */
- .sidebar-container {
- .el-menu-item:not(.is-active), .menu-title {
+ .sidebar-container {
+ .el-menu-item, .menu-title {
color: var(--el-text-color-regular);
}
& .theme-dark .nest-menu .el-sub-menu>.el-sub-menu__title,
@@ -140,27 +137,13 @@ html.dark {
}
}
- .topmenu-container {
- .el-menu-item,
- .el-sub-menu .el-sub-menu__title {
- color: var(--el-text-color-regular) !important;
- }
- }
-
- .topbar-menu.el-menu--horizontal > .el-sub-menu .el-sub-menu__title{
- color: var(--el-text-color-regular) !important;
- }
-
/* 顶部栏栏菜单覆盖 */
.el-menu--horizontal {
- .el-menu-item, .el-sub-menu {
+ .el-menu-item {
&:not(.is-disabled) {
&:hover,
&:focus {
background-color: var(--navbar-hover) !important;
- .el-sub-menu__title {
- background-color: var(--navbar-hover) !important;
- }
}
}
}
@@ -190,33 +173,6 @@ html.dark {
}
}
- /* 按钮样式覆盖 */
- .el-button--primary.is-plain {
- background-color: var(--primary-bg);
- border: 1px solid var(--el-color-primary-light-2);
- color: var(--el-color-primary-light-2);
-
- &:hover {
- background-color: var(--el-button-hover-bg-color);
- border-color: var(--el-button-hover-border-color);
- color: var(--el-button-hover-text-color);
- }
-
- &.is-disabled {
- background-color: var(--link-active-bg-color);
- border-color: var(--el-color-primary-light-3);
- color: var(--el-color-primary-light-3);
- opacity: 0.5;
- }
- }
-
- /* primary tag 样式覆盖 */
- .el-tag--primary {
- background-color: var(--primary-bg);
- border: 1px solid var(--el-border-color-light);
- color: var(--el-color-primary);
- }
-
/* 表格样式覆盖 */
.el-table {
--el-table-header-bg-color: var(--el-bg-color-overlay) !important;
@@ -261,11 +217,5 @@ html.dark {
background: var(--cron-border);
}
- /* 底部版权样式覆盖 */
- .copyright {
- background-color: var(--el-bg-color) !important;
- color: var(--el-text-color-regular) !important;
- border-top: 1px solid var(--el-bg-color) !important;
- }
}
diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue
index 059076f..c13e5e9 100644
--- a/src/components/Breadcrumb/index.vue
+++ b/src/components/Breadcrumb/index.vue
@@ -88,6 +88,7 @@ getBreadcrumb()
display: inline-block;
font-size: 14px;
line-height: 50px;
+ margin-left: 8px;
.no-redirect {
color: #97a8be;
diff --git a/src/components/Crontab/hour.vue b/src/components/Crontab/hour.vue
index db77835..8e7c21c 100644
--- a/src/components/Crontab/hour.vue
+++ b/src/components/Crontab/hour.vue
@@ -78,10 +78,10 @@ watch(() => props.cron.hour, value => changeRadioValue(value))
watch([radioValue, cycleTotal, averageTotal, checkboxString], () => onRadioChange())
function changeRadioValue(value) {
if (props.cron.min === '*') {
- emit('update', 'min', '0', 'hour')
+ emit('update', 'min', '0', 'hour');
}
if (props.cron.second === '*') {
- emit('update', 'second', '0', 'hour')
+ emit('update', 'second', '0', 'hour');
}
if (value === '*') {
radioValue.value = 1
diff --git a/src/components/Crontab/index.vue b/src/components/Crontab/index.vue
index cbb41ab..103cf4c 100644
--- a/src/components/Crontab/index.vue
+++ b/src/components/Crontab/index.vue
@@ -70,46 +70,42 @@
时间表达式
-
- | {{item}} |
- Cron 表达式 |
-
+ {{item}} |
+ Cron 表达式 |
-
- |
- {{crontabValueObj.second}}
- {{crontabValueObj.second}}
- |
-
- {{crontabValueObj.min}}
- {{crontabValueObj.min}}
- |
-
- {{crontabValueObj.hour}}
- {{crontabValueObj.hour}}
- |
-
- {{crontabValueObj.day}}
- {{crontabValueObj.day}}
- |
-
- {{crontabValueObj.month}}
- {{crontabValueObj.month}}
- |
-
- {{crontabValueObj.week}}
- {{crontabValueObj.week}}
- |
-
- {{crontabValueObj.year}}
- {{crontabValueObj.year}}
- |
-
- {{crontabValueString}}
- {{crontabValueString}}
- |
-
+
+ {{crontabValueObj.second}}
+ {{crontabValueObj.second}}
+ |
+
+ {{crontabValueObj.min}}
+ {{crontabValueObj.min}}
+ |
+
+ {{crontabValueObj.hour}}
+ {{crontabValueObj.hour}}
+ |
+
+ {{crontabValueObj.day}}
+ {{crontabValueObj.day}}
+ |
+
+ {{crontabValueObj.month}}
+ {{crontabValueObj.month}}
+ |
+
+ {{crontabValueObj.week}}
+ {{crontabValueObj.week}}
+ |
+
+ {{crontabValueObj.year}}
+ {{crontabValueObj.year}}
+ |
+
+ {{crontabValueString}}
+ {{crontabValueString}}
+ |
diff --git a/src/components/Crontab/result.vue b/src/components/Crontab/result.vue
index cbb49ba..5a812ee 100644
--- a/src/components/Crontab/result.vue
+++ b/src/components/Crontab/result.vue
@@ -26,289 +26,289 @@ watch(() => props.ex, () => expressionChange())
// 表达式值变化时,开始去计算结果
function expressionChange() {
// 计算开始-隐藏结果
- isShow.value = false
+ isShow.value = false;
// 获取规则数组[0秒、1分、2时、3日、4月、5星期、6年]
- let ruleArr = props.ex.split(' ')
+ let ruleArr = props.ex.split(' ');
// 用于记录进入循环的次数
- let nums = 0
+ let nums = 0;
// 用于暂时存符号时间规则结果的数组
- let resultArr = []
+ let resultArr = [];
// 获取当前时间精确至[年、月、日、时、分、秒]
- let nTime = new Date()
- let nYear = nTime.getFullYear()
- let nMonth = nTime.getMonth() + 1
- let nDay = nTime.getDate()
- let nHour = nTime.getHours()
- let nMin = nTime.getMinutes()
- let nSecond = nTime.getSeconds()
+ let nTime = new Date();
+ let nYear = nTime.getFullYear();
+ let nMonth = nTime.getMonth() + 1;
+ let nDay = nTime.getDate();
+ let nHour = nTime.getHours();
+ let nMin = nTime.getMinutes();
+ let nSecond = nTime.getSeconds();
// 根据规则获取到近100年可能年数组、月数组等等
- getSecondArr(ruleArr[0])
- getMinArr(ruleArr[1])
- getHourArr(ruleArr[2])
- getDayArr(ruleArr[3])
- getMonthArr(ruleArr[4])
- getWeekArr(ruleArr[5])
- getYearArr(ruleArr[6], nYear)
+ getSecondArr(ruleArr[0]);
+ getMinArr(ruleArr[1]);
+ getHourArr(ruleArr[2]);
+ getDayArr(ruleArr[3]);
+ getMonthArr(ruleArr[4]);
+ getWeekArr(ruleArr[5]);
+ getYearArr(ruleArr[6], nYear);
// 将获取到的数组赋值-方便使用
- let sDate = dateArr.value[0]
- let mDate = dateArr.value[1]
- let hDate = dateArr.value[2]
- let DDate = dateArr.value[3]
- let MDate = dateArr.value[4]
- let YDate = dateArr.value[5]
+ let sDate = dateArr.value[0];
+ let mDate = dateArr.value[1];
+ let hDate = dateArr.value[2];
+ let DDate = dateArr.value[3];
+ let MDate = dateArr.value[4];
+ let YDate = dateArr.value[5];
// 获取当前时间在数组中的索引
- let sIdx = getIndex(sDate, nSecond)
- let mIdx = getIndex(mDate, nMin)
- let hIdx = getIndex(hDate, nHour)
- let DIdx = getIndex(DDate, nDay)
- let MIdx = getIndex(MDate, nMonth)
- let YIdx = getIndex(YDate, nYear)
+ let sIdx = getIndex(sDate, nSecond);
+ let mIdx = getIndex(mDate, nMin);
+ let hIdx = getIndex(hDate, nHour);
+ let DIdx = getIndex(DDate, nDay);
+ let MIdx = getIndex(MDate, nMonth);
+ let YIdx = getIndex(YDate, nYear);
// 重置月日时分秒的函数(后面用的比较多)
const resetSecond = function () {
- sIdx = 0
+ sIdx = 0;
nSecond = sDate[sIdx]
}
const resetMin = function () {
- mIdx = 0
+ mIdx = 0;
nMin = mDate[mIdx]
- resetSecond()
+ resetSecond();
}
const resetHour = function () {
- hIdx = 0
+ hIdx = 0;
nHour = hDate[hIdx]
- resetMin()
+ resetMin();
}
const resetDay = function () {
- DIdx = 0
+ DIdx = 0;
nDay = DDate[DIdx]
- resetHour()
+ resetHour();
}
const resetMonth = function () {
- MIdx = 0
+ MIdx = 0;
nMonth = MDate[MIdx]
- resetDay()
+ resetDay();
}
// 如果当前年份不为数组中当前值
if (nYear !== YDate[YIdx]) {
- resetMonth()
+ resetMonth();
}
// 如果当前月份不为数组中当前值
if (nMonth !== MDate[MIdx]) {
- resetDay()
+ resetDay();
}
// 如果当前“日”不为数组中当前值
if (nDay !== DDate[DIdx]) {
- resetHour()
+ resetHour();
}
// 如果当前“时”不为数组中当前值
if (nHour !== hDate[hIdx]) {
- resetMin()
+ resetMin();
}
// 如果当前“分”不为数组中当前值
if (nMin !== mDate[mIdx]) {
- resetSecond()
+ resetSecond();
}
// 循环年份数组
goYear: for (let Yi = YIdx; Yi < YDate.length; Yi++) {
- let YY = YDate[Yi]
+ let YY = YDate[Yi];
// 如果到达最大值时
if (nMonth > MDate[MDate.length - 1]) {
- resetMonth()
- continue
+ resetMonth();
+ continue;
}
// 循环月份数组
goMonth: for (let Mi = MIdx; Mi < MDate.length; Mi++) {
// 赋值、方便后面运算
let MM = MDate[Mi];
- MM = MM < 10 ? '0' + MM : MM
+ MM = MM < 10 ? '0' + MM : MM;
// 如果到达最大值时
if (nDay > DDate[DDate.length - 1]) {
- resetDay()
+ resetDay();
if (Mi === MDate.length - 1) {
- resetMonth()
- continue goYear
+ resetMonth();
+ continue goYear;
}
- continue
+ continue;
}
// 循环日期数组
goDay: for (let Di = DIdx; Di < DDate.length; Di++) {
// 赋值、方便后面运算
- let DD = DDate[Di]
- let thisDD = DD < 10 ? '0' + DD : DD
+ let DD = DDate[Di];
+ let thisDD = DD < 10 ? '0' + DD : DD;
// 如果到达最大值时
if (nHour > hDate[hDate.length - 1]) {
- resetHour()
+ resetHour();
if (Di === DDate.length - 1) {
- resetDay()
+ resetDay();
if (Mi === MDate.length - 1) {
- resetMonth()
- continue goYear
+ resetMonth();
+ continue goYear;
}
- continue goMonth
+ continue goMonth;
}
- continue
+ continue;
}
// 判断日期的合法性,不合法的话也是跳出当前循环
if (checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true && dayRule.value !== 'workDay' && dayRule.value !== 'lastWeek' && dayRule.value !== 'lastDay') {
- resetDay()
- continue goMonth
+ resetDay();
+ continue goMonth;
}
// 如果日期规则中有值时
if (dayRule.value === 'lastDay') {
// 如果不是合法日期则需要将前将日期调到合法日期即月末最后一天
if (checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
while (DD > 0 && checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
- DD--
- thisDD = DD < 10 ? '0' + DD : DD
+ DD--;
+ thisDD = DD < 10 ? '0' + DD : DD;
}
}
} else if (dayRule.value === 'workDay') {
// 校验并调整如果是2月30号这种日期传进来时需调整至正常月底
if (checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
while (DD > 0 && checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
- DD--
- thisDD = DD < 10 ? '0' + DD : DD
+ DD--;
+ thisDD = DD < 10 ? '0' + DD : DD;
}
}
// 获取达到条件的日期是星期X
- let thisWeek = formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week')
+ let thisWeek = formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week');
// 当星期日时
if (thisWeek === 1) {
// 先找下一个日,并判断是否为月底
- DD++
- thisDD = DD < 10 ? '0' + DD : DD
+ DD++;
+ thisDD = DD < 10 ? '0' + DD : DD;
// 判断下一日已经不是合法日期
if (checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
- DD -= 3
+ DD -= 3;
}
} else if (thisWeek === 7) {
// 当星期6时只需判断不是1号就可进行操作
if (dayRuleSup.value !== 1) {
- DD--
+ DD--;
} else {
- DD += 2
+ DD += 2;
}
}
} else if (dayRule.value === 'weekDay') {
// 如果指定了是星期几
// 获取当前日期是属于星期几
- let thisWeek = formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week')
+ let thisWeek = formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week');
// 校验当前星期是否在星期池(dayRuleSup)中
if (dayRuleSup.value.indexOf(thisWeek) < 0) {
// 如果到达最大值时
if (Di === DDate.length - 1) {
- resetDay()
+ resetDay();
if (Mi === MDate.length - 1) {
- resetMonth()
- continue goYear
+ resetMonth();
+ continue goYear;
}
- continue goMonth
+ continue goMonth;
}
- continue
+ continue;
}
} else if (dayRule.value === 'assWeek') {
// 如果指定了是第几周的星期几
// 获取每月1号是属于星期几
- let thisWeek = formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week')
+ let thisWeek = formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week');
if (dayRuleSup.value[1] >= thisWeek) {
- DD = (dayRuleSup.value[0] - 1) * 7 + dayRuleSup.value[1] - thisWeek + 1
+ DD = (dayRuleSup.value[0] - 1) * 7 + dayRuleSup.value[1] - thisWeek + 1;
} else {
- DD = dayRuleSup.value[0] * 7 + dayRuleSup.value[1] - thisWeek + 1
+ DD = dayRuleSup.value[0] * 7 + dayRuleSup.value[1] - thisWeek + 1;
}
} else if (dayRule.value === 'lastWeek') {
// 如果指定了每月最后一个星期几
// 校验并调整如果是2月30号这种日期传进来时需调整至正常月底
if (checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
while (DD > 0 && checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) {
- DD--
- thisDD = DD < 10 ? '0' + DD : DD
+ DD--;
+ thisDD = DD < 10 ? '0' + DD : DD;
}
}
// 获取月末最后一天是星期几
- let thisWeek = formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week')
+ let thisWeek = formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week');
// 找到要求中最近的那个星期几
if (dayRuleSup.value < thisWeek) {
- DD -= thisWeek - dayRuleSup.value
+ DD -= thisWeek - dayRuleSup.value;
} else if (dayRuleSup.value > thisWeek) {
DD -= 7 - (dayRuleSup.value - thisWeek)
}
}
// 判断时间值是否小于10置换成“05”这种格式
- DD = DD < 10 ? '0' + DD : DD
+ DD = DD < 10 ? '0' + DD : DD;
// 循环“时”数组
goHour: for (let hi = hIdx; hi < hDate.length; hi++) {
let hh = hDate[hi] < 10 ? '0' + hDate[hi] : hDate[hi]
// 如果到达最大值时
if (nMin > mDate[mDate.length - 1]) {
- resetMin()
+ resetMin();
if (hi === hDate.length - 1) {
- resetHour()
+ resetHour();
if (Di === DDate.length - 1) {
- resetDay()
+ resetDay();
if (Mi === MDate.length - 1) {
- resetMonth()
- continue goYear
+ resetMonth();
+ continue goYear;
}
- continue goMonth
+ continue goMonth;
}
- continue goDay
+ continue goDay;
}
- continue
+ continue;
}
// 循环"分"数组
goMin: for (let mi = mIdx; mi < mDate.length; mi++) {
- let mm = mDate[mi] < 10 ? '0' + mDate[mi] : mDate[mi]
+ let mm = mDate[mi] < 10 ? '0' + mDate[mi] : mDate[mi];
// 如果到达最大值时
if (nSecond > sDate[sDate.length - 1]) {
- resetSecond()
+ resetSecond();
if (mi === mDate.length - 1) {
- resetMin()
+ resetMin();
if (hi === hDate.length - 1) {
- resetHour()
+ resetHour();
if (Di === DDate.length - 1) {
- resetDay()
+ resetDay();
if (Mi === MDate.length - 1) {
- resetMonth()
- continue goYear
+ resetMonth();
+ continue goYear;
}
- continue goMonth
+ continue goMonth;
}
- continue goDay
+ continue goDay;
}
- continue goHour
+ continue goHour;
}
- continue
+ continue;
}
// 循环"秒"数组
goSecond: for (let si = sIdx; si <= sDate.length - 1; si++) {
- let ss = sDate[si] < 10 ? '0' + sDate[si] : sDate[si]
+ let ss = sDate[si] < 10 ? '0' + sDate[si] : sDate[si];
// 添加当前时间(时间合法性在日期循环时已经判断)
if (MM !== '00' && DD !== '00') {
resultArr.push(YY + '-' + MM + '-' + DD + ' ' + hh + ':' + mm + ':' + ss)
- nums++
+ nums++;
}
// 如果条数满了就退出循环
- if (nums === 5) break goYear
+ if (nums === 5) break goYear;
// 如果到达最大值时
if (si === sDate.length - 1) {
- resetSecond()
+ resetSecond();
if (mi === mDate.length - 1) {
- resetMin()
+ resetMin();
if (hi === hDate.length - 1) {
- resetHour()
+ resetHour();
if (Di === DDate.length - 1) {
- resetDay()
+ resetDay();
if (Mi === MDate.length - 1) {
- resetMonth()
- continue goYear
+ resetMonth();
+ continue goYear;
}
- continue goMonth
+ continue goMonth;
}
- continue goDay
+ continue goDay;
}
- continue goHour
+ continue goHour;
}
- continue goMin
+ continue goMin;
}
} //goSecond
} //goMin
@@ -318,31 +318,31 @@ function expressionChange() {
}
// 判断100年内的结果条数
if (resultArr.length === 0) {
- resultList.value = ['没有达到条件的结果!']
+ resultList.value = ['没有达到条件的结果!'];
} else {
- resultList.value = resultArr
+ resultList.value = resultArr;
if (resultArr.length !== 5) {
resultList.value.push('最近100年内只有上面' + resultArr.length + '条结果!')
}
}
// 计算完成-显示结果
- isShow.value = true
+ isShow.value = true;
}
// 用于计算某位数字在数组中的索引
function getIndex(arr, value) {
if (value <= arr[0] || value > arr[arr.length - 1]) {
- return 0
+ return 0;
} else {
for (let i = 0; i < arr.length - 1; i++) {
if (value > arr[i] && value <= arr[i + 1]) {
- return i + 1
+ return i + 1;
}
}
}
}
// 获取"年"数组
function getYearArr(rule, year) {
- dateArr.value[5] = getOrderArr(year, year + 100)
+ dateArr.value[5] = getOrderArr(year, year + 100);
if (rule !== undefined) {
if (rule.indexOf('-') >= 0) {
dateArr.value[5] = getCycleArr(rule, year + 100, false)
@@ -355,7 +355,7 @@ function getYearArr(rule, year) {
}
// 获取"月"数组
function getMonthArr(rule) {
- dateArr.value[4] = getOrderArr(1, 12)
+ dateArr.value[4] = getOrderArr(1, 12);
if (rule.indexOf('-') >= 0) {
dateArr.value[4] = getCycleArr(rule, 12, false)
} else if (rule.indexOf('/') >= 0) {
@@ -369,58 +369,58 @@ function getWeekArr(rule) {
// 只有当日期规则的两个值均为“”时则表达日期是有选项的
if (dayRule.value === '' && dayRuleSup.value === '') {
if (rule.indexOf('-') >= 0) {
- dayRule.value = 'weekDay'
+ dayRule.value = 'weekDay';
dayRuleSup.value = getCycleArr(rule, 7, false)
} else if (rule.indexOf('#') >= 0) {
- dayRule.value = 'assWeek'
- let matchRule = rule.match(/[0-9]{1}/g)
- dayRuleSup.value = [Number(matchRule[1]), Number(matchRule[0])]
- dateArr.value[3] = [1]
+ dayRule.value = 'assWeek';
+ let matchRule = rule.match(/[0-9]{1}/g);
+ dayRuleSup.value = [Number(matchRule[1]), Number(matchRule[0])];
+ dateArr.value[3] = [1];
if (dayRuleSup.value[1] === 7) {
- dayRuleSup.value[1] = 0
+ dayRuleSup.value[1] = 0;
}
} else if (rule.indexOf('L') >= 0) {
- dayRule.value = 'lastWeek'
- dayRuleSup.value = Number(rule.match(/[0-9]{1,2}/g)[0])
- dateArr.value[3] = [31]
+ dayRule.value = 'lastWeek';
+ dayRuleSup.value = Number(rule.match(/[0-9]{1,2}/g)[0]);
+ dateArr.value[3] = [31];
if (dayRuleSup.value === 7) {
- dayRuleSup.value = 0
+ dayRuleSup.value = 0;
}
} else if (rule !== '*' && rule !== '?') {
- dayRule.value = 'weekDay'
+ dayRule.value = 'weekDay';
dayRuleSup.value = getAssignArr(rule)
}
}
}
// 获取"日"数组-少量为日期规则
function getDayArr(rule) {
- dateArr.value[3] = getOrderArr(1, 31)
- dayRule.value = ''
- dayRuleSup.value = ''
+ dateArr.value[3] = getOrderArr(1, 31);
+ dayRule.value = '';
+ dayRuleSup.value = '';
if (rule.indexOf('-') >= 0) {
dateArr.value[3] = getCycleArr(rule, 31, false)
- dayRuleSup.value = 'null'
+ dayRuleSup.value = 'null';
} else if (rule.indexOf('/') >= 0) {
dateArr.value[3] = getAverageArr(rule, 31)
- dayRuleSup.value = 'null'
+ dayRuleSup.value = 'null';
} else if (rule.indexOf('W') >= 0) {
- dayRule.value = 'workDay'
- dayRuleSup.value = Number(rule.match(/[0-9]{1,2}/g)[0])
- dateArr.value[3] = [dayRuleSup.value]
+ dayRule.value = 'workDay';
+ dayRuleSup.value = Number(rule.match(/[0-9]{1,2}/g)[0]);
+ dateArr.value[3] = [dayRuleSup.value];
} else if (rule.indexOf('L') >= 0) {
- dayRule.value = 'lastDay'
- dayRuleSup.value = 'null'
- dateArr.value[3] = [31]
+ dayRule.value = 'lastDay';
+ dayRuleSup.value = 'null';
+ dateArr.value[3] = [31];
} else if (rule !== '*' && rule !== '?') {
dateArr.value[3] = getAssignArr(rule)
- dayRuleSup.value = 'null'
+ dayRuleSup.value = 'null';
} else if (rule === '*') {
- dayRuleSup.value = 'null'
+ dayRuleSup.value = 'null';
}
}
// 获取"时"数组
function getHourArr(rule) {
- dateArr.value[2] = getOrderArr(0, 23)
+ dateArr.value[2] = getOrderArr(0, 23);
if (rule.indexOf('-') >= 0) {
dateArr.value[2] = getCycleArr(rule, 24, true)
} else if (rule.indexOf('/') >= 0) {
@@ -431,7 +431,7 @@ function getHourArr(rule) {
}
// 获取"分"数组
function getMinArr(rule) {
- dateArr.value[1] = getOrderArr(0, 59)
+ dateArr.value[1] = getOrderArr(0, 59);
if (rule.indexOf('-') >= 0) {
dateArr.value[1] = getCycleArr(rule, 60, true)
} else if (rule.indexOf('/') >= 0) {
@@ -442,7 +442,7 @@ function getMinArr(rule) {
}
// 获取"秒"数组
function getSecondArr(rule) {
- dateArr.value[0] = getOrderArr(0, 59)
+ dateArr.value[0] = getOrderArr(0, 59);
if (rule.indexOf('-') >= 0) {
dateArr.value[0] = getCycleArr(rule, 60, true)
} else if (rule.indexOf('/') >= 0) {
@@ -453,86 +453,86 @@ function getSecondArr(rule) {
}
// 根据传进来的min-max返回一个顺序的数组
function getOrderArr(min, max) {
- let arr = []
+ let arr = [];
for (let i = min; i <= max; i++) {
- arr.push(i)
+ arr.push(i);
}
- return arr
+ return arr;
}
// 根据规则中指定的零散值返回一个数组
function getAssignArr(rule) {
- let arr = []
- let assiginArr = rule.split(',')
+ let arr = [];
+ let assiginArr = rule.split(',');
for (let i = 0; i < assiginArr.length; i++) {
arr[i] = Number(assiginArr[i])
}
arr.sort(compare)
- return arr
+ return arr;
}
// 根据一定算术规则计算返回一个数组
function getAverageArr(rule, limit) {
- let arr = []
- let agArr = rule.split('/')
- let min = Number(agArr[0])
- let step = Number(agArr[1])
+ let arr = [];
+ let agArr = rule.split('/');
+ let min = Number(agArr[0]);
+ let step = Number(agArr[1]);
while (min <= limit) {
- arr.push(min)
- min += step
+ arr.push(min);
+ min += step;
}
- return arr
+ return arr;
}
// 根据规则返回一个具有周期性的数组
function getCycleArr(rule, limit, status) {
// status--表示是否从0开始(则从1开始)
- let arr = []
- let cycleArr = rule.split('-')
- let min = Number(cycleArr[0])
- let max = Number(cycleArr[1])
+ let arr = [];
+ let cycleArr = rule.split('-');
+ let min = Number(cycleArr[0]);
+ let max = Number(cycleArr[1]);
if (min > max) {
- max += limit
+ max += limit;
}
for (let i = min; i <= max; i++) {
- let add = 0
+ let add = 0;
if (status === false && i % limit === 0) {
- add = limit
+ add = limit;
}
arr.push(Math.round(i % limit + add))
}
arr.sort(compare)
- return arr
+ return arr;
}
// 比较数字大小(用于Array.sort)
function compare(value1, value2) {
if (value2 - value1 > 0) {
- return -1
+ return -1;
} else {
- return 1
+ return 1;
}
}
// 格式化日期格式如:2017-9-19 18:04:33
function formatDate(value, type) {
// 计算日期相关值
- let time = typeof value == 'number' ? new Date(value) : value
- let Y = time.getFullYear()
- let M = time.getMonth() + 1
- let D = time.getDate()
- let h = time.getHours()
- let m = time.getMinutes()
- let s = time.getSeconds()
- let week = time.getDay()
+ let time = typeof value == 'number' ? new Date(value) : value;
+ let Y = time.getFullYear();
+ let M = time.getMonth() + 1;
+ let D = time.getDate();
+ let h = time.getHours();
+ let m = time.getMinutes();
+ let s = time.getSeconds();
+ let week = time.getDay();
// 如果传递了type的话
if (type === undefined) {
- return Y + '-' + (M < 10 ? '0' + M : M) + '-' + (D < 10 ? '0' + D : D) + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s)
+ return Y + '-' + (M < 10 ? '0' + M : M) + '-' + (D < 10 ? '0' + D : D) + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s);
} else if (type === 'week') {
// 在quartz中 1为星期日
- return week + 1
+ return week + 1;
}
}
// 检查日期是否存在
function checkDate(value) {
- let time = new Date(value)
+ let time = new Date(value);
let format = formatDate(time)
- return value === format
+ return value === format;
}
onMounted(() => {
expressionChange()
diff --git a/src/components/Crontab/year.vue b/src/components/Crontab/year.vue
index 14758ba..fa921ae 100644
--- a/src/components/Crontab/year.vue
+++ b/src/components/Crontab/year.vue
@@ -61,24 +61,22 @@ const props = defineProps({
}
}
})
-
-const fullYear = Number(new Date().getFullYear())
-const maxFullYear = fullYear + 10
+const fullYear = ref(0)
+const maxFullYear = ref(0)
const radioValue = ref(1)
-const cycle01 = ref(fullYear)
-const cycle02 = ref(fullYear + 1)
-const average01 = ref(fullYear)
+const cycle01 = ref(0)
+const cycle02 = ref(0)
+const average01 = ref(0)
const average02 = ref(1)
const checkboxList = ref([])
-const checkCopy = ref([fullYear])
-
+const checkCopy = ref([])
const cycleTotal = computed(() => {
- cycle01.value = props.check(cycle01.value, fullYear, maxFullYear - 1)
- cycle02.value = props.check(cycle02.value, cycle01.value + 1, maxFullYear)
+ cycle01.value = props.check(cycle01.value, fullYear.value, maxFullYear.value - 1)
+ cycle02.value = props.check(cycle02.value, cycle01.value + 1, maxFullYear.value)
return cycle01.value + '-' + cycle02.value
})
const averageTotal = computed(() => {
- average01.value = props.check(average01.value, fullYear, maxFullYear - 1)
+ average01.value = props.check(average01.value, fullYear.value, maxFullYear.value - 1)
average02.value = props.check(average02.value, 1, 10)
return average01.value + '/' + average02.value
})
@@ -99,8 +97,8 @@ function changeRadioValue(value) {
radioValue.value = 3
} else if (value.indexOf("/") > -1) {
const indexArr = value.split('/')
- average01.value = Number(indexArr[0])
- average02.value = Number(indexArr[1])
+ average01.value = Number(indexArr[1])
+ average02.value = Number(indexArr[0])
radioValue.value = 4
} else {
checkboxList.value = [...new Set(value.split(',').map(item => Number(item)))]
@@ -131,6 +129,14 @@ function onRadioChange() {
break
}
}
+onMounted(() => {
+ fullYear.value = Number(new Date().getFullYear())
+ maxFullYear.value = fullYear.value + 10
+ cycle01.value = fullYear.value
+ cycle02.value = cycle01.value + 1
+ average01.value = fullYear.value
+ checkCopy.value = [fullYear.value]
+})
+
\ No newline at end of file
diff --git a/src/components/IconSelect/index.vue b/src/components/IconSelect/index.vue
index b527b7d..517a4af 100644
--- a/src/components/IconSelect/index.vue
+++ b/src/components/IconSelect/index.vue
@@ -30,11 +30,11 @@ const props = defineProps({
activeIcon: {
type: String
}
-})
+});
-const iconName = ref('')
-const iconList = ref(icons)
-const emit = defineEmits(['selected'])
+const iconName = ref('');
+const iconList = ref(icons);
+const emit = defineEmits(['selected']);
function filterIcons() {
iconList.value = icons
diff --git a/src/components/IconSelect/requireIcons.js b/src/components/IconSelect/requireIcons.js
index 36b7539..ac22fd7 100644
--- a/src/components/IconSelect/requireIcons.js
+++ b/src/components/IconSelect/requireIcons.js
@@ -1,8 +1,8 @@
let icons = []
-const modules = import.meta.glob('./../../assets/icons/svg/*.svg')
+const modules = import.meta.glob('./../../assets/icons/svg/*.svg');
for (const path in modules) {
- const p = path.split('assets/icons/svg/')[1].split('.svg')[0]
- icons.push(p)
+ const p = path.split('assets/icons/svg/')[1].split('.svg')[0];
+ icons.push(p);
}
export default icons
\ No newline at end of file
diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue
index acd05c5..7e3d2b6 100644
--- a/src/components/ImagePreview/index.vue
+++ b/src/components/ImagePreview/index.vue
@@ -15,7 +15,7 @@
\ No newline at end of file
diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue
index 56569f7..11d4caf 100644
--- a/src/components/Pagination/index.vue
+++ b/src/components/Pagination/index.vue
@@ -59,7 +59,7 @@ const props = defineProps({
}
})
-const emit = defineEmits()
+const emit = defineEmits();
const currentPage = computed({
get() {
return props.page
@@ -76,7 +76,6 @@ const pageSize = computed({
emit('update:limit', val)
}
})
-
function handleSizeChange(val) {
if (currentPage.value * val > props.total) {
currentPage.value = 1
@@ -86,13 +85,13 @@ function handleSizeChange(val) {
scrollTo(0, 800)
}
}
-
function handleCurrentChange(val) {
emit('pagination', { page: val, limit: pageSize.value })
if (props.autoScroll) {
scrollTo(0, 800)
}
}
+
diff --git a/src/components/RuoYi/Doc/index.vue b/src/components/RuoYi/Doc/index.vue
deleted file mode 100644
index 8355592..0000000
--- a/src/components/RuoYi/Doc/index.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/components/RuoYi/Git/index.vue b/src/components/RuoYi/Git/index.vue
deleted file mode 100644
index 648dde1..0000000
--- a/src/components/RuoYi/Git/index.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue
index 464d976..7ad28ea 100644
--- a/src/components/Screenfull/index.vue
+++ b/src/components/Screenfull/index.vue
@@ -7,7 +7,7 @@
diff --git a/src/components/iFrame/index.vue b/src/components/iFrame/index.vue
index 0eabaa4..091b1a2 100644
--- a/src/components/iFrame/index.vue
+++ b/src/components/iFrame/index.vue
@@ -22,10 +22,10 @@ const url = computed(() => props.src)
onMounted(() => {
setTimeout(() => {
- loading.value = false
- }, 300)
+ loading.value = false;
+ }, 300);
window.onresize = function temp() {
- height.value = document.documentElement.clientHeight - 94.5 + "px;"
- }
+ height.value = document.documentElement.clientHeight - 94.5 + "px;";
+ };
})
diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue
index 45de603..e261ef4 100644
--- a/src/layout/components/AppMain.vue
+++ b/src/layout/components/AppMain.vue
@@ -8,12 +8,10 @@
-
-
-
\ No newline at end of file
diff --git a/src/layout/components/IframeToggle/index.vue b/src/layout/components/IframeToggle/index.vue
index 9245b7f..a407b74 100644
--- a/src/layout/components/IframeToggle/index.vue
+++ b/src/layout/components/IframeToggle/index.vue
@@ -9,17 +9,17 @@
diff --git a/src/layout/components/InnerLink/index.vue b/src/layout/components/InnerLink/index.vue
index 0b43aab..53a903c 100644
--- a/src/layout/components/InnerLink/index.vue
+++ b/src/layout/components/InnerLink/index.vue
@@ -1,10 +1,9 @@
-
+
@@ -19,17 +18,7 @@ const props = defineProps({
iframeId: {
type: String
}
-})
+});
-const loading = ref(true)
-const height = ref(document.documentElement.clientHeight - 94.5 + 'px')
-const iframeRef = ref(null)
-
-onMounted(() => {
- if (iframeRef.value) {
- iframeRef.value.onload = () => {
- loading.value = false
- }
- }
-})
+const height = ref(document.documentElement.clientHeight - 94.5 + "px");
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 0796120..a921d22 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -1,25 +1,13 @@
-
+
-
-
-
-
-
-
+
+
@@ -61,14 +50,10 @@
import { ElMessageBox } from 'element-plus'
import Breadcrumb from '@/components/Breadcrumb'
import TopNav from '@/components/TopNav'
-import TopBar from './TopBar'
-import Logo from './Sidebar/Logo'
import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
import HeaderSearch from '@/components/HeaderSearch'
-import RuoYiGit from '@/components/RuoYi/Git'
-import RuoYiDoc from '@/components/RuoYi/Doc'
import useAppStore from '@/store/modules/app'
import useUserStore from '@/store/modules/user'
import useSettingsStore from '@/store/modules/settings'
@@ -84,13 +69,13 @@ function toggleSideBar() {
function handleCommand(command) {
switch (command) {
case "setLayout":
- setLayout()
- break
+ setLayout();
+ break;
case "logout":
- logout()
- break
+ logout();
+ break;
default:
- break
+ break;
}
}
@@ -101,85 +86,36 @@ function logout() {
type: 'warning'
}).then(() => {
userStore.logOut().then(() => {
- location.href = '/index'
+ location.href = '/index';
})
- }).catch(() => { })
+ }).catch(() => { });
}
const emits = defineEmits(['setLayout'])
function setLayout() {
- emits('setLayout')
+ emits('setLayout');
}
-async function toggleTheme(event) {
- const x = event?.clientX || window.innerWidth / 2
- const y = event?.clientY || window.innerHeight / 2
- const wasDark = settingsStore.isDark
-
- const isReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches
- const isSupported = document.startViewTransition && !isReducedMotion
-
- if (!isSupported) {
- settingsStore.toggleTheme()
- return
- }
-
- try {
- const transition = document.startViewTransition(async () => {
- await new Promise((resolve) => setTimeout(resolve, 10))
- settingsStore.toggleTheme()
- await nextTick()
- })
- await transition.ready
-
- const endRadius = Math.hypot(Math.max(x, window.innerWidth - x), Math.max(y, window.innerHeight - y))
- const clipPath = [`circle(0px at ${x}px ${y}px)`, `circle(${endRadius}px at ${x}px ${y}px)`]
- document.documentElement.animate(
- {
- clipPath: !wasDark ? [...clipPath].reverse() : clipPath
- }, {
- duration: 650,
- easing: "cubic-bezier(0.4, 0, 0.2, 1)",
- fill: "forwards",
- pseudoElement: !wasDark ? "::view-transition-old(root)" : "::view-transition-new(root)"
- }
- )
- await transition.finished
- } catch (error) {
- console.warn("View transition failed, falling back to immediate toggle:", error)
- settingsStore.toggleTheme()
- }
+function toggleTheme() {
+ settingsStore.toggleTheme()
}
\ No newline at end of file
diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue
index 680c30a..05387bc 100644
--- a/src/layout/components/Sidebar/Logo.vue
+++ b/src/layout/components/Sidebar/Logo.vue
@@ -25,34 +25,30 @@ defineProps({
}
})
-const title = import.meta.env.VITE_APP_TITLE
-const settingsStore = useSettingsStore()
-const sideTheme = computed(() => settingsStore.sideTheme)
+const title = import.meta.env.VITE_APP_TITLE;
+const settingsStore = useSettingsStore();
+const sideTheme = computed(() => settingsStore.sideTheme);
// 获取Logo背景色
const getLogoBackground = computed(() => {
if (settingsStore.isDark) {
- return 'var(--sidebar-bg)'
+ return 'var(--sidebar-bg)';
}
- if (settingsStore.navType == 3) {
- return variables.menuLightBg
- }
- return sideTheme.value === 'theme-dark' ? variables.menuBg : variables.menuLightBg
-})
+ return sideTheme.value === 'theme-dark' ? variables.menuBg : variables.menuLightBg;
+});
// 获取Logo文字颜色
const getLogoTextColor = computed(() => {
if (settingsStore.isDark) {
- return 'var(--sidebar-text)'
+ return 'var(--sidebar-text)';
}
- if (settingsStore.navType == 3) {
- return variables.menuLightText
- }
- return sideTheme.value === 'theme-dark' ? '#fff' : variables.menuLightText
-})
+ return sideTheme.value === 'theme-dark' ? '#fff' : variables.menuLightText;
+});
diff --git a/src/layout/index.vue b/src/layout/index.vue
index a78d23f..bad8dae 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -17,16 +17,18 @@
import { useWindowSize } from '@vueuse/core'
import Sidebar from './components/Sidebar/index.vue'
import { AppMain, Navbar, Settings, TagsView } from './components'
+import defaultSettings from '@/settings'
+
import useAppStore from '@/store/modules/app'
import useSettingsStore from '@/store/modules/settings'
const settingsStore = useSettingsStore()
-const theme = computed(() => settingsStore.theme)
-const sideTheme = computed(() => settingsStore.sideTheme)
-const sidebar = computed(() => useAppStore().sidebar)
-const device = computed(() => useAppStore().device)
-const needTagsView = computed(() => settingsStore.tagsView)
-const fixedHeader = computed(() => settingsStore.fixedHeader)
+const theme = computed(() => settingsStore.theme);
+const sideTheme = computed(() => settingsStore.sideTheme);
+const sidebar = computed(() => useAppStore().sidebar);
+const device = computed(() => useAppStore().device);
+const needTagsView = computed(() => settingsStore.tagsView);
+const fixedHeader = computed(() => settingsStore.fixedHeader);
const classObj = computed(() => ({
hideSidebar: !sidebar.value.opened,
@@ -35,8 +37,8 @@ const classObj = computed(() => ({
mobile: device.value === 'mobile'
}))
-const { width, height } = useWindowSize()
-const WIDTH = 992 // refer to Bootstrap's responsive design
+const { width, height } = useWindowSize();
+const WIDTH = 992; // refer to Bootstrap's responsive design
watch(() => device.value, () => {
if (device.value === 'mobile' && sidebar.value.opened) {
@@ -57,18 +59,18 @@ function handleClickOutside() {
useAppStore().closeSideBar({ withoutAnimation: false })
}
-const settingRef = ref(null)
+const settingRef = ref(null);
function setLayout() {
- settingRef.value.openSetting()
+ settingRef.value.openSetting();
}