From 4402bf26bc530ad97fb69dce76b200260ecbe2f9 Mon Sep 17 00:00:00 2001
From: "Ray.Hao" <1490493387@qq.com>
Date: Fri, 11 Sep 2026 18:35:37 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=BB=9F=E4=B8=80=E5=91=BD?=
=?UTF-8?q?=E5=90=8D=E4=B8=8E=E4=B8=BB=E9=A2=98=E8=89=B2=EF=BC=8C=E6=88=91?=
=?UTF-8?q?=E7=9A=84=E9=A1=B5=E5=90=88=E5=B9=B6=E8=AE=BE=E7=BD=AE=E5=85=A5?=
=?UTF-8?q?=E5=8F=A3=E4=B8=8E=E7=BC=93=E5=AD=98=E6=B8=85=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.cursorrules | 99 -------
.gitattributes | 27 +-
.gitignore | 1 +
LICENSE | 42 +--
eslint.config.mjs | 2 +-
package.json | 2 +-
src/api/auth.ts | 32 +--
src/api/dict.ts | 4 +-
src/api/file.ts | 4 +-
src/api/role.ts | 6 +-
src/api/user.ts | 2 +-
src/components/app-provider/index.vue | 29 +-
src/components/custom-navbar/index.vue | 9 +-
.../qiun-data-charts/qiun-data-charts.vue | 15 +-
src/components/qiun-loading/loading1.vue | 8 +-
src/components/qiun-loading/loading2.vue | 8 +-
src/components/qiun-loading/loading3.vue | 8 +-
src/components/qiun-loading/loading4.vue | 8 +-
src/components/qiun-loading/loading5.vue | 8 +-
src/composables/useCacheCleaner.ts | 55 ++++
src/composables/useCountdown.ts | 21 +-
src/composables/useLogout.ts | 22 ++
src/composables/useNavbar.ts | 15 +-
src/composables/usePagedList.ts | 103 +++++---
.../{useSmsCode.ts => useSmsLoginCode.ts} | 23 +-
src/composables/useTheme.ts | 24 +-
src/config/index.ts | 2 +-
src/config/{menu.ts => work-menu.ts} | 6 +-
src/constants/index.ts | 23 +-
src/constants/permissions.ts | 9 +
src/constants/storage-keys.ts | 16 ++
src/main.ts | 9 +-
src/pages/index/index.vue | 249 ++++++++----------
.../login/components/bind-mobile-popup.vue | 22 +-
src/pages/login/index.vue | 132 ++++++----
src/pages/mine/components/community-card.vue | 24 +-
src/pages/mine/components/menu-section.vue | 27 +-
src/pages/mine/components/profile-card.vue | 80 +++---
src/pages/mine/components/quick-cards.vue | 2 +-
src/pages/mine/index.vue | 201 ++++++--------
src/pages/work/index.vue | 8 +-
src/router/index.ts | 4 +-
src/static/icons/api.svg | 16 +-
src/static/icons/git.svg | 1 -
src/static/icons/{tree.svg => menu.svg} | 23 +-
src/static/icons/repo.svg | 10 +
src/store/index.ts | 12 +-
src/store/modules/theme.ts | 75 +++---
src/store/modules/user.ts | 121 ++++-----
src/styles/index.scss | 44 +++-
src/styles/theme.scss | 195 ++++++--------
src/subPages/mine/about/index.vue | 84 +++---
src/subPages/mine/account/index.vue | 202 +++++++-------
src/subPages/mine/official/index.vue | 21 +-
.../mine/profile/complete-profile/index.vue | 47 ++--
src/subPages/mine/profile/index.vue | 142 +++++-----
src/subPages/mine/scan-confirm/index.vue | 18 +-
.../mine/settings/agreement/index.vue | 13 +-
src/subPages/mine/settings/index.vue | 211 ---------------
src/subPages/mine/settings/network/index.vue | 51 +---
src/subPages/mine/settings/privacy/index.vue | 13 +-
src/subPages/mine/settings/theme/index.vue | 57 ++--
src/subPages/work/components/custom-tree.vue | 6 +-
src/subPages/work/config/index.vue | 24 +-
src/subPages/work/dept/index.vue | 35 +--
src/subPages/work/dict/index.vue | 24 +-
src/subPages/work/dict/item/index.vue | 28 +-
src/subPages/work/log/index.vue | 21 +-
src/subPages/work/menu/index.vue | 19 +-
src/subPages/work/notice/index.vue | 30 +--
src/subPages/work/role/assign-perm/index.vue | 16 +-
src/subPages/work/role/index.vue | 26 +-
src/subPages/work/user/index.vue | 82 ++++--
src/theme.json | 4 +-
src/types/global.d.ts | 4 +-
src/utils/auth.ts | 15 +-
src/utils/{index.ts => error.ts} | 2 +-
src/utils/form-schema.ts | 80 ++++++
src/utils/form.ts | 36 ---
src/utils/permission.ts | 2 +-
src/utils/request.ts | 24 +-
src/utils/storage.ts | 56 ++++
unocss.config.ts | 16 +-
83 files changed, 1517 insertions(+), 1780 deletions(-)
delete mode 100644 .cursorrules
create mode 100644 src/composables/useCacheCleaner.ts
create mode 100644 src/composables/useLogout.ts
rename src/composables/{useSmsCode.ts => useSmsLoginCode.ts} (51%)
rename src/config/{menu.ts => work-menu.ts} (94%)
create mode 100644 src/constants/permissions.ts
create mode 100644 src/constants/storage-keys.ts
delete mode 100644 src/static/icons/git.svg
rename src/static/icons/{tree.svg => menu.svg} (60%)
create mode 100644 src/static/icons/repo.svg
delete mode 100644 src/subPages/mine/settings/index.vue
rename src/utils/{index.ts => error.ts} (99%)
create mode 100644 src/utils/form-schema.ts
delete mode 100644 src/utils/form.ts
diff --git a/.cursorrules b/.cursorrules
deleted file mode 100644
index 4f52b82..0000000
--- a/.cursorrules
+++ /dev/null
@@ -1,99 +0,0 @@
-## 样式(CSS/SCSS)与 UnoCSS 使用规范(Cursor Rules)
-
-目标:在不牺牲可读性的前提下最大化复用,减少冗余,保证小程序/H5 多端一致、整洁大方。
-
-### 1) 总原则
-- 优先使用 UnoCSS 工具类与已定义的 shortcuts,避免重复造轮子。
-- 同一工具类组合在同一页面或多个页面中出现 ≥ 2 次时,提取为“语义化类名”。
-- 禁止使用 `@apply`,禁止在 SCSS 中重复定义 UnoCSS 已提供的工具类或在 `unocss.config.ts` 中已存在的 shortcuts(如:`flex`、`flex-start`、`flex-between`、`flex-col-center` 等)。
-- 组件库样式覆盖和页面布局样式分离:页面/组件的布局与样式用普通类,覆盖 wot 组件样式用“外部样式类”。
-
-### 2) 目录与作用域
-- 页面私有样式:写在当前 `.vue` 的 `
diff --git a/src/pages/login/components/bind-mobile-popup.vue b/src/pages/login/components/bind-mobile-popup.vue
index 66ac9c2..132c450 100644
--- a/src/pages/login/components/bind-mobile-popup.vue
+++ b/src/pages/login/components/bind-mobile-popup.vue
@@ -6,7 +6,7 @@
custom-class="popup-bottom"
@close="handleClose"
>
-
+
绑定手机号
@@ -61,9 +61,9 @@ export default {
diff --git a/src/pages/work/index.vue b/src/pages/work/index.vue
index d76bceb..3a27f9a 100644
--- a/src/pages/work/index.vue
+++ b/src/pages/work/index.vue
@@ -13,10 +13,10 @@
use-slot
@click="handleNavClick(child)"
>
-
+
- {{ child.title }}
+ {{ child.title }}
@@ -28,7 +28,7 @@
diff --git a/src/subPages/mine/scan-confirm/index.vue b/src/subPages/mine/scan-confirm/index.vue
index 80a6c0e..2dd61b6 100644
--- a/src/subPages/mine/scan-confirm/index.vue
+++ b/src/subPages/mine/scan-confirm/index.vue
@@ -32,9 +32,8 @@
diff --git a/src/subPages/mine/settings/index.vue b/src/subPages/mine/settings/index.vue
deleted file mode 100644
index d639324..0000000
--- a/src/subPages/mine/settings/index.vue
+++ /dev/null
@@ -1,211 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 退出登录
-
-
-
-
-
-
-
-
-
-
diff --git a/src/subPages/mine/settings/network/index.vue b/src/subPages/mine/settings/network/index.vue
index 83f3cd6..2db3a7a 100644
--- a/src/subPages/mine/settings/network/index.vue
+++ b/src/subPages/mine/settings/network/index.vue
@@ -1,12 +1,12 @@
-
+
温馨提示:点击下方「开始测试」按钮,即可自动检测当前网络延迟。
-
+
开始测试
@@ -15,16 +15,16 @@
正在测试中...
-
+
网络延迟
- {{ result }}ms
+ {{ result }}ms
网络状态
- {{ statusText }}
+ {{ statusText }}
@@ -36,7 +36,7 @@ import { onLoad } from "@dcloudio/uni-app";
definePage({
name: "network",
- style: { navigationBarTitleText: "网络测试" },
+ style: { navigationBarTitleText: "网络检测" },
});
const result = ref(null);
@@ -92,7 +92,7 @@ onLoad(() => {
diff --git a/src/subPages/mine/settings/privacy/index.vue b/src/subPages/mine/settings/privacy/index.vue
index 982a996..44fdc27 100644
--- a/src/subPages/mine/settings/privacy/index.vue
+++ b/src/subPages/mine/settings/privacy/index.vue
@@ -7,13 +7,13 @@
:title="section.title"
:name="String(index)"
>
-
+
{{ section.content }}
-
+
我已阅读并同意
@@ -86,18 +86,9 @@ const handleAgree = () => {
diff --git a/src/subPages/mine/settings/theme/index.vue b/src/subPages/mine/settings/theme/index.vue
index 58786f6..c3117ff 100644
--- a/src/subPages/mine/settings/theme/index.vue
+++ b/src/subPages/mine/settings/theme/index.vue
@@ -17,12 +17,12 @@
v-for="(color, index) in themeColorOptions"
:key="index"
class="color-option"
- :class="{ 'color-option--active': currentThemeColor === color.primary }"
+ :class="{ 'color-option--active': currentPrimaryColor === color.primary }"
:style="{ backgroundColor: color.primary }"
@click="handleSelectColor(color)"
>
-
- {{ currentThemeColor }}
+
+ {{ currentPrimaryColor }}
@@ -54,9 +57,9 @@
-
+
主要按钮
-
+
主题色文本
标签
@@ -87,10 +90,13 @@
请输入十六进制颜色值
-
+
@@ -117,13 +123,8 @@ definePage({
});
// 使用主题组合函数
-const {
- isDark,
- themeColorOptions,
- toggleTheme,
- setThemeColor,
- currentThemeColor: currentTheme,
-} = useTheme();
+const { isDark, themeColorOptions, toggleThemeMode, setThemeColor, selectedThemeColor } =
+ useTheme();
const toast = useToast();
const { confirm } = useDialog();
@@ -133,7 +134,7 @@ const customColor = ref("");
const showCustomColorInput = ref(false);
// 当前生效的主题色主色
-const currentThemeColor = computed(() => currentTheme.value.primary);
+const currentPrimaryColor = computed(() => selectedThemeColor.value.primary);
// 选择预设颜色
const handleSelectColor = (color: (typeof themeColorOptions)[0]) => {
@@ -145,7 +146,7 @@ const handleSelectColor = (color: (typeof themeColorOptions)[0]) => {
// 显示自定义颜色输入
const showCustomInput = () => {
showCustomColorInput.value = true;
- customColor.value = currentThemeColor.value;
+ customColor.value = currentPrimaryColor.value;
};
// 应用自定义颜色
@@ -182,13 +183,13 @@ const handleResetTheme = async () => {
// 切换暗黑模式
const handleToggleDarkMode = () => {
- toggleTheme();
+ toggleThemeMode();
toast.success(`已切换到${isDark.value ? "暗黑" : "浅色"}模式`);
};
// 页面显示时同步输入框回显(首次进入同样触发)
onShow(() => {
- customColor.value = currentThemeColor.value;
+ customColor.value = currentPrimaryColor.value;
});
@@ -208,19 +209,6 @@ onShow(() => {
}
}
-.color-dot {
- width: 32rpx;
- height: 32rpx;
- border-radius: 50%;
-}
-
-.color-dot-lg {
- flex-shrink: 0;
- width: 48rpx;
- height: 48rpx;
- border-radius: 8rpx;
-}
-
.popup-content {
padding-bottom: env(safe-area-inset-bottom);
}
@@ -246,8 +234,9 @@ onShow(() => {
border-top: 1rpx solid var(--color-border);
}
+// 自定义颜色输入框:跟随项目填充色与文字色(wot 默认 filled-oppo / text-main)
:deep(.theme-input) {
- color: var(--color-text) !important;
- background-color: var(--color-bg-secondary) !important;
+ --wot-input-bg: var(--color-fill-1);
+ --wot-input-inner-color: var(--color-text);
}
diff --git a/src/subPages/work/components/custom-tree.vue b/src/subPages/work/components/custom-tree.vue
index 28c1479..ae02a29 100644
--- a/src/subPages/work/components/custom-tree.vue
+++ b/src/subPages/work/components/custom-tree.vue
@@ -331,7 +331,7 @@ watch(
diff --git a/src/subPages/work/dict/index.vue b/src/subPages/work/dict/index.vue
index 52fb907..03f3eeb 100644
--- a/src/subPages/work/dict/index.vue
+++ b/src/subPages/work/dict/index.vue
@@ -10,12 +10,7 @@
-
+
@@ -40,8 +35,8 @@
-
-
+
+
-
- 新增
+
@@ -104,7 +98,7 @@
-
-
diff --git a/src/subPages/work/notice/index.vue b/src/subPages/work/notice/index.vue
index d83557e..760d49b 100644
--- a/src/subPages/work/notice/index.vue
+++ b/src/subPages/work/notice/index.vue
@@ -1,4 +1,4 @@
-
+
-
+
@@ -41,7 +36,7 @@
-
+
{{ getLevelText(item.level) }}
@@ -61,8 +56,8 @@
-
-
+
+
@@ -86,7 +81,7 @@
-
+