mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-09 13:53:38 +08:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d203222acf | ||
|
|
07ad01ebee | ||
|
|
ed71fe708d | ||
|
|
29b06c5285 | ||
|
|
9ad00d97ee | ||
|
|
a402d33b89 | ||
|
|
d1d2bcaa11 | ||
|
|
abd042afe8 | ||
|
|
cd42dbf188 | ||
|
|
4cbf9056b1 | ||
|
|
5d3a9dff46 | ||
|
|
dbb05f4166 | ||
|
|
ea36e260e2 | ||
|
|
a5b57908ec | ||
|
|
699b174f95 | ||
|
|
0934c97413 | ||
|
|
0dc979eec0 | ||
|
|
7ed0e8f89f | ||
|
|
332678ba88 | ||
|
|
296db3789b | ||
|
|
c0a1b918aa | ||
|
|
bf874276f3 | ||
|
|
f120467fc8 | ||
|
|
8d2ef1f644 | ||
|
|
fcd0fc9d65 | ||
|
|
d685a18b9e | ||
|
|
e0f52fc379 | ||
|
|
53e3e601fb | ||
|
|
adc82644cb | ||
|
|
ee89a864db | ||
|
|
75fad304e7 |
@@ -1,13 +0,0 @@
|
|||||||
public
|
|
||||||
dist
|
|
||||||
*.d.ts
|
|
||||||
/src/assets
|
|
||||||
package.json
|
|
||||||
eslint.config.js
|
|
||||||
.prettierrc.js
|
|
||||||
commitlint.config.js
|
|
||||||
postcss.config.js
|
|
||||||
tailwind.config.ts
|
|
||||||
stylelint.config.js
|
|
||||||
src/components/ReSplitPane/iconfont
|
|
||||||
src/components/ReFlowChart/src/assets/iconfont
|
|
||||||
10
.github/workflows/linter.yml
vendored
10
.github/workflows/linter.yml
vendored
@@ -13,14 +13,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 20
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v3
|
||||||
name: Install pnpm
|
name: Install pnpm
|
||||||
id: pnpm-install
|
id: pnpm-install
|
||||||
with:
|
with:
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v4
|
||||||
name: Setup pnpm cache
|
name: Setup pnpm cache
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||||
|
|||||||
@@ -1,3 +1,33 @@
|
|||||||
|
# 5.4.0 (2024-04-18)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- Add global disabled attribute `disabled` to `ReSegmented` component
|
||||||
|
- Added mind map examples
|
||||||
|
- Functional pop-up box `ReDialog` adds `Popconfirm` bubble confirmation box
|
||||||
|
- `pure-table` adds `headerSlot` custom header slot usage example
|
||||||
|
- The route adds a configurable `fixedTag` attribute, which determines whether the current menu name is fixedly displayed on the tab and cannot be closed.
|
||||||
|
- Added account setting function page and compatible with mobile terminals
|
||||||
|
- Upgrade `eslint9` and related compatibility processing
|
||||||
|
- Added global configuration `MaxTagsLevel` property to set the maximum number of open tabs
|
||||||
|
- Full coverage of the internationalization of the core code of the framework (only the internationalization of the business code needs to be processed)
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- Fixed the issue where columns cannot be dragged normally when there are multiple `RePureTableBar` components on a page
|
||||||
|
- Fixed the problem of icon display style after the third-level menu is folded to the left
|
||||||
|
- Fixed the issue where the font color does not take effect after refreshing the account settings page
|
||||||
|
- Fixed the issue where the `refreshToken` parameter is empty when calling the refresh `token` interface
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- Optimize login interface
|
||||||
|
- Optimize the logic of obtaining the top menu
|
||||||
|
- Optimize request whitelist logic and be compatible with more scenarios
|
||||||
|
- Simplified export and import usage in `store` files
|
||||||
|
- Removed unnecessary `cloc` tool dependency package, which uses the `GPL` open source license and is controversial
|
||||||
|
- Optimize the types of `post` and `get` utility functions in `src/utils/http` files
|
||||||
|
|
||||||
# 5.3.0 (2024-03-28)
|
# 5.3.0 (2024-03-28)
|
||||||
|
|
||||||
### ✔️ refactor
|
### ✔️ refactor
|
||||||
|
|||||||
30
CHANGELOG.md
30
CHANGELOG.md
@@ -1,3 +1,33 @@
|
|||||||
|
# 5.4.0 (2024-04-18)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- Add global disabled attribute `disabled` to `ReSegmented` component
|
||||||
|
- Added mind map examples
|
||||||
|
- Functional pop-up box `ReDialog` adds `Popconfirm` bubble confirmation box
|
||||||
|
- `pure-table` adds `headerSlot` custom header slot usage example
|
||||||
|
- The route adds a configurable `fixedTag` attribute, which determines whether the current menu name is fixedly displayed on the tab and cannot be closed.
|
||||||
|
- Added account setting function page and compatible with mobile terminals
|
||||||
|
- Upgrade `eslint9` and related compatibility processing
|
||||||
|
- Added global configuration `MaxTagsLevel` property to set the maximum number of open tabs
|
||||||
|
- Full coverage of the internationalization of the core code of the framework (only the internationalization of the business code needs to be processed)
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- Fixed the issue where columns cannot be dragged normally when there are multiple `RePureTableBar` components on a page
|
||||||
|
- Fixed the problem of icon display style after the third-level menu is folded to the left
|
||||||
|
- Fixed the issue where the font color does not take effect after refreshing the account settings page
|
||||||
|
- Fixed the issue where the `refreshToken` parameter is empty when calling the refresh `token` interface
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- Optimize login interface
|
||||||
|
- Optimize the logic of obtaining the top menu
|
||||||
|
- Optimize request whitelist logic and be compatible with more scenarios
|
||||||
|
- Simplified export and import usage in `store` files
|
||||||
|
- Removed unnecessary `cloc` tool dependency package, which uses the `GPL` open source license and is controversial
|
||||||
|
- Optimize the types of `post` and `get` utility functions in `src/utils/http` files
|
||||||
|
|
||||||
# 5.3.0 (2024-03-28)
|
# 5.3.0 (2024-03-28)
|
||||||
|
|
||||||
### ✔️ refactor
|
### ✔️ refactor
|
||||||
|
|||||||
@@ -1,3 +1,33 @@
|
|||||||
|
# 5.4.0 (2024-04-18)
|
||||||
|
|
||||||
|
### 🎫 Feat
|
||||||
|
|
||||||
|
- 分段控制器组件添加全局禁用属性`disabled`
|
||||||
|
- 添加思维导图示例
|
||||||
|
- 函数式弹框`ReDialog`添加`Popconfirm`气泡确认框
|
||||||
|
- `pure-table`添加`headerSlot`自定义表头插槽用法示例
|
||||||
|
- 路由添加可配置的`fixedTag`属性,作用为当前菜单名称是否固定显示在标签页且不可关闭
|
||||||
|
- 添加账户设置功能页面且兼容移动端
|
||||||
|
- 升级`eslint9`,相关兼容处理
|
||||||
|
- 添加全局配置`MaxTagsLevel`属性,可设置打开标签页最大数
|
||||||
|
- 框架核心代码国际化全量覆盖(仅需处理业务代码国际化即可)
|
||||||
|
|
||||||
|
### 🐞 Bug fixes
|
||||||
|
|
||||||
|
- 修复当一个页面存在多个`RePureTableBar`组件,列无法正常拖动问题
|
||||||
|
- 修复三级菜单向左折叠后图标显示样式问题
|
||||||
|
- 修复账户设置页面,刷新后字体颜色未生效的问题
|
||||||
|
- 修复调用刷新`token`接口时,`refreshToken`参数为空的问题
|
||||||
|
|
||||||
|
### 🍏 Perf
|
||||||
|
|
||||||
|
- 优化登录接口
|
||||||
|
- 优化获取顶级菜单逻辑
|
||||||
|
- 优化请求白名单逻辑,兼容更多场景
|
||||||
|
- 简化`store`文件中导出和导入用法
|
||||||
|
- 移除非必要的`cloc`工具依赖包,它使用`GPL`开源许可证具有争议性
|
||||||
|
- 优化`src/utils/http`文件中`post`和`get`工具函数的类型
|
||||||
|
|
||||||
# 5.3.0 (2024-03-28)
|
# 5.3.0 (2024-03-28)
|
||||||
|
|
||||||
### ✔️ refactor
|
### ✔️ refactor
|
||||||
@@ -41,7 +71,7 @@
|
|||||||
- 修复`windwos`下点击注册页面会出现滚动条问题
|
- 修复`windwos`下点击注册页面会出现滚动条问题
|
||||||
- 修复`windows`下页面切换,内容区会出现滚动条问题
|
- 修复`windows`下页面切换,内容区会出现滚动条问题
|
||||||
- 修复`pure-table`带状态表格在深色整体风格下状态样式消失的问题
|
- 修复`pure-table`带状态表格在深色整体风格下状态样式消失的问题
|
||||||
- 修复项目配置中开启灰色模式和深色整体风格,刷新页面整体风格异常
|
- 修复系统配置中开启灰色模式和深色整体风格,刷新页面整体风格异常
|
||||||
|
|
||||||
### 🍏 Perf
|
### 🍏 Perf
|
||||||
|
|
||||||
@@ -84,7 +114,7 @@
|
|||||||
- 所有`search`搜索图标统一替换为`@iconify-icons/ri/search-line`它比较常用将其放入全局离线图标中
|
- 所有`search`搜索图标统一替换为`@iconify-icons/ri/search-line`它比较常用将其放入全局离线图标中
|
||||||
- 移除`iframe`在暗模式下的滤镜效果
|
- 移除`iframe`在暗模式下的滤镜效果
|
||||||
- 带来更美观精致的首页
|
- 带来更美观精致的首页
|
||||||
- 更干净整洁的项目配置右侧弹出面板
|
- 更干净整洁的系统配置右侧弹出面板
|
||||||
- 重构关于页面,整体更紧致,关键信息更突出
|
- 重构关于页面,整体更紧致,关键信息更突出
|
||||||
|
|
||||||
### 🎫 Feat
|
### 🎫 Feat
|
||||||
|
|||||||
@@ -176,13 +176,14 @@ Thank you very much for your in-depth understanding of the source code and your
|
|||||||
|
|
||||||
| **Contributor** | **SpecificCode** |
|
| **Contributor** | **SpecificCode** |
|
||||||
| :---------------------------------------------: | :------------------------------------------------------------------------------: |
|
| :---------------------------------------------: | :------------------------------------------------------------------------------: |
|
||||||
| [hb0730](https://github.com/hb0730) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=hb0730) |
|
| [hb0730](https://github.com/hb0730) | [code](https://github.com/pure-admin/vue-pure-admin/commits?author=hb0730) |
|
||||||
| [o-cc](https://github.com/o-cc) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=o-cc) |
|
| [o-cc](https://github.com/o-cc) | [code](https://github.com/pure-admin/vue-pure-admin/commits?author=o-cc) |
|
||||||
| [yj-liuzepeng](https://github.com/yj-liuzepeng) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=yj-liuzepeng) |
|
| [yj-liuzepeng](https://github.com/yj-liuzepeng) | [code](https://github.com/pure-admin/vue-pure-admin/commits?author=yj-liuzepeng) |
|
||||||
| [skyline523](https://github.com/skyline523) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=skyline523) |
|
| [skyline523](https://github.com/skyline523) | [code](https://github.com/pure-admin/vue-pure-admin/commits?author=skyline523) |
|
||||||
| [shark-lajiao](https://github.com/shark-lajiao) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=shark-lajiao) |
|
| [shark-lajiao](https://github.com/shark-lajiao) | [code](https://github.com/pure-admin/vue-pure-admin/commits?author=shark-lajiao) |
|
||||||
| [WitMiao](https://github.com/WitMiao) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=WitMiao) |
|
| [WitMiao](https://github.com/WitMiao) | [code](https://github.com/pure-admin/vue-pure-admin/commits?author=WitMiao) |
|
||||||
| [QFifteen](https://github.com/QFifteen) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=QFifteen) |
|
| [QFifteen](https://github.com/QFifteen) | [code](https://github.com/pure-admin/vue-pure-admin/commits?author=QFifteen) |
|
||||||
|
| [edgexie](https://github.com/edgexie) | [code](https://github.com/pure-admin/vue-pure-admin/commits?author=edgexie) |
|
||||||
|
|
||||||
## Git Contribution submission specification
|
## Git Contribution submission specification
|
||||||
|
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ docker run -dp 8080:80 --name pure-admin vue-pure-admin
|
|||||||
| [shark-lajiao](https://github.com/shark-lajiao) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=shark-lajiao) |
|
| [shark-lajiao](https://github.com/shark-lajiao) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=shark-lajiao) |
|
||||||
| [WitMiao](https://github.com/WitMiao) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=WitMiao) |
|
| [WitMiao](https://github.com/WitMiao) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=WitMiao) |
|
||||||
| [QFifteen](https://github.com/QFifteen) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=QFifteen) |
|
| [QFifteen](https://github.com/QFifteen) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=QFifteen) |
|
||||||
|
| [edgexie](https://github.com/edgexie) | [代码](https://github.com/pure-admin/vue-pure-admin/commits?author=edgexie) |
|
||||||
|
|
||||||
## `Git` 贡献提交规范
|
## `Git` 贡献提交规范
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ export function getPluginsList(
|
|||||||
// jsx、tsx语法支持
|
// jsx、tsx语法支持
|
||||||
vueJsx(),
|
vueJsx(),
|
||||||
VueI18nPlugin({
|
VueI18nPlugin({
|
||||||
runtimeOnly: true,
|
jitCompilation: false,
|
||||||
compositionOnly: true,
|
|
||||||
include: [pathResolve("../locales/**")]
|
include: [pathResolve("../locales/**")]
|
||||||
}),
|
}),
|
||||||
viteBuildInfo(),
|
viteBuildInfo(),
|
||||||
|
|||||||
@@ -10,7 +10,14 @@ import pluginTypeScript from "@typescript-eslint/eslint-plugin";
|
|||||||
export default defineFlatConfig([
|
export default defineFlatConfig([
|
||||||
{
|
{
|
||||||
...js.configs.recommended,
|
...js.configs.recommended,
|
||||||
ignores: ["src/assets/**", "src/**/iconfont/**"],
|
ignores: [
|
||||||
|
"**/.*",
|
||||||
|
"dist/*",
|
||||||
|
"*.d.ts",
|
||||||
|
"public/*",
|
||||||
|
"src/assets/**",
|
||||||
|
"src/**/iconfont/**"
|
||||||
|
],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
// index.d.ts
|
// index.d.ts
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
buttons:
|
buttons:
|
||||||
|
pureAccountSettings: Account
|
||||||
pureLoginOut: LoginOut
|
pureLoginOut: LoginOut
|
||||||
pureLogin: Login
|
pureLogin: Login
|
||||||
pureSystemSet: Open ProjectConfig
|
pureOpenSystemSet: Open System Configs
|
||||||
pureReload: Reload
|
pureReload: Reload
|
||||||
pureCloseCurrentTab: Close CurrentTab
|
pureCloseCurrentTab: Close CurrentTab
|
||||||
pureCloseLeftTabs: Close LeftTabs
|
pureCloseLeftTabs: Close LeftTabs
|
||||||
@@ -10,6 +11,54 @@ buttons:
|
|||||||
pureCloseAllTabs: Close AllTabs
|
pureCloseAllTabs: Close AllTabs
|
||||||
pureContentFullScreen: Content FullScreen
|
pureContentFullScreen: Content FullScreen
|
||||||
pureContentExitFullScreen: Content ExitFullScreen
|
pureContentExitFullScreen: Content ExitFullScreen
|
||||||
|
pureClickCollapse: Collapse
|
||||||
|
pureClickExpand: Expand
|
||||||
|
pureConfirm: Confirm
|
||||||
|
pureSwitch: Switch
|
||||||
|
pureClose: Close
|
||||||
|
pureBackTop: BackTop
|
||||||
|
pureOpenText: Open
|
||||||
|
pureCloseText: Close
|
||||||
|
search:
|
||||||
|
pureTotal: Total
|
||||||
|
pureHistory: History
|
||||||
|
pureCollect: Collect
|
||||||
|
pureDragSort: (Drag Sort)
|
||||||
|
pureEmpty: Empty
|
||||||
|
purePlaceholder: Search Menu
|
||||||
|
panel:
|
||||||
|
pureSystemSet: System Configs
|
||||||
|
pureCloseSystemSet: Close System Configs
|
||||||
|
pureClearCacheAndToLogin: Clear cache and return to login page
|
||||||
|
pureClearCache: Clear Cache
|
||||||
|
pureOverallStyle: Overall Style
|
||||||
|
pureOverallStyleLight: Light
|
||||||
|
pureOverallStyleLightTip: Set sail freshly and light up the comfortable work interface
|
||||||
|
pureOverallStyleDark: Dark
|
||||||
|
pureOverallStyleDarkTip: Moonlight Overture, indulge in the tranquility and elegance of the night
|
||||||
|
pureOverallStyleSystem: Auto
|
||||||
|
pureOverallStyleSystemTip: Synchronize time, the interface naturally responds to morning and dusk
|
||||||
|
pureThemeColor: Theme Color
|
||||||
|
pureLayoutModel: Layout Model
|
||||||
|
pureVerticalTip: The menu on the left is familiar and friendly
|
||||||
|
pureHorizontalTip: Top menu, concise overview
|
||||||
|
pureMixTip: Mixed menu, flexible
|
||||||
|
pureStretch: Stretch Page
|
||||||
|
pureStretchFixed: Fixed
|
||||||
|
pureStretchFixedTip: Compact pages make it easy to find the information you need
|
||||||
|
pureStretchCustom: Custom
|
||||||
|
pureStretchCustomTip: Minimum 1280, maximum 1600
|
||||||
|
pureTagsStyle: Tags Style
|
||||||
|
pureTagsStyleSmart: Smart
|
||||||
|
pureTagsStyleSmartTip: Smart tags add fun and brilliance
|
||||||
|
pureTagsStyleCard: Card
|
||||||
|
pureTagsStyleCardTip: Card tags for efficient browsing
|
||||||
|
pureInterfaceDisplay: Interface Display
|
||||||
|
pureGreyModel: Grey Model
|
||||||
|
pureWeakModel: Weak Model
|
||||||
|
pureHiddenTags: Hidden Tags
|
||||||
|
pureHiddenFooter: Hidden Footer
|
||||||
|
pureMultiTagsCache: MultiTags Cache
|
||||||
menus:
|
menus:
|
||||||
pureHome: Home
|
pureHome: Home
|
||||||
pureLogin: Login
|
pureLogin: Login
|
||||||
@@ -108,7 +157,7 @@ menus:
|
|||||||
pureTimeline: Time Line
|
pureTimeline: Time Line
|
||||||
pureLineTree: LineTree
|
pureLineTree: LineTree
|
||||||
pureList: List Page
|
pureList: List Page
|
||||||
pureListCard: Card List Page
|
pureCardList: Card List Page
|
||||||
pureDebounce: Debounce & Throttle
|
pureDebounce: Debounce & Throttle
|
||||||
pureFormDesign: Form Design
|
pureFormDesign: Form Design
|
||||||
pureBarcode: Barcode
|
pureBarcode: Barcode
|
||||||
@@ -130,10 +179,12 @@ menus:
|
|||||||
pureTableEdit: Edit Usage
|
pureTableEdit: Edit Usage
|
||||||
pureVxeTable: Virtual Usage
|
pureVxeTable: Virtual Usage
|
||||||
pureBoard: Paint Board
|
pureBoard: Paint Board
|
||||||
|
pureMindMap: Mind Map
|
||||||
pureMenuOverflow: Menu Overflow Show Tooltip Text
|
pureMenuOverflow: Menu Overflow Show Tooltip Text
|
||||||
pureChildMenuOverflow: Child Menu Overflow Show Tooltip Text
|
pureChildMenuOverflow: Child Menu Overflow Show Tooltip Text
|
||||||
status:
|
status:
|
||||||
pureLoad: Loading...
|
pureLoad: Loading...
|
||||||
|
pureNoMessage: No Message
|
||||||
login:
|
login:
|
||||||
pureUsername: Username
|
pureUsername: Username
|
||||||
purePassword: Password
|
purePassword: Password
|
||||||
@@ -158,6 +209,7 @@ login:
|
|||||||
pureTip: After scanning the code, click "Confirm" to complete the login
|
pureTip: After scanning the code, click "Confirm" to complete the login
|
||||||
pureDefinite: Definite
|
pureDefinite: Definite
|
||||||
pureLoginSuccess: Login Success
|
pureLoginSuccess: Login Success
|
||||||
|
pureLoginFail: Login Fail
|
||||||
pureRegisterSuccess: Regist Success
|
pureRegisterSuccess: Regist Success
|
||||||
pureTickPrivacy: Please tick Privacy Policy
|
pureTickPrivacy: Please tick Privacy Policy
|
||||||
pureReadAccept: I have read it carefully and accept
|
pureReadAccept: I have read it carefully and accept
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
buttons:
|
buttons:
|
||||||
|
pureAccountSettings: 账户设置
|
||||||
pureLoginOut: 退出系统
|
pureLoginOut: 退出系统
|
||||||
pureLogin: 登录
|
pureLogin: 登录
|
||||||
pureSystemSet: 打开项目配置
|
pureOpenSystemSet: 打开系统配置
|
||||||
pureReload: 重新加载
|
pureReload: 重新加载
|
||||||
pureCloseCurrentTab: 关闭当前标签页
|
pureCloseCurrentTab: 关闭当前标签页
|
||||||
pureCloseLeftTabs: 关闭左侧标签页
|
pureCloseLeftTabs: 关闭左侧标签页
|
||||||
@@ -10,6 +11,54 @@ buttons:
|
|||||||
pureCloseAllTabs: 关闭全部标签页
|
pureCloseAllTabs: 关闭全部标签页
|
||||||
pureContentFullScreen: 内容区全屏
|
pureContentFullScreen: 内容区全屏
|
||||||
pureContentExitFullScreen: 内容区退出全屏
|
pureContentExitFullScreen: 内容区退出全屏
|
||||||
|
pureClickCollapse: 点击折叠
|
||||||
|
pureClickExpand: 点击展开
|
||||||
|
pureConfirm: 确认
|
||||||
|
pureSwitch: 切换
|
||||||
|
pureClose: 关闭
|
||||||
|
pureBackTop: 回到顶部
|
||||||
|
pureOpenText: 开
|
||||||
|
pureCloseText: 关
|
||||||
|
search:
|
||||||
|
pureTotal: 共
|
||||||
|
pureHistory: 搜索历史
|
||||||
|
pureCollect: 收藏
|
||||||
|
pureDragSort: (可拖拽排序)
|
||||||
|
pureEmpty: 暂无搜索结果
|
||||||
|
purePlaceholder: 搜索菜单(支持拼音搜索)
|
||||||
|
panel:
|
||||||
|
pureSystemSet: 系统配置
|
||||||
|
pureCloseSystemSet: 关闭配置
|
||||||
|
pureClearCacheAndToLogin: 清空缓存并返回登录页
|
||||||
|
pureClearCache: 清空缓存
|
||||||
|
pureOverallStyle: 整体风格
|
||||||
|
pureOverallStyleLight: 浅色
|
||||||
|
pureOverallStyleLightTip: 清新启航,点亮舒适的工作界面
|
||||||
|
pureOverallStyleDark: 深色
|
||||||
|
pureOverallStyleDarkTip: 月光序曲,沉醉于夜的静谧雅致
|
||||||
|
pureOverallStyleSystem: 自动
|
||||||
|
pureOverallStyleSystemTip: 同步时光,界面随晨昏自然呼应
|
||||||
|
pureThemeColor: 主题色
|
||||||
|
pureLayoutModel: 导航模式
|
||||||
|
pureVerticalTip: 左侧菜单,亲切熟悉
|
||||||
|
pureHorizontalTip: 顶部菜单,简洁概览
|
||||||
|
pureMixTip: 混合菜单,灵活多变
|
||||||
|
pureStretch: 页宽
|
||||||
|
pureStretchFixed: 固定
|
||||||
|
pureStretchFixedTip: 紧凑页面,轻松找到所需信息
|
||||||
|
pureStretchCustom: 自定义
|
||||||
|
pureStretchCustomTip: 最小1280、最大1600
|
||||||
|
pureTagsStyle: 页签风格
|
||||||
|
pureTagsStyleSmart: 灵动
|
||||||
|
pureTagsStyleSmartTip: 灵动标签,添趣生辉
|
||||||
|
pureTagsStyleCard: 卡片
|
||||||
|
pureTagsStyleCardTip: 卡片标签,高效浏览
|
||||||
|
pureInterfaceDisplay: 界面显示
|
||||||
|
pureGreyModel: 灰色模式
|
||||||
|
pureWeakModel: 色弱模式
|
||||||
|
pureHiddenTags: 隐藏标签页
|
||||||
|
pureHiddenFooter: 隐藏页脚
|
||||||
|
pureMultiTagsCache: 页签持久化
|
||||||
menus:
|
menus:
|
||||||
pureHome: 首页
|
pureHome: 首页
|
||||||
pureLogin: 登录
|
pureLogin: 登录
|
||||||
@@ -108,7 +157,7 @@ menus:
|
|||||||
pureTimeline: 时间线
|
pureTimeline: 时间线
|
||||||
pureLineTree: 树形连接线
|
pureLineTree: 树形连接线
|
||||||
pureList: 列表页面
|
pureList: 列表页面
|
||||||
pureListCard: 卡片列表页
|
pureCardList: 卡片列表页
|
||||||
pureDebounce: 防抖节流
|
pureDebounce: 防抖节流
|
||||||
pureFormDesign: 表单设计器
|
pureFormDesign: 表单设计器
|
||||||
pureBarcode: 条形码
|
pureBarcode: 条形码
|
||||||
@@ -130,10 +179,12 @@ menus:
|
|||||||
pureTableEdit: 可编辑用法
|
pureTableEdit: 可编辑用法
|
||||||
pureVxeTable: 虚拟滚动
|
pureVxeTable: 虚拟滚动
|
||||||
pureBoard: 艺术画板
|
pureBoard: 艺术画板
|
||||||
|
pureMindMap: 思维导图
|
||||||
pureMenuOverflow: 目录超出显示 Tooltip 文字提示
|
pureMenuOverflow: 目录超出显示 Tooltip 文字提示
|
||||||
pureChildMenuOverflow: 菜单超出显示 Tooltip 文字提示
|
pureChildMenuOverflow: 菜单超出显示 Tooltip 文字提示
|
||||||
status:
|
status:
|
||||||
pureLoad: 加载中...
|
pureLoad: 加载中...
|
||||||
|
pureNoMessage: 暂无消息
|
||||||
login:
|
login:
|
||||||
pureUsername: 账号
|
pureUsername: 账号
|
||||||
purePassword: 密码
|
purePassword: 密码
|
||||||
@@ -158,6 +209,7 @@ login:
|
|||||||
pureTip: 扫码后点击"确认",即可完成登录
|
pureTip: 扫码后点击"确认",即可完成登录
|
||||||
pureDefinite: 确定
|
pureDefinite: 确定
|
||||||
pureLoginSuccess: 登录成功
|
pureLoginSuccess: 登录成功
|
||||||
|
pureLoginFail: 登录失败
|
||||||
pureRegisterSuccess: 注册成功
|
pureRegisterSuccess: 注册成功
|
||||||
pureTickPrivacy: 请勾选隐私政策
|
pureTickPrivacy: 请勾选隐私政策
|
||||||
pureReadAccept: 我已仔细阅读并接受
|
pureReadAccept: 我已仔细阅读并接受
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ export default defineFakeRoute([
|
|||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
data: {
|
data: {
|
||||||
|
avatar: "https://avatars.githubusercontent.com/u/44761321",
|
||||||
username: "admin",
|
username: "admin",
|
||||||
|
nickname: "小铭",
|
||||||
// 一个用户可能有多个角色
|
// 一个用户可能有多个角色
|
||||||
roles: ["admin"],
|
roles: ["admin"],
|
||||||
accessToken: "eyJhbGciOiJIUzUxMiJ9.admin",
|
accessToken: "eyJhbGciOiJIUzUxMiJ9.admin",
|
||||||
@@ -22,8 +24,9 @@ export default defineFakeRoute([
|
|||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
data: {
|
data: {
|
||||||
|
avatar: "https://avatars.githubusercontent.com/u/52823142",
|
||||||
username: "common",
|
username: "common",
|
||||||
// 一个用户可能有多个角色
|
nickname: "小林",
|
||||||
roles: ["common"],
|
roles: ["common"],
|
||||||
accessToken: "eyJhbGciOiJIUzUxMiJ9.common",
|
accessToken: "eyJhbGciOiJIUzUxMiJ9.common",
|
||||||
refreshToken: "eyJhbGciOiJIUzUxMiJ9.commonRefresh",
|
refreshToken: "eyJhbGciOiJIUzUxMiJ9.commonRefresh",
|
||||||
|
|||||||
59
mock/mine.ts
Normal file
59
mock/mine.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import { defineFakeRoute } from "vite-plugin-fake-server/client";
|
||||||
|
import { faker } from "@faker-js/faker/locale/zh_CN";
|
||||||
|
|
||||||
|
export default defineFakeRoute([
|
||||||
|
// 账户设置-个人信息
|
||||||
|
{
|
||||||
|
url: "/mine",
|
||||||
|
method: "get",
|
||||||
|
response: () => {
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
data: {
|
||||||
|
avatar: "https://avatars.githubusercontent.com/u/44761321",
|
||||||
|
username: "admin",
|
||||||
|
nickname: "小铭",
|
||||||
|
email: "pureadmin@163.com",
|
||||||
|
phone: "15888886789",
|
||||||
|
description: "一个热爱开源的前端工程师"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 账户设置-个人安全日志
|
||||||
|
{
|
||||||
|
url: "/mine-logs",
|
||||||
|
method: "get",
|
||||||
|
response: () => {
|
||||||
|
let list = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
ip: faker.internet.ipv4(),
|
||||||
|
address: "中国河南省信阳市",
|
||||||
|
system: "macOS",
|
||||||
|
browser: "Chrome",
|
||||||
|
summary: "账户登录", // 详情
|
||||||
|
operatingTime: new Date() // 时间
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
ip: faker.internet.ipv4(),
|
||||||
|
address: "中国广东省深圳市",
|
||||||
|
system: "Windows",
|
||||||
|
browser: "Firefox",
|
||||||
|
summary: "绑定了手机号码",
|
||||||
|
operatingTime: new Date().setDate(new Date().getDate() - 1)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
data: {
|
||||||
|
list,
|
||||||
|
total: list.length, // 总条目数
|
||||||
|
pageSize: 10, // 每页显示条目个数
|
||||||
|
currentPage: 1 // 当前页数
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
@@ -9,9 +9,9 @@ export default defineFakeRoute([
|
|||||||
response: ({ body }) => {
|
response: ({ body }) => {
|
||||||
let list = [
|
let list = [
|
||||||
{
|
{
|
||||||
username: "admin",
|
|
||||||
nickname: "admin",
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/44761321",
|
avatar: "https://avatars.githubusercontent.com/u/44761321",
|
||||||
|
username: "admin",
|
||||||
|
nickname: "小铭",
|
||||||
phone: "15888886789",
|
phone: "15888886789",
|
||||||
email: faker.internet.email(),
|
email: faker.internet.email(),
|
||||||
sex: 0,
|
sex: 0,
|
||||||
@@ -27,9 +27,9 @@ export default defineFakeRoute([
|
|||||||
createTime: 1605456000000
|
createTime: 1605456000000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
username: "common",
|
|
||||||
nickname: "common",
|
|
||||||
avatar: "https://avatars.githubusercontent.com/u/52823142",
|
avatar: "https://avatars.githubusercontent.com/u/52823142",
|
||||||
|
username: "common",
|
||||||
|
nickname: "小林",
|
||||||
phone: "18288882345",
|
phone: "18288882345",
|
||||||
email: faker.internet.email(),
|
email: faker.internet.email(),
|
||||||
sex: 1,
|
sex: 1,
|
||||||
@@ -397,6 +397,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -420,6 +421,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -443,6 +445,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -466,6 +469,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -489,6 +493,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -512,6 +517,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -535,6 +541,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -558,6 +565,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -581,6 +589,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -604,6 +613,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -627,6 +637,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -651,6 +662,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -674,6 +686,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -697,6 +710,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -720,6 +734,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -743,6 +758,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -766,6 +782,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -790,6 +807,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -813,6 +831,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -836,6 +855,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -859,6 +879,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -882,6 +903,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -906,6 +928,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -929,6 +952,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -952,6 +976,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -975,6 +1000,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -998,6 +1024,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -1022,6 +1049,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -1045,6 +1073,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -1068,6 +1097,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: false,
|
showLink: false,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -1091,6 +1121,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: false,
|
showLink: false,
|
||||||
showParent: false
|
showParent: false
|
||||||
}
|
}
|
||||||
@@ -1472,6 +1503,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -1495,6 +1527,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -1518,6 +1551,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -1541,6 +1575,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
},
|
},
|
||||||
@@ -1564,6 +1599,7 @@ export default defineFakeRoute([
|
|||||||
frameLoading: true,
|
frameLoading: true,
|
||||||
keepAlive: false,
|
keepAlive: false,
|
||||||
hiddenTag: false,
|
hiddenTag: false,
|
||||||
|
fixedTag: false,
|
||||||
showLink: true,
|
showLink: true,
|
||||||
showParent: false
|
showParent: false
|
||||||
}
|
}
|
||||||
|
|||||||
73
package.json
73
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-pure-admin",
|
"name": "vue-pure-admin",
|
||||||
"version": "5.3.0",
|
"version": "5.4.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
"preview:build": "pnpm build && vite preview",
|
"preview:build": "pnpm build && vite preview",
|
||||||
"typecheck": "tsc --noEmit && vue-tsc --noEmit --skipLibCheck",
|
"typecheck": "tsc --noEmit && vue-tsc --noEmit --skipLibCheck",
|
||||||
"svgo": "svgo -f . -r",
|
"svgo": "svgo -f . -r",
|
||||||
"cloc": "NODE_OPTIONS=--max-old-space-size=4096 cloc . --exclude-dir=node_modules --exclude-lang=YAML",
|
|
||||||
"clean:cache": "rimraf .eslintcache && rimraf pnpm-lock.yaml && rimraf node_modules && pnpm store prune && pnpm install",
|
"clean:cache": "rimraf .eslintcache && rimraf pnpm-lock.yaml && rimraf node_modules && pnpm store prune && pnpm install",
|
||||||
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock,build}/**/*.{vue,js,ts,tsx}\" --fix",
|
"lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock,build}/**/*.{vue,js,ts,tsx}\" --fix",
|
||||||
"lint:prettier": "prettier --write \"src/**/*.{js,ts,json,tsx,css,scss,vue,html,md}\"",
|
"lint:prettier": "prettier --write \"src/**/*.{js,ts,json,tsx,css,scss,vue,html,md}\"",
|
||||||
@@ -50,16 +49,16 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@amap/amap-jsapi-loader": "^1.0.1",
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||||
"@howdyjs/mouse-menu": "^2.1.3",
|
"@howdyjs/mouse-menu": "^2.1.3",
|
||||||
"@infectoone/vue-ganttastic": "^2.3.1",
|
"@infectoone/vue-ganttastic": "^2.3.2",
|
||||||
"@logicflow/core": "^1.2.23",
|
"@logicflow/core": "^1.2.26",
|
||||||
"@logicflow/extension": "^1.2.23",
|
"@logicflow/extension": "^1.2.26",
|
||||||
"@pureadmin/descriptions": "^1.2.1",
|
"@pureadmin/descriptions": "^1.2.1",
|
||||||
"@pureadmin/table": "^3.1.2",
|
"@pureadmin/table": "^3.1.2",
|
||||||
"@pureadmin/utils": "^2.4.7",
|
"@pureadmin/utils": "^2.4.7",
|
||||||
"@vue-flow/background": "^1.3.0",
|
"@vue-flow/background": "^1.3.0",
|
||||||
"@vue-flow/core": "^1.33.5",
|
"@vue-flow/core": "^1.33.5",
|
||||||
"@vue-office/docx": "^1.6.0",
|
"@vue-office/docx": "^1.6.0",
|
||||||
"@vue-office/excel": "^1.7.2",
|
"@vue-office/excel": "^1.7.6",
|
||||||
"@vueuse/core": "^10.9.0",
|
"@vueuse/core": "^10.9.0",
|
||||||
"@vueuse/motion": "^2.1.0",
|
"@vueuse/motion": "^2.1.0",
|
||||||
"@wangeditor/editor": "^5.1.23",
|
"@wangeditor/editor": "^5.1.23",
|
||||||
@@ -72,7 +71,7 @@
|
|||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"echarts": "^5.5.0",
|
"echarts": "^5.5.0",
|
||||||
"el-table-infinite-scroll": "^3.0.3",
|
"el-table-infinite-scroll": "^3.0.3",
|
||||||
"element-plus": "^2.6.2",
|
"element-plus": "2.6.3",
|
||||||
"intro.js": "^7.2.0",
|
"intro.js": "^7.2.0",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"jsbarcode": "^3.11.6",
|
"jsbarcode": "^3.11.6",
|
||||||
@@ -83,22 +82,22 @@
|
|||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
"pinyin-pro": "^3.19.6",
|
"pinyin-pro": "^3.20.1",
|
||||||
"plus-pro-components": "^0.0.5",
|
"plus-pro-components": "^0.0.11",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"qs": "^6.12.0",
|
"qs": "^6.12.1",
|
||||||
"responsive-storage": "^2.2.0",
|
"responsive-storage": "^2.2.0",
|
||||||
"sortablejs": "^1.15.2",
|
"sortablejs": "^1.15.2",
|
||||||
"swiper": "^11.0.7",
|
"swiper": "^11.1.1",
|
||||||
"typeit": "^8.8.3",
|
"typeit": "^8.8.3",
|
||||||
"v-contextmenu": "^3.2.0",
|
"v-contextmenu": "^3.2.0",
|
||||||
"v3-infinite-loading": "^1.3.1",
|
"v3-infinite-loading": "^1.3.1",
|
||||||
"version-rocket": "^1.7.1",
|
"version-rocket": "^1.7.1",
|
||||||
"vue": "^3.4.21",
|
"vue": "^3.4.23",
|
||||||
"vue-i18n": "^9.10.2",
|
"vue-i18n": "^9.12.1",
|
||||||
"vue-json-pretty": "^2.4.0",
|
"vue-json-pretty": "^2.4.0",
|
||||||
"vue-pdf-embed": "^2.0.3",
|
"vue-pdf-embed": "^2.0.3",
|
||||||
"vue-router": "^4.3.0",
|
"vue-router": "^4.3.1",
|
||||||
"vue-tippy": "^6.4.1",
|
"vue-tippy": "^6.4.1",
|
||||||
"vue-types": "^5.1.1",
|
"vue-types": "^5.1.1",
|
||||||
"vue-virtual-scroller": "2.0.0-beta.8",
|
"vue-virtual-scroller": "2.0.0-beta.8",
|
||||||
@@ -106,45 +105,44 @@
|
|||||||
"vue3-danmaku": "^1.6.0",
|
"vue3-danmaku": "^1.6.0",
|
||||||
"vue3-puzzle-vcode": "^1.1.7",
|
"vue3-puzzle-vcode": "^1.1.7",
|
||||||
"vuedraggable": "^4.1.0",
|
"vuedraggable": "^4.1.0",
|
||||||
"vxe-table": "^4.5.21",
|
"vxe-table": "^4.5.22",
|
||||||
"wavesurfer.js": "^7.7.5",
|
"wavesurfer.js": "^7.7.11",
|
||||||
"xgplayer": "^3.0.14",
|
"xgplayer": "^3.0.16",
|
||||||
"xlsx": "^0.18.5"
|
"xlsx": "^0.18.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^19.2.1",
|
"@commitlint/cli": "^19.2.2",
|
||||||
"@commitlint/config-conventional": "^19.1.0",
|
"@commitlint/config-conventional": "^19.2.2",
|
||||||
"@commitlint/types": "^19.0.3",
|
"@commitlint/types": "^19.0.3",
|
||||||
"@eslint/js": "^8.57.0",
|
"@eslint/js": "^9.0.0",
|
||||||
"@faker-js/faker": "^8.4.1",
|
"@faker-js/faker": "^8.4.1",
|
||||||
"@iconify-icons/ep": "^1.2.12",
|
"@iconify-icons/ep": "^1.2.12",
|
||||||
"@iconify-icons/ri": "^1.2.10",
|
"@iconify-icons/ri": "^1.2.10",
|
||||||
"@iconify/vue": "^4.1.1",
|
"@iconify/vue": "^4.1.1",
|
||||||
"@intlify/unplugin-vue-i18n": "^2.0.0",
|
"@intlify/unplugin-vue-i18n": "^4.0.0",
|
||||||
"@pureadmin/theme": "^3.2.0",
|
"@pureadmin/theme": "^3.2.0",
|
||||||
"@types/dagre": "^0.7.52",
|
"@types/dagre": "^0.7.52",
|
||||||
"@types/gradient-string": "^1.1.5",
|
"@types/gradient-string": "^1.1.6",
|
||||||
"@types/intro.js": "^5.1.5",
|
"@types/intro.js": "^5.1.5",
|
||||||
"@types/js-cookie": "^3.0.6",
|
"@types/js-cookie": "^3.0.6",
|
||||||
"@types/node": "^20.11.30",
|
"@types/node": "^20.12.7",
|
||||||
"@types/nprogress": "^0.2.3",
|
"@types/nprogress": "^0.2.3",
|
||||||
"@types/qrcode": "^1.5.5",
|
"@types/qrcode": "^1.5.5",
|
||||||
"@types/qs": "^6.9.14",
|
"@types/qs": "^6.9.15",
|
||||||
"@types/sortablejs": "^1.15.8",
|
"@types/sortablejs": "^1.15.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
"@typescript-eslint/eslint-plugin": "^7.7.0",
|
||||||
"@typescript-eslint/parser": "^7.4.0",
|
"@typescript-eslint/parser": "^7.7.0",
|
||||||
"@vitejs/plugin-vue": "^5.0.4",
|
"@vitejs/plugin-vue": "^5.0.4",
|
||||||
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
||||||
"autoprefixer": "^10.4.19",
|
"autoprefixer": "^10.4.19",
|
||||||
"boxen": "^7.1.1",
|
"boxen": "^7.1.1",
|
||||||
"cloc": "^2.11.0",
|
|
||||||
"cssnano": "^6.1.2",
|
"cssnano": "^6.1.2",
|
||||||
"dagre": "^0.8.5",
|
"dagre": "^0.8.5",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^9.0.0",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-define-config": "^2.1.0",
|
"eslint-define-config": "^2.1.0",
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"eslint-plugin-vue": "^9.24.0",
|
"eslint-plugin-vue": "^9.25.0",
|
||||||
"gradient-string": "^2.0.2",
|
"gradient-string": "^2.0.2",
|
||||||
"husky": "^9.0.11",
|
"husky": "^9.0.11",
|
||||||
"lint-staged": "^15.2.2",
|
"lint-staged": "^15.2.2",
|
||||||
@@ -155,16 +153,16 @@
|
|||||||
"prettier": "^3.2.5",
|
"prettier": "^3.2.5",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"rollup-plugin-visualizer": "^5.12.0",
|
"rollup-plugin-visualizer": "^5.12.0",
|
||||||
"sass": "^1.72.0",
|
"sass": "^1.75.0",
|
||||||
"stylelint": "^16.3.1",
|
"stylelint": "^16.3.1",
|
||||||
"stylelint-config-recess-order": "^5.0.0",
|
"stylelint-config-recess-order": "^5.0.1",
|
||||||
"stylelint-config-recommended-vue": "^1.5.0",
|
"stylelint-config-recommended-vue": "^1.5.0",
|
||||||
"stylelint-config-standard-scss": "^13.0.0",
|
"stylelint-config-standard-scss": "^13.1.0",
|
||||||
"stylelint-prettier": "^5.0.0",
|
"stylelint-prettier": "^5.0.0",
|
||||||
"svgo": "^3.2.0",
|
"svgo": "^3.2.0",
|
||||||
"tailwindcss": "^3.4.1",
|
"tailwindcss": "^3.4.3",
|
||||||
"typescript": "^5.4.3",
|
"typescript": "^5.4.5",
|
||||||
"vite": "^5.2.6",
|
"vite": "^5.2.9",
|
||||||
"vite-plugin-cdn-import": "^0.3.5",
|
"vite-plugin-cdn-import": "^0.3.5",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-plugin-fake-server": "^2.1.1",
|
"vite-plugin-fake-server": "^2.1.1",
|
||||||
@@ -186,6 +184,11 @@
|
|||||||
"w3c-hr-time": "*",
|
"w3c-hr-time": "*",
|
||||||
"stable": "*",
|
"stable": "*",
|
||||||
"abab": "*"
|
"abab": "*"
|
||||||
|
},
|
||||||
|
"peerDependencyRules": {
|
||||||
|
"allowedVersions": {
|
||||||
|
"eslint": "9"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1528
pnpm-lock.yaml
generated
1528
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"Version": "5.3.0",
|
"Version": "5.4.0",
|
||||||
"Title": "PureAdmin",
|
"Title": "PureAdmin",
|
||||||
"FixedHeader": true,
|
"FixedHeader": true,
|
||||||
"HiddenSideBar": false,
|
"HiddenSideBar": false,
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import { defineComponent } from "vue";
|
|||||||
import { checkVersion } from "version-rocket";
|
import { checkVersion } from "version-rocket";
|
||||||
import { ElConfigProvider } from "element-plus";
|
import { ElConfigProvider } from "element-plus";
|
||||||
import { ReDialog } from "@/components/ReDialog";
|
import { ReDialog } from "@/components/ReDialog";
|
||||||
import en from "element-plus/dist/locale/en.mjs";
|
import en from "element-plus/es/locale/lang/en";
|
||||||
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
|
import zhCn from "element-plus/es/locale/lang/zh-cn";
|
||||||
import plusEn from "plus-pro-components/locale/en.mjs";
|
import plusEn from "plus-pro-components/es/locale/lang/en";
|
||||||
import plusZhCn from "plus-pro-components/locale/zh-cn.mjs";
|
import plusZhCn from "plus-pro-components/es/locale/lang/zh-cn";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "app",
|
name: "app",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export type UserResult = {
|
|||||||
data: {
|
data: {
|
||||||
/** 用户名 */
|
/** 用户名 */
|
||||||
username: string;
|
username: string;
|
||||||
/** 当前登陆用户的角色 */
|
/** 当前登录用户的角色 */
|
||||||
roles: Array<string>;
|
roles: Array<string>;
|
||||||
/** `token` */
|
/** `token` */
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
@@ -28,12 +28,56 @@ export type RefreshTokenResult = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type UserInfo = {
|
||||||
|
/** 头像 */
|
||||||
|
avatar: string;
|
||||||
|
/** 用户名 */
|
||||||
|
username: string;
|
||||||
|
/** 昵称 */
|
||||||
|
nickname: string;
|
||||||
|
/** 邮箱 */
|
||||||
|
email: string;
|
||||||
|
/** 联系电话 */
|
||||||
|
phone: string;
|
||||||
|
/** 简介 */
|
||||||
|
description: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type UserInfoResult = {
|
||||||
|
success: boolean;
|
||||||
|
data: UserInfo;
|
||||||
|
};
|
||||||
|
|
||||||
|
type ResultTable = {
|
||||||
|
success: boolean;
|
||||||
|
data?: {
|
||||||
|
/** 列表数据 */
|
||||||
|
list: Array<any>;
|
||||||
|
/** 总条目数 */
|
||||||
|
total?: number;
|
||||||
|
/** 每页显示条目个数 */
|
||||||
|
pageSize?: number;
|
||||||
|
/** 当前页数 */
|
||||||
|
currentPage?: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/** 登录 */
|
/** 登录 */
|
||||||
export const getLogin = (data?: object) => {
|
export const getLogin = (data?: object) => {
|
||||||
return http.request<UserResult>("post", "/login", { data });
|
return http.request<UserResult>("post", "/login", { data });
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 刷新token */
|
/** 刷新`token` */
|
||||||
export const refreshTokenApi = (data?: object) => {
|
export const refreshTokenApi = (data?: object) => {
|
||||||
return http.request<RefreshTokenResult>("post", "/refresh-token", { data });
|
return http.request<RefreshTokenResult>("post", "/refresh-token", { data });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 账户设置-个人信息 */
|
||||||
|
export const getMine = (data?: object) => {
|
||||||
|
return http.request<UserInfoResult>("get", "/mine", { data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 账户设置-个人安全日志 */
|
||||||
|
export const getMineLogs = (data?: object) => {
|
||||||
|
return http.request<ResultTable>("get", "/mine-logs", { data });
|
||||||
|
};
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export default defineComponent({
|
|||||||
state.rAF = requestAnimationFrame(count);
|
state.rAF = requestAnimationFrame(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
function pauseResume() {
|
function pauseResume() {
|
||||||
if (state.paused) {
|
if (state.paused) {
|
||||||
resume();
|
resume();
|
||||||
@@ -83,7 +83,7 @@ export default defineComponent({
|
|||||||
requestAnimationFrame(count);
|
requestAnimationFrame(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
function reset() {
|
function reset() {
|
||||||
state.startTime = null;
|
state.startTime = null;
|
||||||
cancelAnimationFrame(state.rAF);
|
cancelAnimationFrame(state.rAF);
|
||||||
|
|||||||
7
src/components/ReCropperPreview/index.ts
Normal file
7
src/components/ReCropperPreview/index.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import reCropperPreview from "./src/index.vue";
|
||||||
|
import { withInstall } from "@pureadmin/utils";
|
||||||
|
|
||||||
|
/** 图片裁剪预览组件 */
|
||||||
|
export const ReCropperPreview = withInstall(reCropperPreview);
|
||||||
|
|
||||||
|
export default ReCropperPreview;
|
||||||
@@ -3,6 +3,10 @@ import { ref } from "vue";
|
|||||||
import ReCropper from "@/components/ReCropper";
|
import ReCropper from "@/components/ReCropper";
|
||||||
import { formatBytes } from "@pureadmin/utils";
|
import { formatBytes } from "@pureadmin/utils";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "ReCropperPreview"
|
||||||
|
});
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
imgSrc: String
|
imgSrc: String
|
||||||
});
|
});
|
||||||
@@ -11,6 +11,10 @@ import { isFunction } from "@pureadmin/utils";
|
|||||||
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
|
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
|
||||||
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
|
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "ReDialog"
|
||||||
|
});
|
||||||
|
|
||||||
const fullscreen = ref(false);
|
const fullscreen = ref(false);
|
||||||
|
|
||||||
const footerButtons = computed(() => {
|
const footerButtons = computed(() => {
|
||||||
@@ -37,6 +41,7 @@ const footerButtons = computed(() => {
|
|||||||
type: "primary",
|
type: "primary",
|
||||||
text: true,
|
text: true,
|
||||||
bg: true,
|
bg: true,
|
||||||
|
popconfirm: options?.popconfirm,
|
||||||
btnClick: ({ dialog: { options, index } }) => {
|
btnClick: ({ dialog: { options, index } }) => {
|
||||||
const done = () =>
|
const done = () =>
|
||||||
closeDialog(options, index, { command: "sure" });
|
closeDialog(options, index, { command: "sure" });
|
||||||
@@ -149,9 +154,23 @@ function handleClose(
|
|||||||
<component :is="options?.footerRenderer({ options, index })" />
|
<component :is="options?.footerRenderer({ options, index })" />
|
||||||
</template>
|
</template>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
|
<template v-for="(btn, key) in footerButtons(options)" :key="key">
|
||||||
|
<el-popconfirm
|
||||||
|
v-if="btn.popconfirm"
|
||||||
|
v-bind="btn.popconfirm"
|
||||||
|
@confirm="
|
||||||
|
btn.btnClick({
|
||||||
|
dialog: { options, index },
|
||||||
|
button: { btn, index: key }
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button v-bind="btn">{{ btn?.label }}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
<el-button
|
<el-button
|
||||||
v-for="(btn, key) in footerButtons(options)"
|
v-else
|
||||||
:key="key"
|
|
||||||
v-bind="btn"
|
v-bind="btn"
|
||||||
@click="
|
@click="
|
||||||
btn.btnClick({
|
btn.btnClick({
|
||||||
@@ -162,6 +181,7 @@ function handleClose(
|
|||||||
>
|
>
|
||||||
{{ btn?.label }}
|
{{ btn?.label }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
</template>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ type ArgsType = {
|
|||||||
/** `cancel` 点击取消按钮、`sure` 点击确定按钮、`close` 点击右上角关闭按钮或空白页或按下了esc键 */
|
/** `cancel` 点击取消按钮、`sure` 点击确定按钮、`close` 点击右上角关闭按钮或空白页或按下了esc键 */
|
||||||
command: "cancel" | "sure" | "close";
|
command: "cancel" | "sure" | "close";
|
||||||
};
|
};
|
||||||
|
type ButtonType =
|
||||||
|
| "primary"
|
||||||
|
| "success"
|
||||||
|
| "warning"
|
||||||
|
| "danger"
|
||||||
|
| "info"
|
||||||
|
| "text";
|
||||||
|
|
||||||
/** https://element-plus.org/zh-CN/component/dialog.html#attributes */
|
/** https://element-plus.org/zh-CN/component/dialog.html#attributes */
|
||||||
type DialogProps = {
|
type DialogProps = {
|
||||||
@@ -58,6 +65,34 @@ type DialogProps = {
|
|||||||
destroyOnClose?: boolean;
|
destroyOnClose?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//element-plus.org/zh-CN/component/popconfirm.html#attributes
|
||||||
|
type Popconfirm = {
|
||||||
|
/** 标题 */
|
||||||
|
title?: string;
|
||||||
|
/** 确认按钮文字 */
|
||||||
|
confirmButtonText?: string;
|
||||||
|
/** 取消按钮文字 */
|
||||||
|
cancelButtonText?: string;
|
||||||
|
/** 确认按钮类型,默认 `primary` */
|
||||||
|
confirmButtonType?: ButtonType;
|
||||||
|
/** 取消按钮类型,默认 `text` */
|
||||||
|
cancelButtonType?: ButtonType;
|
||||||
|
/** 自定义图标,默认 `QuestionFilled` */
|
||||||
|
icon?: string | Component;
|
||||||
|
/** `Icon` 颜色,默认 `#f90` */
|
||||||
|
iconColor?: string;
|
||||||
|
/** 是否隐藏 `Icon`,默认 `false` */
|
||||||
|
hideIcon?: boolean;
|
||||||
|
/** 关闭时的延迟,默认 `200` */
|
||||||
|
hideAfter?: number;
|
||||||
|
/** 是否将 `popover` 的下拉列表插入至 `body` 元素,默认 `true` */
|
||||||
|
teleported?: boolean;
|
||||||
|
/** 当 `popover` 组件长时间不触发且 `persistent` 属性设置为 `false` 时, `popover` 将会被删除,默认 `false` */
|
||||||
|
persistent?: boolean;
|
||||||
|
/** 弹层宽度,最小宽度 `150px`,默认 `150` */
|
||||||
|
width?: string | number;
|
||||||
|
};
|
||||||
|
|
||||||
type BtnClickDialog = {
|
type BtnClickDialog = {
|
||||||
options?: DialogOptions;
|
options?: DialogOptions;
|
||||||
index?: number;
|
index?: number;
|
||||||
@@ -86,6 +121,8 @@ type ButtonProps = {
|
|||||||
round?: boolean;
|
round?: boolean;
|
||||||
/** 是否为圆形按钮,默认 `false` */
|
/** 是否为圆形按钮,默认 `false` */
|
||||||
circle?: boolean;
|
circle?: boolean;
|
||||||
|
/** 确认按钮的 `Popconfirm` 气泡确认框相关配置 */
|
||||||
|
popconfirm?: Popconfirm;
|
||||||
/** 是否为加载中状态,默认 `false` */
|
/** 是否为加载中状态,默认 `false` */
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
/** 自定义加载中状态图标组件 */
|
/** 自定义加载中状态图标组件 */
|
||||||
@@ -123,6 +160,8 @@ interface DialogOptions extends DialogProps {
|
|||||||
props?: any;
|
props?: any;
|
||||||
/** 是否隐藏 `Dialog` 按钮操作区的内容 */
|
/** 是否隐藏 `Dialog` 按钮操作区的内容 */
|
||||||
hideFooter?: boolean;
|
hideFooter?: boolean;
|
||||||
|
/** 确认按钮的 `Popconfirm` 气泡确认框相关配置 */
|
||||||
|
popconfirm?: Popconfirm;
|
||||||
/**
|
/**
|
||||||
* @description 自定义对话框标题的内容渲染器
|
* @description 自定义对话框标题的内容渲染器
|
||||||
* @see {@link https://element-plus.org/zh-CN/component/dialog.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%A4%B4%E9%83%A8}
|
* @see {@link https://element-plus.org/zh-CN/component/dialog.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%A4%B4%E9%83%A8}
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
import flippers from "./filpper";
|
import flippers from "./filpper";
|
||||||
import { ref, unref, nextTick, onUnmounted } from "vue";
|
import { ref, unref, nextTick, onUnmounted } from "vue";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "ReFlop"
|
||||||
|
});
|
||||||
|
|
||||||
const timer = ref(null);
|
const timer = ref(null);
|
||||||
const flipObjs = ref([]);
|
const flipObjs = ref([]);
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import Links from "@iconify-icons/ri/links-fill";
|
|||||||
import Search from "@iconify-icons/ri/search-line";
|
import Search from "@iconify-icons/ri/search-line";
|
||||||
import FlUser from "@iconify-icons/ri/admin-line";
|
import FlUser from "@iconify-icons/ri/admin-line";
|
||||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
import Setting from "@iconify-icons/ri/settings-3-line";
|
||||||
|
import MindMap from "@iconify-icons/ri/mind-map";
|
||||||
import BarChart from "@iconify-icons/ri/bar-chart-horizontal-line";
|
import BarChart from "@iconify-icons/ri/bar-chart-horizontal-line";
|
||||||
import LoginLog from "@iconify-icons/ri/window-line";
|
import LoginLog from "@iconify-icons/ri/window-line";
|
||||||
import Artboard from "@iconify-icons/ri/artboard-line";
|
import Artboard from "@iconify-icons/ri/artboard-line";
|
||||||
@@ -54,6 +55,7 @@ addIcon("ri:table-line", Table);
|
|||||||
addIcon("ri:search-line", Search);
|
addIcon("ri:search-line", Search);
|
||||||
addIcon("ri:admin-line", FlUser);
|
addIcon("ri:admin-line", FlUser);
|
||||||
addIcon("ri:settings-3-line", Setting);
|
addIcon("ri:settings-3-line", Setting);
|
||||||
|
addIcon("ri:mind-map", MindMap);
|
||||||
addIcon("ri:bar-chart-horizontal-line", BarChart);
|
addIcon("ri:bar-chart-horizontal-line", BarChart);
|
||||||
addIcon("ri:window-line", LoginLog);
|
addIcon("ri:window-line", LoginLog);
|
||||||
addIcon("ri:file-search-line", SystemLog);
|
addIcon("ri:file-search-line", SystemLog);
|
||||||
|
|||||||
@@ -1,7 +1,15 @@
|
|||||||
import Sortable from "sortablejs";
|
import Sortable from "sortablejs";
|
||||||
import { transformI18n } from "@/plugins/i18n";
|
import { transformI18n } from "@/plugins/i18n";
|
||||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||||
import { defineComponent, ref, computed, type PropType, nextTick } from "vue";
|
import {
|
||||||
|
type PropType,
|
||||||
|
ref,
|
||||||
|
unref,
|
||||||
|
computed,
|
||||||
|
nextTick,
|
||||||
|
defineComponent,
|
||||||
|
getCurrentInstance
|
||||||
|
} from "vue";
|
||||||
import {
|
import {
|
||||||
delay,
|
delay,
|
||||||
cloneDeep,
|
cloneDeep,
|
||||||
@@ -34,6 +42,10 @@ const props = {
|
|||||||
isExpandAll: {
|
isExpandAll: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
},
|
||||||
|
tableKey: {
|
||||||
|
type: [String, Number] as PropType<string | number>,
|
||||||
|
default: "0"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -46,6 +58,7 @@ export default defineComponent({
|
|||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const checkAll = ref(true);
|
const checkAll = ref(true);
|
||||||
const isIndeterminate = ref(false);
|
const isIndeterminate = ref(false);
|
||||||
|
const instance = getCurrentInstance()!;
|
||||||
const isExpandAll = ref(props.isExpandAll);
|
const isExpandAll = ref(props.isExpandAll);
|
||||||
const filterColumns = cloneDeep(props?.columns).filter(column =>
|
const filterColumns = cloneDeep(props?.columns).filter(column =>
|
||||||
isBoolean(column?.hide)
|
isBoolean(column?.hide)
|
||||||
@@ -170,9 +183,9 @@ export default defineComponent({
|
|||||||
const rowDrop = (event: { preventDefault: () => void }) => {
|
const rowDrop = (event: { preventDefault: () => void }) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const wrapper: HTMLElement = document.querySelector(
|
const wrapper: HTMLElement = (
|
||||||
".el-checkbox-group>div"
|
instance?.proxy?.$refs[`GroupRef${unref(props.tableKey)}`] as any
|
||||||
);
|
).$el.firstElementChild;
|
||||||
Sortable.create(wrapper, {
|
Sortable.create(wrapper, {
|
||||||
animation: 300,
|
animation: 300,
|
||||||
handle: ".drag-btn",
|
handle: ".drag-btn",
|
||||||
@@ -299,6 +312,7 @@ export default defineComponent({
|
|||||||
<div class="pt-[6px] pl-[11px]">
|
<div class="pt-[6px] pl-[11px]">
|
||||||
<el-scrollbar max-height="36vh">
|
<el-scrollbar max-height="36vh">
|
||||||
<el-checkbox-group
|
<el-checkbox-group
|
||||||
|
ref={`GroupRef${unref(props.tableKey)}`}
|
||||||
modelValue={checkedColumns.value}
|
modelValue={checkedColumns.value}
|
||||||
onChange={value => handleCheckedColumnsChange(value)}
|
onChange={value => handleCheckedColumnsChange(value)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ function touchMove(e) {
|
|||||||
|
|
||||||
function touchEnd() {
|
function touchEnd() {
|
||||||
if (!unref(canTouchScroll)) return;
|
if (!unref(canTouchScroll)) return;
|
||||||
// eslint-disable-next-line prefer-const
|
|
||||||
let timer: any;
|
let timer: any;
|
||||||
const direction = unref(options).direction;
|
const direction = unref(options).direction;
|
||||||
delay.value = 50;
|
delay.value = 50;
|
||||||
|
|||||||
@@ -60,14 +60,12 @@ export function copyObj() {
|
|||||||
copyIsArray,
|
copyIsArray,
|
||||||
clone,
|
clone,
|
||||||
i = 1,
|
i = 1,
|
||||||
// eslint-disable-next-line prefer-rest-params
|
|
||||||
target = arguments[0] || {}, // 使用||运算符,排除隐式强制类型转换为false的数据类型
|
target = arguments[0] || {}, // 使用||运算符,排除隐式强制类型转换为false的数据类型
|
||||||
deep = false,
|
deep = false,
|
||||||
// eslint-disable-next-line prefer-const
|
|
||||||
len = arguments.length;
|
len = arguments.length;
|
||||||
if (typeof target === "boolean") {
|
if (typeof target === "boolean") {
|
||||||
deep = target;
|
deep = target;
|
||||||
// eslint-disable-next-line prefer-rest-params
|
|
||||||
target = arguments[1] || {};
|
target = arguments[1] || {};
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@@ -80,7 +78,7 @@ export function copyObj() {
|
|||||||
}
|
}
|
||||||
for (; i < len; i++) {
|
for (; i < len; i++) {
|
||||||
//所以如果源对象中数据类型为Undefined或Null那么就会跳过本次循环,接着循环下一个源对象
|
//所以如果源对象中数据类型为Undefined或Null那么就会跳过本次循环,接着循环下一个源对象
|
||||||
// eslint-disable-next-line prefer-rest-params
|
|
||||||
if ((options = arguments[i]) != null) {
|
if ((options = arguments[i]) != null) {
|
||||||
// 如果遇到源对象的数据类型为Boolean, Number for in循环会被跳过,不执行for in循环// src用于判断target对象是否存在name属性
|
// 如果遇到源对象的数据类型为Boolean, Number for in循环会被跳过,不执行for in循环// src用于判断target对象是否存在name属性
|
||||||
for (name in options) {
|
for (name in options) {
|
||||||
|
|||||||
@@ -37,6 +37,16 @@ const props = {
|
|||||||
/** 控件尺寸 */
|
/** 控件尺寸 */
|
||||||
size: {
|
size: {
|
||||||
type: String as PropType<"small" | "default" | "large">
|
type: String as PropType<"small" | "default" | "large">
|
||||||
|
},
|
||||||
|
/** 是否全局禁用,默认 `false` */
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
/** 当内容发生变化时,设置 `resize` 可使其自适应容器位置 */
|
||||||
|
resize: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -57,7 +67,7 @@ export default defineComponent({
|
|||||||
: ref(0);
|
: ref(0);
|
||||||
|
|
||||||
function handleChange({ option, index }, event: Event) {
|
function handleChange({ option, index }, event: Event) {
|
||||||
if (option.disabled) return;
|
if (props.disabled || option.disabled) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
isNumber(props.modelValue)
|
isNumber(props.modelValue)
|
||||||
? emit("update:modelValue", index)
|
? emit("update:modelValue", index)
|
||||||
@@ -67,6 +77,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseenter({ option, index }, event: Event) {
|
function handleMouseenter({ option, index }, event: Event) {
|
||||||
|
if (props.disabled) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
curMouseActive.value = index;
|
curMouseActive.value = index;
|
||||||
if (option.disabled || curIndex.value === index) {
|
if (option.disabled || curIndex.value === index) {
|
||||||
@@ -79,6 +90,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseleave(_, event: Event) {
|
function handleMouseleave(_, event: Event) {
|
||||||
|
if (props.disabled) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
curMouseActive.value = -1;
|
curMouseActive.value = -1;
|
||||||
}
|
}
|
||||||
@@ -101,7 +113,7 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
props.block && handleResizeInit();
|
(props.block || props.resize) && handleResizeInit();
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => curIndex.value,
|
() => curIndex.value,
|
||||||
@@ -124,13 +136,15 @@ export default defineComponent({
|
|||||||
ref={`labelRef${index}`}
|
ref={`labelRef${index}`}
|
||||||
class={[
|
class={[
|
||||||
"pure-segmented-item",
|
"pure-segmented-item",
|
||||||
option?.disabled && "pure-segmented-item-disabled"
|
(props.disabled || option?.disabled) &&
|
||||||
|
"pure-segmented-item-disabled"
|
||||||
]}
|
]}
|
||||||
style={{
|
style={{
|
||||||
background:
|
background:
|
||||||
curMouseActive.value === index ? segmentedItembg.value : "",
|
curMouseActive.value === index ? segmentedItembg.value : "",
|
||||||
color:
|
color: props.disabled
|
||||||
!option.disabled &&
|
? null
|
||||||
|
: !option.disabled &&
|
||||||
(curIndex.value === index || curMouseActive.value === index)
|
(curIndex.value === index || curMouseActive.value === index)
|
||||||
? isDark.value
|
? isDark.value
|
||||||
? "rgba(255, 255, 255, 0.85)"
|
? "rgba(255, 255, 255, 0.85)"
|
||||||
|
|||||||
@@ -44,7 +44,6 @@
|
|||||||
(t.style.width = 0),
|
(t.style.width = 0),
|
||||||
(t.style.height = 0),
|
(t.style.height = 0),
|
||||||
(t.style.overflow = "hidden"),
|
(t.style.overflow = "hidden"),
|
||||||
// eslint-disable-next-line no-self-assign
|
|
||||||
(t = t),
|
(t = t),
|
||||||
(e = document.body).firstChild ? m(t, e.firstChild) : e.appendChild(t));
|
(e = document.body).firstChild ? m(t, e.firstChild) : e.appendChild(t));
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
import { h, onMounted, ref, useSlots } from "vue";
|
import { h, onMounted, ref, useSlots } from "vue";
|
||||||
import { type TippyOptions, useTippy } from "vue-tippy";
|
import { type TippyOptions, useTippy } from "vue-tippy";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "ReText"
|
||||||
|
});
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// 行数
|
// 行数
|
||||||
lineClamp: {
|
lineClamp: {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const getPlatformConfig = async (app: App): Promise<undefined> => {
|
|||||||
})
|
})
|
||||||
.then(({ data: config }) => {
|
.then(({ data: config }) => {
|
||||||
let $config = app.config.globalProperties.$config;
|
let $config = app.config.globalProperties.$config;
|
||||||
// 自动注入项目配置
|
// 自动注入系统配置
|
||||||
if (app && $config && typeof config === "object") {
|
if (app && $config && typeof config === "object") {
|
||||||
$config = Object.assign($config, config);
|
$config = Object.assign($config, config);
|
||||||
app.config.globalProperties.$config = $config;
|
app.config.globalProperties.$config = $config;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import Footer from "./footer/index.vue";
|
import Footer from "./footer/index.vue";
|
||||||
import { useGlobal, isNumber } from "@pureadmin/utils";
|
import { useGlobal, isNumber } from "@pureadmin/utils";
|
||||||
import KeepAliveFrame from "./keepAliveFrame/index.vue";
|
import KeepAliveFrame from "./keepAliveFrame/index.vue";
|
||||||
@@ -10,6 +11,7 @@ const props = defineProps({
|
|||||||
fixedHeader: Boolean
|
fixedHeader: Boolean
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const { $storage, $config } = useGlobal<GlobalPropertiesApi>();
|
const { $storage, $config } = useGlobal<GlobalPropertiesApi>();
|
||||||
|
|
||||||
const isKeepAlive = computed(() => {
|
const isKeepAlive = computed(() => {
|
||||||
@@ -121,7 +123,7 @@ const transitionMain = defineComponent({
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<el-backtop
|
<el-backtop
|
||||||
title="回到顶部"
|
:title="t('buttons.pureBackTop')"
|
||||||
target=".app-main .el-scrollbar__wrap"
|
target=".app-main .el-scrollbar__wrap"
|
||||||
>
|
>
|
||||||
<backTop />
|
<backTop />
|
||||||
|
|||||||
@@ -8,9 +8,11 @@ import Breadcrumb from "./sidebar/breadCrumb.vue";
|
|||||||
import topCollapse from "./sidebar/topCollapse.vue";
|
import topCollapse from "./sidebar/topCollapse.vue";
|
||||||
import { useTranslationLang } from "../hooks/useTranslationLang";
|
import { useTranslationLang } from "../hooks/useTranslationLang";
|
||||||
import globalization from "@/assets/svg/globalization.svg?component";
|
import globalization from "@/assets/svg/globalization.svg?component";
|
||||||
|
import AccountSettingsIcon from "@iconify-icons/ri/user-settings-line";
|
||||||
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
|
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
|
||||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
import Setting from "@iconify-icons/ri/settings-3-line";
|
||||||
import Check from "@iconify-icons/ep/check";
|
import Check from "@iconify-icons/ep/check";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
layout,
|
layout,
|
||||||
device,
|
device,
|
||||||
@@ -21,6 +23,7 @@ const {
|
|||||||
userAvatar,
|
userAvatar,
|
||||||
avatarsStyle,
|
avatarsStyle,
|
||||||
toggleSideBar,
|
toggleSideBar,
|
||||||
|
toAccountSettings,
|
||||||
getDropdownItemStyle,
|
getDropdownItemStyle,
|
||||||
getDropdownItemClass
|
getDropdownItemClass
|
||||||
} = useNav();
|
} = useNav();
|
||||||
@@ -91,6 +94,13 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
|||||||
</span>
|
</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu class="logout">
|
<el-dropdown-menu class="logout">
|
||||||
|
<el-dropdown-item @click="toAccountSettings">
|
||||||
|
<IconifyIconOffline
|
||||||
|
:icon="AccountSettingsIcon"
|
||||||
|
style="margin: 5px"
|
||||||
|
/>
|
||||||
|
{{ t("buttons.pureAccountSettings") }}
|
||||||
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="logout">
|
<el-dropdown-item @click="logout">
|
||||||
<IconifyIconOffline
|
<IconifyIconOffline
|
||||||
:icon="LogoutCircleRLine"
|
:icon="LogoutCircleRLine"
|
||||||
@@ -103,7 +113,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<span
|
<span
|
||||||
class="set-icon navbar-bg-hover"
|
class="set-icon navbar-bg-hover"
|
||||||
:title="t('buttons.pureSystemSet')"
|
:title="t('buttons.pureOpenSystemSet')"
|
||||||
@click="onPanel"
|
@click="onPanel"
|
||||||
>
|
>
|
||||||
<IconifyIconOffline :icon="Setting" />
|
<IconifyIconOffline :icon="Setting" />
|
||||||
@@ -177,7 +187,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
|||||||
}
|
}
|
||||||
|
|
||||||
.logout {
|
.logout {
|
||||||
max-width: 120px;
|
width: 120px;
|
||||||
|
|
||||||
::v-deep(.el-dropdown-menu__item) {
|
::v-deep(.el-dropdown-menu__item) {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import { noticesData } from "./data";
|
import { noticesData } from "./data";
|
||||||
import NoticeList from "./noticeList.vue";
|
import NoticeList from "./noticeList.vue";
|
||||||
import Bell from "@iconify-icons/ep/bell";
|
import Bell from "@iconify-icons/ep/bell";
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const noticesNum = ref(0);
|
const noticesNum = ref(0);
|
||||||
const notices = ref(noticesData);
|
const notices = ref(noticesData);
|
||||||
const activeKey = ref(noticesData[0].key);
|
const activeKey = ref(noticesData[0].key);
|
||||||
@@ -30,7 +32,7 @@ notices.value.map(v => (noticesNum.value += v.list.length));
|
|||||||
>
|
>
|
||||||
<el-empty
|
<el-empty
|
||||||
v-if="notices.length === 0"
|
v-if="notices.length === 0"
|
||||||
description="暂无消息"
|
:description="t('status.pureNoMessage')"
|
||||||
:image-size="60"
|
:image-size="60"
|
||||||
/>
|
/>
|
||||||
<span v-else>
|
<span v-else>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType } from "vue";
|
import { PropType } from "vue";
|
||||||
import { ListItem } from "./data";
|
import { ListItem } from "./data";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import NoticeItem from "./noticeItem.vue";
|
import NoticeItem from "./noticeItem.vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -9,6 +10,8 @@ const props = defineProps({
|
|||||||
default: () => []
|
default: () => []
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -19,5 +22,5 @@ const props = defineProps({
|
|||||||
:noticeItem="item"
|
:noticeItem="item"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<el-empty v-else description="暂无消息" />
|
<el-empty v-else :description="t('status.pureNoMessage')" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import { emitter } from "@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
import { onClickOutside } from "@vueuse/core";
|
import { onClickOutside } from "@vueuse/core";
|
||||||
import { ref, computed, onMounted, onBeforeUnmount } from "vue";
|
import { ref, computed, onMounted, onBeforeUnmount } from "vue";
|
||||||
@@ -25,6 +26,7 @@ const iconClass = computed(() => {
|
|||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const { onReset } = useDataThemeChange();
|
const { onReset } = useDataThemeChange();
|
||||||
|
|
||||||
onClickOutside(target, (event: any) => {
|
onClickOutside(target, (event: any) => {
|
||||||
@@ -51,10 +53,12 @@ onBeforeUnmount(() => {
|
|||||||
<div
|
<div
|
||||||
class="project-configuration border-b-[1px] border-solid border-[var(--pure-border-color)]"
|
class="project-configuration border-b-[1px] border-solid border-[var(--pure-border-color)]"
|
||||||
>
|
>
|
||||||
<h4 class="dark:text-white">项目配置</h4>
|
<h4 class="dark:text-white">
|
||||||
|
{{ t("panel.pureSystemSet") }}
|
||||||
|
</h4>
|
||||||
<span
|
<span
|
||||||
v-tippy="{
|
v-tippy="{
|
||||||
content: '关闭配置',
|
content: t('panel.pureCloseSystemSet'),
|
||||||
placement: 'bottom-start',
|
placement: 'bottom-start',
|
||||||
zIndex: 41000
|
zIndex: 41000
|
||||||
}"
|
}"
|
||||||
@@ -78,7 +82,7 @@ onBeforeUnmount(() => {
|
|||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-tippy="{
|
v-tippy="{
|
||||||
content: '清空缓存并返回登录页',
|
content: t('panel.pureClearCacheAndToLogin'),
|
||||||
placement: 'left-start',
|
placement: 'left-start',
|
||||||
zIndex: 41000
|
zIndex: 41000
|
||||||
}"
|
}"
|
||||||
@@ -87,7 +91,7 @@ onBeforeUnmount(() => {
|
|||||||
bg
|
bg
|
||||||
@click="onReset"
|
@click="onReset"
|
||||||
>
|
>
|
||||||
清空缓存
|
{{ t("panel.pureClearCache") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import { useNav } from "@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import mdiKeyboardEsc from "@/assets/svg/keyboard_esc.svg?component";
|
import mdiKeyboardEsc from "@/assets/svg/keyboard_esc.svg?component";
|
||||||
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
|
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
|
||||||
@@ -9,6 +10,7 @@ const props = withDefaults(defineProps<{ total: number }>(), {
|
|||||||
total: 0
|
total: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const { device } = useNav();
|
const { device } = useNav();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -16,22 +18,22 @@ const { device } = useNav();
|
|||||||
<div class="search-footer text-[#333] dark:text-white">
|
<div class="search-footer text-[#333] dark:text-white">
|
||||||
<span class="search-footer-item">
|
<span class="search-footer-item">
|
||||||
<enterOutlined class="icon" />
|
<enterOutlined class="icon" />
|
||||||
确认
|
{{ t("buttons.pureConfirm") }}
|
||||||
</span>
|
</span>
|
||||||
<span class="search-footer-item">
|
<span class="search-footer-item">
|
||||||
<IconifyIconOffline :icon="ArrowUpLine" class="icon" />
|
<IconifyIconOffline :icon="ArrowUpLine" class="icon" />
|
||||||
<IconifyIconOffline :icon="ArrowDownLine" class="icon" />
|
<IconifyIconOffline :icon="ArrowDownLine" class="icon" />
|
||||||
切换
|
{{ t("buttons.pureSwitch") }}
|
||||||
</span>
|
</span>
|
||||||
<span class="search-footer-item">
|
<span class="search-footer-item">
|
||||||
<mdiKeyboardEsc class="icon" />
|
<mdiKeyboardEsc class="icon" />
|
||||||
关闭
|
{{ t("buttons.pureClose") }}
|
||||||
</span>
|
</span>
|
||||||
<p
|
<p
|
||||||
v-if="device !== 'mobile' && props.total > 0"
|
v-if="device !== 'mobile' && props.total > 0"
|
||||||
class="search-footer-total"
|
class="search-footer-total"
|
||||||
>
|
>
|
||||||
共{{ props.total }}项
|
{{ `${t("search.pureTotal")} ${props.total}` }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Sortable from "sortablejs";
|
import Sortable from "sortablejs";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import SearchHistoryItem from "./SearchHistoryItem.vue";
|
import SearchHistoryItem from "./SearchHistoryItem.vue";
|
||||||
import type { optionsItem, dragItem, Props } from "../types";
|
import type { optionsItem, dragItem, Props } from "../types";
|
||||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||||
@@ -19,6 +20,7 @@ const innerHeight = ref();
|
|||||||
/** 判断是否停止鼠标移入事件处理 */
|
/** 判断是否停止鼠标移入事件处理 */
|
||||||
const stopMouseEvent = ref(false);
|
const stopMouseEvent = ref(false);
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const emit = defineEmits<Emits>();
|
const emit = defineEmits<Emits>();
|
||||||
const instance = getCurrentInstance()!;
|
const instance = getCurrentInstance()!;
|
||||||
const props = withDefaults(defineProps<Props>(), {});
|
const props = withDefaults(defineProps<Props>(), {});
|
||||||
@@ -141,7 +143,9 @@ defineExpose({ handleScroll });
|
|||||||
<template>
|
<template>
|
||||||
<div ref="historyRef" class="history">
|
<div ref="historyRef" class="history">
|
||||||
<template v-if="historyList.length">
|
<template v-if="historyList.length">
|
||||||
<div :style="titleStyle">搜索历史</div>
|
<div :style="titleStyle">
|
||||||
|
{{ t("search.pureHistory") }}
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
v-for="(item, index) in historyList"
|
v-for="(item, index) in historyList"
|
||||||
:key="item.path"
|
:key="item.path"
|
||||||
@@ -160,7 +164,9 @@ defineExpose({ handleScroll });
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="collectList.length">
|
<template v-if="collectList.length">
|
||||||
<div :style="titleStyle">
|
<div :style="titleStyle">
|
||||||
收藏{{ collectList.length > 1 ? "(可拖拽排序)" : "" }}
|
{{
|
||||||
|
`${t("search.pureCollect")}${collectList.length > 1 ? t("search.pureDragSort") : ""}`
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="collect-container">
|
<div class="collect-container">
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import { useRouter } from "vue-router";
|
|||||||
import SearchResult from "./SearchResult.vue";
|
import SearchResult from "./SearchResult.vue";
|
||||||
import SearchFooter from "./SearchFooter.vue";
|
import SearchFooter from "./SearchFooter.vue";
|
||||||
import { useNav } from "@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import { transformI18n } from "@/plugins/i18n";
|
|
||||||
import SearchHistory from "./SearchHistory.vue";
|
import SearchHistory from "./SearchHistory.vue";
|
||||||
|
import { transformI18n, $t } from "@/plugins/i18n";
|
||||||
import type { optionsItem, dragItem } from "../types";
|
import type { optionsItem, dragItem } from "../types";
|
||||||
import { ref, computed, shallowRef, watch } from "vue";
|
import { ref, computed, shallowRef, watch } from "vue";
|
||||||
import { useDebounceFn, onKeyStroke } from "@vueuse/core";
|
import { useDebounceFn, onKeyStroke } from "@vueuse/core";
|
||||||
@@ -29,7 +29,7 @@ const emit = defineEmits<Emits>();
|
|||||||
const props = withDefaults(defineProps<Props>(), {});
|
const props = withDefaults(defineProps<Props>(), {});
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { locale } = useI18n();
|
const { t, locale } = useI18n();
|
||||||
|
|
||||||
const HISTORY_TYPE = "history";
|
const HISTORY_TYPE = "history";
|
||||||
const COLLECT_TYPE = "collect";
|
const COLLECT_TYPE = "collect";
|
||||||
@@ -293,7 +293,7 @@ onKeyStroke("ArrowDown", handleDown);
|
|||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
size="large"
|
size="large"
|
||||||
clearable
|
clearable
|
||||||
placeholder="搜索菜单(中文模式下支持拼音搜索)"
|
:placeholder="t('search.purePlaceholder')"
|
||||||
@input="handleSearch"
|
@input="handleSearch"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
@@ -305,7 +305,7 @@ onKeyStroke("ArrowDown", handleDown);
|
|||||||
</el-input>
|
</el-input>
|
||||||
<div class="search-content">
|
<div class="search-content">
|
||||||
<el-scrollbar ref="scrollbarRef" max-height="calc(90vh - 140px)">
|
<el-scrollbar ref="scrollbarRef" max-height="calc(90vh - 140px)">
|
||||||
<el-empty v-if="showEmpty" description="暂无搜索结果" />
|
<el-empty v-if="showEmpty" :description="t('search.pureEmpty')" />
|
||||||
<SearchHistory
|
<SearchHistory
|
||||||
v-if="showSearchHistory"
|
v-if="showSearchHistory"
|
||||||
ref="historyRef"
|
ref="historyRef"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
onUnmounted,
|
onUnmounted,
|
||||||
onBeforeMount
|
onBeforeMount
|
||||||
} from "vue";
|
} from "vue";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import panel from "../panel/index.vue";
|
import panel from "../panel/index.vue";
|
||||||
import { emitter } from "@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
import { useNav } from "@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
@@ -26,6 +27,7 @@ import dayIcon from "@/assets/svg/day.svg?component";
|
|||||||
import darkIcon from "@/assets/svg/dark.svg?component";
|
import darkIcon from "@/assets/svg/dark.svg?component";
|
||||||
import systemIcon from "@/assets/svg/system.svg?component";
|
import systemIcon from "@/assets/svg/system.svg?component";
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const { device } = useNav();
|
const { device } = useNav();
|
||||||
const { isDark } = useDark();
|
const { isDark } = useDark();
|
||||||
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
||||||
@@ -145,18 +147,20 @@ function setFalse(Doms): any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 页宽 */
|
/** 页宽 */
|
||||||
const stretchTypeOptions: Array<OptionsType> = [
|
const stretchTypeOptions = computed<Array<OptionsType>>(() => {
|
||||||
|
return [
|
||||||
{
|
{
|
||||||
label: "固定",
|
label: t("panel.pureStretchFixed"),
|
||||||
tip: "紧凑页面,轻松找到所需信息",
|
tip: t("panel.pureStretchFixedTip"),
|
||||||
value: "fixed"
|
value: "fixed"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "自定义",
|
label: t("panel.pureStretchCustom"),
|
||||||
tip: "最小1280、最大1600",
|
tip: t("panel.pureStretchCustomTip"),
|
||||||
value: "custom"
|
value: "custom"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
});
|
||||||
|
|
||||||
const setStretch = value => {
|
const setStretch = value => {
|
||||||
settings.stretch = value;
|
settings.stretch = value;
|
||||||
@@ -194,41 +198,43 @@ const pClass = computed(() => {
|
|||||||
const themeOptions = computed<Array<OptionsType>>(() => {
|
const themeOptions = computed<Array<OptionsType>>(() => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: "浅色",
|
label: t("panel.pureOverallStyleLight"),
|
||||||
icon: dayIcon,
|
icon: dayIcon,
|
||||||
theme: "light",
|
theme: "light",
|
||||||
tip: "清新启航,点亮舒适的工作界面",
|
tip: t("panel.pureOverallStyleLightTip"),
|
||||||
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "深色",
|
label: t("panel.pureOverallStyleDark"),
|
||||||
icon: darkIcon,
|
icon: darkIcon,
|
||||||
theme: "dark",
|
theme: "dark",
|
||||||
tip: "月光序曲,沉醉于夜的静谧雅致",
|
tip: t("panel.pureOverallStyleDarkTip"),
|
||||||
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "自动",
|
label: t("panel.pureOverallStyleSystem"),
|
||||||
icon: systemIcon,
|
icon: systemIcon,
|
||||||
theme: "system",
|
theme: "system",
|
||||||
tip: "同步时光,界面随晨昏自然呼应",
|
tip: t("panel.pureOverallStyleSystemTip"),
|
||||||
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
iconAttrs: { fill: isDark.value ? "#fff" : "#000" }
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
const markOptions: Array<OptionsType> = [
|
const markOptions = computed<Array<OptionsType>>(() => {
|
||||||
|
return [
|
||||||
{
|
{
|
||||||
label: "灵动",
|
label: t("panel.pureTagsStyleSmart"),
|
||||||
tip: "灵动标签,添趣生辉",
|
tip: t("panel.pureTagsStyleSmartTip"),
|
||||||
value: "smart"
|
value: "smart"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "卡片",
|
label: t("panel.pureTagsStyleCard"),
|
||||||
tip: "卡片标签,高效浏览",
|
tip: t("panel.pureTagsStyleCardTip"),
|
||||||
value: "card"
|
value: "card"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
});
|
||||||
|
|
||||||
/** 设置导航模式 */
|
/** 设置导航模式 */
|
||||||
function setLayoutModel(layout: string) {
|
function setLayoutModel(layout: string) {
|
||||||
@@ -291,7 +297,7 @@ function watchSystemThemeChange() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
/* 初始化项目配置 */
|
/* 初始化系统配置 */
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
watchSystemThemeChange();
|
watchSystemThemeChange();
|
||||||
settings.greyVal &&
|
settings.greyVal &&
|
||||||
@@ -309,8 +315,9 @@ onUnmounted(() => removeMatchMedia);
|
|||||||
<template>
|
<template>
|
||||||
<panel>
|
<panel>
|
||||||
<div class="p-5">
|
<div class="p-5">
|
||||||
<p :class="pClass">整体风格</p>
|
<p :class="pClass">{{ t("panel.pureOverallStyle") }}</p>
|
||||||
<Segmented
|
<Segmented
|
||||||
|
resize
|
||||||
class="select-none"
|
class="select-none"
|
||||||
:modelValue="overallStyle === 'system' ? 2 : dataTheme ? 1 : 0"
|
:modelValue="overallStyle === 'system' ? 2 : dataTheme ? 1 : 0"
|
||||||
:options="themeOptions"
|
:options="themeOptions"
|
||||||
@@ -326,7 +333,7 @@ onUnmounted(() => removeMatchMedia);
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<p :class="['mt-5', pClass]">主题色</p>
|
<p :class="['mt-5', pClass]">{{ t("panel.pureThemeColor") }}</p>
|
||||||
<ul class="theme-color">
|
<ul class="theme-color">
|
||||||
<li
|
<li
|
||||||
v-for="(item, index) in themeColors"
|
v-for="(item, index) in themeColors"
|
||||||
@@ -345,12 +352,12 @@ onUnmounted(() => removeMatchMedia);
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p :class="['mt-5', pClass]">导航模式</p>
|
<p :class="['mt-5', pClass]">{{ t("panel.pureLayoutModel") }}</p>
|
||||||
<ul class="pure-theme">
|
<ul class="pure-theme">
|
||||||
<li
|
<li
|
||||||
ref="verticalRef"
|
ref="verticalRef"
|
||||||
v-tippy="{
|
v-tippy="{
|
||||||
content: '左侧菜单,亲切熟悉',
|
content: t('panel.pureVerticalTip'),
|
||||||
zIndex: 41000
|
zIndex: 41000
|
||||||
}"
|
}"
|
||||||
:class="layoutTheme.layout === 'vertical' ? 'is-select' : ''"
|
:class="layoutTheme.layout === 'vertical' ? 'is-select' : ''"
|
||||||
@@ -363,7 +370,7 @@ onUnmounted(() => removeMatchMedia);
|
|||||||
v-if="device !== 'mobile'"
|
v-if="device !== 'mobile'"
|
||||||
ref="horizontalRef"
|
ref="horizontalRef"
|
||||||
v-tippy="{
|
v-tippy="{
|
||||||
content: '顶部菜单,简洁概览',
|
content: t('panel.pureHorizontalTip'),
|
||||||
zIndex: 41000
|
zIndex: 41000
|
||||||
}"
|
}"
|
||||||
:class="layoutTheme.layout === 'horizontal' ? 'is-select' : ''"
|
:class="layoutTheme.layout === 'horizontal' ? 'is-select' : ''"
|
||||||
@@ -376,7 +383,7 @@ onUnmounted(() => removeMatchMedia);
|
|||||||
v-if="device !== 'mobile'"
|
v-if="device !== 'mobile'"
|
||||||
ref="mixRef"
|
ref="mixRef"
|
||||||
v-tippy="{
|
v-tippy="{
|
||||||
content: '混合菜单,灵活多变',
|
content: t('panel.pureMixTip'),
|
||||||
zIndex: 41000
|
zIndex: 41000
|
||||||
}"
|
}"
|
||||||
:class="layoutTheme.layout === 'mix' ? 'is-select' : ''"
|
:class="layoutTheme.layout === 'mix' ? 'is-select' : ''"
|
||||||
@@ -388,8 +395,9 @@ onUnmounted(() => removeMatchMedia);
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<span v-if="useAppStoreHook().getViewportWidth > 1280">
|
<span v-if="useAppStoreHook().getViewportWidth > 1280">
|
||||||
<p :class="['mt-5', pClass]">页宽</p>
|
<p :class="['mt-5', pClass]">{{ t("panel.pureStretch") }}</p>
|
||||||
<Segmented
|
<Segmented
|
||||||
|
resize
|
||||||
class="mb-2 select-none"
|
class="mb-2 select-none"
|
||||||
:modelValue="isNumber(settings.stretch) ? 1 : 0"
|
:modelValue="isNumber(settings.stretch) ? 1 : 0"
|
||||||
:options="stretchTypeOptions"
|
:options="stretchTypeOptions"
|
||||||
@@ -430,53 +438,56 @@ onUnmounted(() => removeMatchMedia);
|
|||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<p :class="['mt-4', pClass]">页签风格</p>
|
<p :class="['mt-4', pClass]">{{ t("panel.pureTagsStyle") }}</p>
|
||||||
<Segmented
|
<Segmented
|
||||||
|
resize
|
||||||
class="select-none"
|
class="select-none"
|
||||||
:modelValue="markValue === 'smart' ? 0 : 1"
|
:modelValue="markValue === 'smart' ? 0 : 1"
|
||||||
:options="markOptions"
|
:options="markOptions"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<p class="mt-5 font-medium text-sm dark:text-white">界面显示</p>
|
<p class="mt-5 font-medium text-sm dark:text-white">
|
||||||
|
{{ t("panel.pureInterfaceDisplay") }}
|
||||||
|
</p>
|
||||||
<ul class="setting">
|
<ul class="setting">
|
||||||
<li>
|
<li>
|
||||||
<span class="dark:text-white">灰色模式</span>
|
<span class="dark:text-white">{{ t("panel.pureGreyModel") }}</span>
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="settings.greyVal"
|
v-model="settings.greyVal"
|
||||||
inline-prompt
|
inline-prompt
|
||||||
active-text="开"
|
:active-text="t('buttons.pureOpenText')"
|
||||||
inactive-text="关"
|
:inactive-text="t('buttons.pureCloseText')"
|
||||||
@change="greyChange"
|
@change="greyChange"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span class="dark:text-white">色弱模式</span>
|
<span class="dark:text-white">{{ t("panel.pureWeakModel") }}</span>
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="settings.weakVal"
|
v-model="settings.weakVal"
|
||||||
inline-prompt
|
inline-prompt
|
||||||
active-text="开"
|
:active-text="t('buttons.pureOpenText')"
|
||||||
inactive-text="关"
|
:inactive-text="t('buttons.pureCloseText')"
|
||||||
@change="weekChange"
|
@change="weekChange"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span class="dark:text-white">隐藏标签页</span>
|
<span class="dark:text-white">{{ t("panel.pureHiddenTags") }}</span>
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="settings.tabsVal"
|
v-model="settings.tabsVal"
|
||||||
inline-prompt
|
inline-prompt
|
||||||
active-text="开"
|
:active-text="t('buttons.pureOpenText')"
|
||||||
inactive-text="关"
|
:inactive-text="t('buttons.pureCloseText')"
|
||||||
@change="tagsChange"
|
@change="tagsChange"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span class="dark:text-white">隐藏页脚</span>
|
<span class="dark:text-white">{{ t("panel.pureHiddenFooter") }}</span>
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="settings.hideFooter"
|
v-model="settings.hideFooter"
|
||||||
inline-prompt
|
inline-prompt
|
||||||
active-text="开"
|
:active-text="t('buttons.pureOpenText')"
|
||||||
inactive-text="关"
|
:inactive-text="t('buttons.pureCloseText')"
|
||||||
@change="hideFooterChange"
|
@change="hideFooterChange"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
@@ -487,18 +498,20 @@ onUnmounted(() => removeMatchMedia);
|
|||||||
inline-prompt
|
inline-prompt
|
||||||
:active-value="true"
|
:active-value="true"
|
||||||
:inactive-value="false"
|
:inactive-value="false"
|
||||||
active-text="开"
|
:active-text="t('buttons.pureOpenText')"
|
||||||
inactive-text="关"
|
:inactive-text="t('buttons.pureCloseText')"
|
||||||
@change="logoChange"
|
@change="logoChange"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span class="dark:text-white">页签持久化</span>
|
<span class="dark:text-white">
|
||||||
|
{{ t("panel.pureMultiTagsCache") }}
|
||||||
|
</span>
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="settings.multiTagsCache"
|
v-model="settings.multiTagsCache"
|
||||||
inline-prompt
|
inline-prompt
|
||||||
active-text="开"
|
:active-text="t('buttons.pureOpenText')"
|
||||||
inactive-text="关"
|
:inactive-text="t('buttons.pureCloseText')"
|
||||||
@change="multiTagsCacheChange"
|
@change="multiTagsCacheChange"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import { useGlobal } from "@pureadmin/utils";
|
import { useGlobal } from "@pureadmin/utils";
|
||||||
import { useNav } from "@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
isActive: false
|
isActive: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const { tooltipEffect } = useNav();
|
const { tooltipEffect } = useNav();
|
||||||
|
|
||||||
const iconClass = computed(() => {
|
const iconClass = computed(() => {
|
||||||
@@ -34,7 +36,9 @@ const toggleClick = () => {
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-tippy="{
|
v-tippy="{
|
||||||
content: props.isActive ? '点击折叠' : '点击展开',
|
content: props.isActive
|
||||||
|
? t('buttons.pureClickCollapse')
|
||||||
|
: t('buttons.pureClickExpand'),
|
||||||
theme: tooltipEffect,
|
theme: tooltipEffect,
|
||||||
hideOnClick: 'toggle',
|
hideOnClick: 'toggle',
|
||||||
placement: 'right'
|
placement: 'right'
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { useNav } from "@/layout/hooks/useNav";
|
|||||||
import { useTranslationLang } from "../../hooks/useTranslationLang";
|
import { useTranslationLang } from "../../hooks/useTranslationLang";
|
||||||
import { usePermissionStoreHook } from "@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
import globalization from "@/assets/svg/globalization.svg?component";
|
import globalization from "@/assets/svg/globalization.svg?component";
|
||||||
|
import AccountSettingsIcon from "@iconify-icons/ri/user-settings-line";
|
||||||
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
|
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
|
||||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
import Setting from "@iconify-icons/ri/settings-3-line";
|
||||||
import Check from "@iconify-icons/ep/check";
|
import Check from "@iconify-icons/ep/check";
|
||||||
@@ -26,6 +27,7 @@ const {
|
|||||||
username,
|
username,
|
||||||
userAvatar,
|
userAvatar,
|
||||||
avatarsStyle,
|
avatarsStyle,
|
||||||
|
toAccountSettings,
|
||||||
getDropdownItemStyle,
|
getDropdownItemStyle,
|
||||||
getDropdownItemClass
|
getDropdownItemClass
|
||||||
} = useNav();
|
} = useNav();
|
||||||
@@ -107,6 +109,13 @@ nextTick(() => {
|
|||||||
<p v-if="username" class="dark:text-white">{{ username }}</p>
|
<p v-if="username" class="dark:text-white">{{ username }}</p>
|
||||||
</span>
|
</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
|
<el-dropdown-item @click="toAccountSettings">
|
||||||
|
<IconifyIconOffline
|
||||||
|
:icon="AccountSettingsIcon"
|
||||||
|
style="margin: 5px"
|
||||||
|
/>
|
||||||
|
{{ t("buttons.pureAccountSettings") }}
|
||||||
|
</el-dropdown-item>
|
||||||
<el-dropdown-menu class="logout">
|
<el-dropdown-menu class="logout">
|
||||||
<el-dropdown-item @click="logout">
|
<el-dropdown-item @click="logout">
|
||||||
<IconifyIconOffline
|
<IconifyIconOffline
|
||||||
@@ -120,7 +129,7 @@ nextTick(() => {
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<span
|
<span
|
||||||
class="set-icon navbar-bg-hover"
|
class="set-icon navbar-bg-hover"
|
||||||
:title="t('buttons.pureSystemSet')"
|
:title="t('buttons.pureOpenSystemSet')"
|
||||||
@click="onPanel"
|
@click="onPanel"
|
||||||
>
|
>
|
||||||
<IconifyIconOffline :icon="Setting" />
|
<IconifyIconOffline :icon="Setting" />
|
||||||
@@ -151,7 +160,7 @@ nextTick(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.logout {
|
.logout {
|
||||||
max-width: 120px;
|
width: 120px;
|
||||||
|
|
||||||
::v-deep(.el-dropdown-menu__item) {
|
::v-deep(.el-dropdown-menu__item) {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import { useGlobal } from "@pureadmin/utils";
|
import { useGlobal } from "@pureadmin/utils";
|
||||||
import { useNav } from "@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
isActive: false
|
isActive: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const { tooltipEffect } = useNav();
|
const { tooltipEffect } = useNav();
|
||||||
|
|
||||||
const iconClass = computed(() => {
|
const iconClass = computed(() => {
|
||||||
@@ -44,7 +46,9 @@ const toggleClick = () => {
|
|||||||
<div class="left-collapse">
|
<div class="left-collapse">
|
||||||
<IconifyIconOffline
|
<IconifyIconOffline
|
||||||
v-tippy="{
|
v-tippy="{
|
||||||
content: props.isActive ? '点击折叠' : '点击展开',
|
content: props.isActive
|
||||||
|
? t('buttons.pureClickCollapse')
|
||||||
|
: t('buttons.pureClickExpand'),
|
||||||
theme: tooltipEffect,
|
theme: tooltipEffect,
|
||||||
hideOnClick: 'toggle',
|
hideOnClick: 'toggle',
|
||||||
placement: 'right'
|
placement: 'right'
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { getParentPaths, findRouteByPath } from "@/router/utils";
|
|||||||
import { useTranslationLang } from "../../hooks/useTranslationLang";
|
import { useTranslationLang } from "../../hooks/useTranslationLang";
|
||||||
import { usePermissionStoreHook } from "@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
import globalization from "@/assets/svg/globalization.svg?component";
|
import globalization from "@/assets/svg/globalization.svg?component";
|
||||||
|
import AccountSettingsIcon from "@iconify-icons/ri/user-settings-line";
|
||||||
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
|
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
|
||||||
import Setting from "@iconify-icons/ri/settings-3-line";
|
import Setting from "@iconify-icons/ri/settings-3-line";
|
||||||
import Check from "@iconify-icons/ep/check";
|
import Check from "@iconify-icons/ep/check";
|
||||||
@@ -30,6 +31,7 @@ const {
|
|||||||
userAvatar,
|
userAvatar,
|
||||||
getDivStyle,
|
getDivStyle,
|
||||||
avatarsStyle,
|
avatarsStyle,
|
||||||
|
toAccountSettings,
|
||||||
getDropdownItemStyle,
|
getDropdownItemStyle,
|
||||||
getDropdownItemClass
|
getDropdownItemClass
|
||||||
} = useNav();
|
} = useNav();
|
||||||
@@ -140,6 +142,13 @@ watch(
|
|||||||
<p v-if="username" class="dark:text-white">{{ username }}</p>
|
<p v-if="username" class="dark:text-white">{{ username }}</p>
|
||||||
</span>
|
</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
|
<el-dropdown-item @click="toAccountSettings">
|
||||||
|
<IconifyIconOffline
|
||||||
|
:icon="AccountSettingsIcon"
|
||||||
|
style="margin: 5px"
|
||||||
|
/>
|
||||||
|
{{ t("buttons.pureAccountSettings") }}
|
||||||
|
</el-dropdown-item>
|
||||||
<el-dropdown-menu class="logout">
|
<el-dropdown-menu class="logout">
|
||||||
<el-dropdown-item @click="logout">
|
<el-dropdown-item @click="logout">
|
||||||
<IconifyIconOffline
|
<IconifyIconOffline
|
||||||
@@ -153,7 +162,7 @@ watch(
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<span
|
<span
|
||||||
class="set-icon navbar-bg-hover"
|
class="set-icon navbar-bg-hover"
|
||||||
:title="t('buttons.pureSystemSet')"
|
:title="t('buttons.pureOpenSystemSet')"
|
||||||
@click="onPanel"
|
@click="onPanel"
|
||||||
>
|
>
|
||||||
<IconifyIconOffline :icon="Setting" />
|
<IconifyIconOffline :icon="Setting" />
|
||||||
@@ -184,7 +193,7 @@ watch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
.logout {
|
.logout {
|
||||||
max-width: 120px;
|
width: 120px;
|
||||||
|
|
||||||
::v-deep(.el-dropdown-menu__item) {
|
::v-deep(.el-dropdown-menu__item) {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ function resolvePath(routePath) {
|
|||||||
props.item?.pathList?.length === 2)
|
props.item?.pathList?.length === 2)
|
||||||
"
|
"
|
||||||
truncated
|
truncated
|
||||||
class="!px-4 !text-inherit"
|
class="!w-full !px-4 !text-inherit"
|
||||||
>
|
>
|
||||||
{{ transformI18n(onlyOneChild.meta.title) }}
|
{{ transformI18n(onlyOneChild.meta.title) }}
|
||||||
</el-text>
|
</el-text>
|
||||||
@@ -157,7 +157,7 @@ function resolvePath(routePath) {
|
|||||||
offset: [0, -10],
|
offset: [0, -10],
|
||||||
theme: tooltipEffect
|
theme: tooltipEffect
|
||||||
}"
|
}"
|
||||||
class="!text-inherit"
|
class="!w-full !text-inherit"
|
||||||
>
|
>
|
||||||
{{ transformI18n(onlyOneChild.meta.title) }}
|
{{ transformI18n(onlyOneChild.meta.title) }}
|
||||||
</ReText>
|
</ReText>
|
||||||
@@ -185,7 +185,9 @@ function resolvePath(routePath) {
|
|||||||
</div>
|
</div>
|
||||||
<ReText
|
<ReText
|
||||||
v-if="
|
v-if="
|
||||||
!(
|
layout === 'mix' && toRaw(props.item.meta.icon)
|
||||||
|
? !isCollapse || props.item?.pathList?.length !== 2
|
||||||
|
: !(
|
||||||
layout === 'vertical' &&
|
layout === 'vertical' &&
|
||||||
isCollapse &&
|
isCollapse &&
|
||||||
toRaw(props.item.meta.icon) &&
|
toRaw(props.item.meta.icon) &&
|
||||||
@@ -197,6 +199,7 @@ function resolvePath(routePath) {
|
|||||||
theme: tooltipEffect
|
theme: tooltipEffect
|
||||||
}"
|
}"
|
||||||
:class="{
|
:class="{
|
||||||
|
'!w-full': true,
|
||||||
'!text-inherit': true,
|
'!text-inherit': true,
|
||||||
'!px-4':
|
'!px-4':
|
||||||
layout !== 'horizontal' &&
|
layout !== 'horizontal' &&
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import MenuFold from "@iconify-icons/ri/menu-fold-fill";
|
import MenuFold from "@iconify-icons/ri/menu-fold-fill";
|
||||||
import MenuUnfold from "@iconify-icons/ri/menu-unfold-fill";
|
import MenuUnfold from "@iconify-icons/ri/menu-unfold-fill";
|
||||||
|
|
||||||
@@ -10,6 +11,8 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
isActive: false
|
isActive: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: "toggleClick"): void;
|
(e: "toggleClick"): void;
|
||||||
}>();
|
}>();
|
||||||
@@ -22,7 +25,11 @@ const toggleClick = () => {
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="px-3 mr-1 navbar-bg-hover"
|
class="px-3 mr-1 navbar-bg-hover"
|
||||||
:title="props.isActive ? '点击折叠' : '点击展开'"
|
:title="
|
||||||
|
props.isActive
|
||||||
|
? t('buttons.pureClickCollapse')
|
||||||
|
: t('buttons.pureClickExpand')
|
||||||
|
"
|
||||||
@click="toggleClick"
|
@click="toggleClick"
|
||||||
>
|
>
|
||||||
<IconifyIconOffline
|
<IconifyIconOffline
|
||||||
|
|||||||
@@ -90,6 +90,10 @@
|
|||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixed-tag {
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { onClickOutside } from "@vueuse/core";
|
|||||||
import { handleAliveRoute, getTopMenu } from "@/router/utils";
|
import { handleAliveRoute, getTopMenu } from "@/router/utils";
|
||||||
import { useSettingStoreHook } from "@/store/modules/settings";
|
import { useSettingStoreHook } from "@/store/modules/settings";
|
||||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
import { ref, watch, unref, toRaw, nextTick, onBeforeUnmount } from "vue";
|
import { ref, watch, unref, toRaw, nextTick, onBeforeUnmount } from "vue";
|
||||||
import {
|
import {
|
||||||
delay,
|
delay,
|
||||||
@@ -59,6 +60,10 @@ const contextmenuRef = ref();
|
|||||||
const isShowArrow = ref(false);
|
const isShowArrow = ref(false);
|
||||||
const topPath = getTopMenu()?.path;
|
const topPath = getTopMenu()?.path;
|
||||||
const { VITE_HIDE_HOME } = import.meta.env;
|
const { VITE_HIDE_HOME } = import.meta.env;
|
||||||
|
const fixedTags = [
|
||||||
|
...routerArrays,
|
||||||
|
...usePermissionStoreHook().flatteningRoutes.filter(v => v?.meta?.fixedTag)
|
||||||
|
];
|
||||||
|
|
||||||
const dynamicTagView = async () => {
|
const dynamicTagView = async () => {
|
||||||
await nextTick();
|
await nextTick();
|
||||||
@@ -228,10 +233,13 @@ function deleteDynamicTag(obj: any, current: any, tag?: string) {
|
|||||||
other?: boolean
|
other?: boolean
|
||||||
): void => {
|
): void => {
|
||||||
if (other) {
|
if (other) {
|
||||||
useMultiTagsStoreHook().handleTags("equal", [
|
useMultiTagsStoreHook().handleTags(
|
||||||
VITE_HIDE_HOME === "false" ? routerArrays[0] : toRaw(getTopMenu()),
|
"equal",
|
||||||
|
[
|
||||||
|
VITE_HIDE_HOME === "false" ? fixedTags : toRaw(getTopMenu()),
|
||||||
obj
|
obj
|
||||||
]);
|
].flat()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
useMultiTagsStoreHook().handleTags("splice", "", {
|
useMultiTagsStoreHook().handleTags("splice", "", {
|
||||||
startIndex,
|
startIndex,
|
||||||
@@ -244,7 +252,7 @@ function deleteDynamicTag(obj: any, current: any, tag?: string) {
|
|||||||
if (tag === "other") {
|
if (tag === "other") {
|
||||||
spliceRoute(1, 1, true);
|
spliceRoute(1, 1, true);
|
||||||
} else if (tag === "left") {
|
} else if (tag === "left") {
|
||||||
spliceRoute(1, valueIndex - 1);
|
spliceRoute(fixedTags.length, valueIndex - 1, true);
|
||||||
} else if (tag === "right") {
|
} else if (tag === "right") {
|
||||||
spliceRoute(valueIndex + 1, multiTags.value.length);
|
spliceRoute(valueIndex + 1, multiTags.value.length);
|
||||||
} else {
|
} else {
|
||||||
@@ -321,10 +329,11 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) {
|
|||||||
case 5:
|
case 5:
|
||||||
// 关闭全部标签页
|
// 关闭全部标签页
|
||||||
useMultiTagsStoreHook().handleTags("splice", "", {
|
useMultiTagsStoreHook().handleTags("splice", "", {
|
||||||
startIndex: 1,
|
startIndex: fixedTags.length,
|
||||||
length: multiTags.value.length
|
length: multiTags.value.length
|
||||||
});
|
});
|
||||||
router.push(topPath);
|
router.push(topPath);
|
||||||
|
// router.push(fixedTags[fixedTags.length - 1]?.path);
|
||||||
handleAliveRoute(route as ToRouteType);
|
handleAliveRoute(route as ToRouteType);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
@@ -363,10 +372,14 @@ function showMenus(value: boolean) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function disabledMenus(value: boolean) {
|
function disabledMenus(value: boolean, fixedTag = false) {
|
||||||
Array.of(1, 2, 3, 4, 5).forEach(v => {
|
Array.of(1, 2, 3, 4, 5).forEach(v => {
|
||||||
tagsViews[v].disabled = value;
|
tagsViews[v].disabled = value;
|
||||||
});
|
});
|
||||||
|
if (fixedTag) {
|
||||||
|
tagsViews[2].show = false;
|
||||||
|
tagsViews[2].disabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 检查当前右键的菜单两边是否存在别的菜单,如果左侧的菜单是顶级菜单,则不显示关闭左侧标签页,如果右侧没有菜单,则不显示关闭右侧标签页 */
|
/** 检查当前右键的菜单两边是否存在别的菜单,如果左侧的菜单是顶级菜单,则不显示关闭左侧标签页,如果右侧没有菜单,则不显示关闭右侧标签页 */
|
||||||
@@ -383,6 +396,13 @@ function showMenuModel(
|
|||||||
} else {
|
} else {
|
||||||
currentIndex = allRoute.findIndex(v => isEqual(v.query, query));
|
currentIndex = allRoute.findIndex(v => isEqual(v.query, query));
|
||||||
}
|
}
|
||||||
|
function fixedTagDisabled() {
|
||||||
|
if (allRoute[currentIndex]?.meta?.fixedTag) {
|
||||||
|
Array.of(1, 2, 3, 4, 5).forEach(v => {
|
||||||
|
tagsViews[v].disabled = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
showMenus(true);
|
showMenus(true);
|
||||||
|
|
||||||
@@ -401,6 +421,7 @@ function showMenuModel(
|
|||||||
tagsViews[v].disabled = false;
|
tagsViews[v].disabled = false;
|
||||||
});
|
});
|
||||||
tagsViews[2].disabled = true;
|
tagsViews[2].disabled = true;
|
||||||
|
fixedTagDisabled();
|
||||||
} else if (currentIndex === 1 && routeLength === 2) {
|
} else if (currentIndex === 1 && routeLength === 2) {
|
||||||
disabledMenus(false);
|
disabledMenus(false);
|
||||||
// 左侧的菜单是顶级菜单,右侧不存在别的菜单
|
// 左侧的菜单是顶级菜单,右侧不存在别的菜单
|
||||||
@@ -408,6 +429,7 @@ function showMenuModel(
|
|||||||
tagsViews[v].show = false;
|
tagsViews[v].show = false;
|
||||||
tagsViews[v].disabled = true;
|
tagsViews[v].disabled = true;
|
||||||
});
|
});
|
||||||
|
fixedTagDisabled();
|
||||||
} else if (routeLength - 1 === currentIndex && currentIndex !== 0) {
|
} else if (routeLength - 1 === currentIndex && currentIndex !== 0) {
|
||||||
// 当前路由是所有路由中的最后一个
|
// 当前路由是所有路由中的最后一个
|
||||||
tagsViews[3].show = false;
|
tagsViews[3].show = false;
|
||||||
@@ -415,29 +437,31 @@ function showMenuModel(
|
|||||||
tagsViews[v].disabled = false;
|
tagsViews[v].disabled = false;
|
||||||
});
|
});
|
||||||
tagsViews[3].disabled = true;
|
tagsViews[3].disabled = true;
|
||||||
|
if (allRoute[currentIndex - 1]?.meta?.fixedTag) {
|
||||||
|
tagsViews[2].show = false;
|
||||||
|
tagsViews[2].disabled = true;
|
||||||
|
}
|
||||||
|
fixedTagDisabled();
|
||||||
} else if (currentIndex === 0 || currentPath === `/redirect${topPath}`) {
|
} else if (currentIndex === 0 || currentPath === `/redirect${topPath}`) {
|
||||||
// 当前路由为顶级菜单
|
// 当前路由为顶级菜单
|
||||||
disabledMenus(true);
|
disabledMenus(true);
|
||||||
} else {
|
} else {
|
||||||
disabledMenus(false);
|
disabledMenus(false, allRoute[currentIndex - 1]?.meta?.fixedTag);
|
||||||
|
fixedTagDisabled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openMenu(tag, e) {
|
function openMenu(tag, e) {
|
||||||
closeMenu();
|
closeMenu();
|
||||||
if (tag.path === topPath) {
|
if (tag.path === topPath || tag?.meta?.fixedTag) {
|
||||||
// 右键菜单为顶级菜单,只显示刷新
|
// 右键菜单为顶级菜单或拥有 fixedTag 属性,只显示刷新
|
||||||
showMenus(false);
|
showMenus(false);
|
||||||
tagsViews[0].show = true;
|
tagsViews[0].show = true;
|
||||||
} else if (route.path !== tag.path && route.name !== tag.name) {
|
} else if (route.path !== tag.path && route.name !== tag.name) {
|
||||||
// 右键菜单不匹配当前路由,隐藏刷新
|
// 右键菜单不匹配当前路由,隐藏刷新
|
||||||
tagsViews[0].show = false;
|
tagsViews[0].show = false;
|
||||||
showMenuModel(tag.path, tag.query);
|
showMenuModel(tag.path, tag.query);
|
||||||
} else if (
|
} else if (multiTags.value.length === 2 && route.path !== tag.path) {
|
||||||
// eslint-disable-next-line no-dupe-else-if
|
|
||||||
multiTags.value.length === 2 &&
|
|
||||||
route.path !== tag.path
|
|
||||||
) {
|
|
||||||
showMenus(true);
|
showMenus(true);
|
||||||
// 只有两个标签时不显示关闭其他标签页
|
// 只有两个标签时不显示关闭其他标签页
|
||||||
tagsViews[4].show = false;
|
tagsViews[4].show = false;
|
||||||
@@ -485,7 +509,6 @@ function tagOnClick(item) {
|
|||||||
} else {
|
} else {
|
||||||
router.push({ path });
|
router.push({ path });
|
||||||
}
|
}
|
||||||
// showMenuModel(item?.path, item?.query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onClickOutside(contextmenuRef, closeMenu, {
|
onClickOutside(contextmenuRef, closeMenu, {
|
||||||
@@ -549,7 +572,11 @@ onBeforeUnmount(() => {
|
|||||||
v-for="(item, index) in multiTags"
|
v-for="(item, index) in multiTags"
|
||||||
:ref="'dynamic' + index"
|
:ref="'dynamic' + index"
|
||||||
:key="index"
|
:key="index"
|
||||||
:class="['scroll-item is-closable', linkIsActive(item)]"
|
:class="[
|
||||||
|
'scroll-item is-closable',
|
||||||
|
linkIsActive(item),
|
||||||
|
!isAllEmpty(item?.meta?.fixedTag) && 'fixed-tag'
|
||||||
|
]"
|
||||||
@contextmenu.prevent="openMenu(item, $event)"
|
@contextmenu.prevent="openMenu(item, $event)"
|
||||||
@mouseenter.prevent="onMouseenter(index)"
|
@mouseenter.prevent="onMouseenter(index)"
|
||||||
@mouseleave.prevent="onMouseleave(index)"
|
@mouseleave.prevent="onMouseleave(index)"
|
||||||
@@ -562,8 +589,10 @@ onBeforeUnmount(() => {
|
|||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="
|
v-if="
|
||||||
iconIsActive(item, index) ||
|
isAllEmpty(item?.meta?.fixedTag)
|
||||||
|
? iconIsActive(item, index) ||
|
||||||
(index === activeIndex && index !== 0)
|
(index === activeIndex && index !== 0)
|
||||||
|
: false
|
||||||
"
|
"
|
||||||
class="el-icon-close"
|
class="el-icon-close"
|
||||||
@click.stop="deleteMenu(item)"
|
@click.stop="deleteMenu(item)"
|
||||||
|
|||||||
@@ -2,22 +2,23 @@ import { storeToRefs } from "pinia";
|
|||||||
import { getConfig } from "@/config";
|
import { getConfig } from "@/config";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { emitter } from "@/utils/mitt";
|
import { emitter } from "@/utils/mitt";
|
||||||
import userAvatar from "@/assets/user.jpg";
|
import Avatar from "@/assets/user.jpg";
|
||||||
import { getTopMenu } from "@/router/utils";
|
import { getTopMenu } from "@/router/utils";
|
||||||
import { useFullscreen } from "@vueuse/core";
|
import { useFullscreen } from "@vueuse/core";
|
||||||
import { useGlobal } from "@pureadmin/utils";
|
|
||||||
import type { routeMetaType } from "../types";
|
import type { routeMetaType } from "../types";
|
||||||
import { transformI18n } from "@/plugins/i18n";
|
import { transformI18n } from "@/plugins/i18n";
|
||||||
import { router, remainingPaths } from "@/router";
|
import { router, remainingPaths } from "@/router";
|
||||||
import { computed, type CSSProperties } from "vue";
|
import { computed, type CSSProperties } from "vue";
|
||||||
import { useAppStoreHook } from "@/store/modules/app";
|
import { useAppStoreHook } from "@/store/modules/app";
|
||||||
import { useUserStoreHook } from "@/store/modules/user";
|
import { useUserStoreHook } from "@/store/modules/user";
|
||||||
|
import { useGlobal, isAllEmpty } from "@pureadmin/utils";
|
||||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||||
import { usePermissionStoreHook } from "@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
|
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
|
||||||
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
|
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
|
||||||
|
|
||||||
const errorInfo = "当前路由配置不正确,请检查配置";
|
const errorInfo =
|
||||||
|
"The current routing configuration is incorrect, please check the configuration";
|
||||||
|
|
||||||
export function useNav() {
|
export function useNav() {
|
||||||
const pureApp = useAppStoreHook();
|
const pureApp = useAppStoreHook();
|
||||||
@@ -37,9 +38,18 @@ export function useNav() {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 用户名 */
|
/** 头像(如果头像为空则使用 src/assets/user.jpg ) */
|
||||||
|
const userAvatar = computed(() => {
|
||||||
|
return isAllEmpty(useUserStoreHook()?.avatar)
|
||||||
|
? Avatar
|
||||||
|
: useUserStoreHook()?.avatar;
|
||||||
|
});
|
||||||
|
|
||||||
|
/** 昵称(如果昵称为空则显示用户名) */
|
||||||
const username = computed(() => {
|
const username = computed(() => {
|
||||||
return useUserStoreHook()?.username;
|
return isAllEmpty(useUserStoreHook()?.nickname)
|
||||||
|
? useUserStoreHook()?.username
|
||||||
|
: useUserStoreHook()?.nickname;
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 设置国际化选中后的样式 */
|
/** 设置国际化选中后的样式 */
|
||||||
@@ -99,6 +109,10 @@ export function useNav() {
|
|||||||
emitter.emit("openPanel");
|
emitter.emit("openPanel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toAccountSettings() {
|
||||||
|
router.push({ name: "AccountSettings" });
|
||||||
|
}
|
||||||
|
|
||||||
function toggleSideBar() {
|
function toggleSideBar() {
|
||||||
pureApp.toggleSideBar();
|
pureApp.toggleSideBar();
|
||||||
}
|
}
|
||||||
@@ -159,6 +173,7 @@ export function useNav() {
|
|||||||
userAvatar,
|
userAvatar,
|
||||||
avatarsStyle,
|
avatarsStyle,
|
||||||
tooltipEffect,
|
tooltipEffect,
|
||||||
|
toAccountSettings,
|
||||||
getDropdownItemStyle,
|
getDropdownItemStyle,
|
||||||
getDropdownItemClass
|
getDropdownItemClass
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import "animate.css";
|
|||||||
// 引入 src/components/ReIcon/src/offlineIcon.ts 文件中所有使用addIcon添加过的本地图标
|
// 引入 src/components/ReIcon/src/offlineIcon.ts 文件中所有使用addIcon添加过的本地图标
|
||||||
import "@/components/ReIcon/src/offlineIcon";
|
import "@/components/ReIcon/src/offlineIcon";
|
||||||
import { setType } from "./types";
|
import { setType } from "./types";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
import { useLayout } from "./hooks/useLayout";
|
import { useLayout } from "./hooks/useLayout";
|
||||||
import { useAppStoreHook } from "@/store/modules/app";
|
import { useAppStoreHook } from "@/store/modules/app";
|
||||||
import { useSettingStoreHook } from "@/store/modules/settings";
|
import { useSettingStoreHook } from "@/store/modules/settings";
|
||||||
@@ -31,6 +32,7 @@ import Vertical from "./components/sidebar/vertical.vue";
|
|||||||
import Horizontal from "./components/sidebar/horizontal.vue";
|
import Horizontal from "./components/sidebar/horizontal.vue";
|
||||||
import backTop from "@/assets/svg/back_top.svg?component";
|
import backTop from "@/assets/svg/back_top.svg?component";
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const appWrapperRef = ref();
|
const appWrapperRef = ref();
|
||||||
const { isDark } = useDark();
|
const { isDark } = useDark();
|
||||||
const { layout } = useLayout();
|
const { layout } = useLayout();
|
||||||
@@ -185,7 +187,7 @@ const layoutHeader = defineComponent({
|
|||||||
</div>
|
</div>
|
||||||
<el-scrollbar v-else>
|
<el-scrollbar v-else>
|
||||||
<el-backtop
|
<el-backtop
|
||||||
title="回到顶部"
|
:title="t('buttons.pureBackTop')"
|
||||||
target=".main-container .el-scrollbar__wrap"
|
target=".main-container .el-scrollbar__wrap"
|
||||||
>
|
>
|
||||||
<backTop />
|
<backTop />
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { responsiveStorageNameSpace } from "@/config";
|
|||||||
import { storageLocal, isObject } from "@pureadmin/utils";
|
import { storageLocal, isObject } from "@pureadmin/utils";
|
||||||
|
|
||||||
// element-plus国际化
|
// element-plus国际化
|
||||||
import enLocale from "element-plus/dist/locale/en.mjs";
|
import enLocale from "element-plus/es/locale/lang/en";
|
||||||
import zhLocale from "element-plus/dist/locale/zh-cn.mjs";
|
import zhLocale from "element-plus/es/locale/lang/zh-cn";
|
||||||
|
|
||||||
const siphonI18n = (function () {
|
const siphonI18n = (function () {
|
||||||
// 仅初始化一次国际化配置
|
// 仅初始化一次国际化配置
|
||||||
|
|||||||
@@ -22,8 +22,9 @@ const home = 0, // 平台规定只有 home 路由的 rank 才能为 0 ,所以
|
|||||||
formdesign = 19,
|
formdesign = 19,
|
||||||
board = 20,
|
board = 20,
|
||||||
ppt = 21,
|
ppt = 21,
|
||||||
guide = 22,
|
mind = 22,
|
||||||
menuoverflow = 23;
|
guide = 23,
|
||||||
|
menuoverflow = 24;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
home,
|
home,
|
||||||
@@ -48,6 +49,7 @@ export {
|
|||||||
formdesign,
|
formdesign,
|
||||||
board,
|
board,
|
||||||
ppt,
|
ppt,
|
||||||
|
mind,
|
||||||
guide,
|
guide,
|
||||||
menuoverflow
|
menuoverflow
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export default {
|
|||||||
component: IFrame,
|
component: IFrame,
|
||||||
meta: {
|
meta: {
|
||||||
title: $t("menus.pureBoard"),
|
title: $t("menus.pureBoard"),
|
||||||
|
keepAlive: true,
|
||||||
frameSrc: "https://songlh.top/paint-board/"
|
frameSrc: "https://songlh.top/paint-board/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export default {
|
|||||||
component: IFrame,
|
component: IFrame,
|
||||||
meta: {
|
meta: {
|
||||||
title: $t("menus.pureFormDesign"),
|
title: $t("menus.pureFormDesign"),
|
||||||
|
keepAlive: true,
|
||||||
frameSrc:
|
frameSrc:
|
||||||
"https://haixin-fang.github.io/vue-form-design/playground/index.html",
|
"https://haixin-fang.github.io/vue-form-design/playground/index.html",
|
||||||
frameLoading: false
|
frameLoading: false
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ export default {
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "/list/card",
|
path: "/list/card",
|
||||||
name: "ListCard",
|
name: "CardList",
|
||||||
component: () => import("@/views/list/card/index.vue"),
|
component: () => import("@/views/list/card/index.vue"),
|
||||||
meta: {
|
meta: {
|
||||||
icon: "ri:bank-card-line",
|
icon: "ri:bank-card-line",
|
||||||
title: $t("menus.pureListCard"),
|
title: $t("menus.pureCardList"),
|
||||||
showParent: true
|
showParent: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
25
src/router/modules/mind.ts
Normal file
25
src/router/modules/mind.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { $t } from "@/plugins/i18n";
|
||||||
|
import { mind } from "@/router/enums";
|
||||||
|
const IFrame = () => import("@/layout/frameView.vue");
|
||||||
|
|
||||||
|
export default {
|
||||||
|
path: "/mind-map",
|
||||||
|
redirect: "/mind-map/index",
|
||||||
|
meta: {
|
||||||
|
icon: "ri:mind-map",
|
||||||
|
title: $t("menus.pureMindMap"),
|
||||||
|
rank: mind
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "/mind-map/index",
|
||||||
|
name: "FrameMindMap",
|
||||||
|
component: IFrame,
|
||||||
|
meta: {
|
||||||
|
title: $t("menus.pureMindMap"),
|
||||||
|
keepAlive: true,
|
||||||
|
frameSrc: "https://wanglin2.github.io/mind-map/#/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
} satisfies RouteConfigsTable;
|
||||||
@@ -16,6 +16,7 @@ export default {
|
|||||||
component: IFrame,
|
component: IFrame,
|
||||||
meta: {
|
meta: {
|
||||||
title: "PPT",
|
title: "PPT",
|
||||||
|
keepAlive: true,
|
||||||
frameSrc: "https://pipipi-pikachu.github.io/PPTist/",
|
frameSrc: "https://pipipi-pikachu.github.io/PPTist/",
|
||||||
frameLoading: false
|
frameLoading: false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,5 +38,15 @@ export default [
|
|||||||
showLink: false,
|
showLink: false,
|
||||||
rank: 103
|
rank: 103
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/account-settings",
|
||||||
|
name: "AccountSettings",
|
||||||
|
component: () => import("@/views/account-settings/index.vue"),
|
||||||
|
meta: {
|
||||||
|
title: $t("buttons.pureAccountSettings"),
|
||||||
|
showLink: false,
|
||||||
|
rank: 104
|
||||||
|
}
|
||||||
}
|
}
|
||||||
] satisfies Array<RouteConfigsTable>;
|
] satisfies Array<RouteConfigsTable>;
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ import {
|
|||||||
isIncludeAllChildren
|
isIncludeAllChildren
|
||||||
} from "@pureadmin/utils";
|
} from "@pureadmin/utils";
|
||||||
import { getConfig } from "@/config";
|
import { getConfig } from "@/config";
|
||||||
import type { menuType } from "@/layout/types";
|
|
||||||
import { buildHierarchyTree } from "@/utils/tree";
|
import { buildHierarchyTree } from "@/utils/tree";
|
||||||
import { userKey, type DataInfo } from "@/utils/auth";
|
import { userKey, type DataInfo } from "@/utils/auth";
|
||||||
|
import { type menuType, routerArrays } from "@/layout/types";
|
||||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||||
import { usePermissionStoreHook } from "@/store/modules/permission";
|
import { usePermissionStoreHook } from "@/store/modules/permission";
|
||||||
const IFrame = () => import("@/layout/frameView.vue");
|
const IFrame = () => import("@/layout/frameView.vue");
|
||||||
@@ -81,7 +81,7 @@ function isOneOfArray(a: Array<string>, b: Array<string>) {
|
|||||||
: true;
|
: true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 从localStorage里取出当前登陆用户的角色roles,过滤无权限的菜单 */
|
/** 从localStorage里取出当前登录用户的角色roles,过滤无权限的菜单 */
|
||||||
function filterNoPermissionTree(data: RouteComponent[]) {
|
function filterNoPermissionTree(data: RouteComponent[]) {
|
||||||
const currentRoles =
|
const currentRoles =
|
||||||
storageLocal().getItem<DataInfo<number>>(userKey)?.roles ?? [];
|
storageLocal().getItem<DataInfo<number>>(userKey)?.roles ?? [];
|
||||||
@@ -178,6 +178,14 @@ function handleAsyncRoutes(routeList) {
|
|||||||
);
|
);
|
||||||
usePermissionStoreHook().handleWholeMenus(routeList);
|
usePermissionStoreHook().handleWholeMenus(routeList);
|
||||||
}
|
}
|
||||||
|
if (!useMultiTagsStoreHook().getMultiTagsCache) {
|
||||||
|
useMultiTagsStoreHook().handleTags("equal", [
|
||||||
|
...routerArrays,
|
||||||
|
...usePermissionStoreHook().flatteningRoutes.filter(
|
||||||
|
v => v?.meta?.fixedTag
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
}
|
||||||
addPathMatch();
|
addPathMatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,9 +367,23 @@ function hasAuth(value: string | Array<string>): boolean {
|
|||||||
return isAuths ? true : false;
|
return isAuths ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleTopMenu(route) {
|
||||||
|
if (route?.children && route.children.length > 1) {
|
||||||
|
if (route.redirect) {
|
||||||
|
return route.children.filter(cur => cur.path === route.redirect)[0];
|
||||||
|
} else {
|
||||||
|
return route.children[0];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return route;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 获取所有菜单中的第一个菜单(顶级菜单)*/
|
/** 获取所有菜单中的第一个菜单(顶级菜单)*/
|
||||||
function getTopMenu(tag = false): menuType {
|
function getTopMenu(tag = false): menuType {
|
||||||
const topMenu = usePermissionStoreHook().wholeMenus[0]?.children[0];
|
const topMenu = handleTopMenu(
|
||||||
|
usePermissionStoreHook().wholeMenus[0]?.children[0]
|
||||||
|
);
|
||||||
tag && useMultiTagsStoreHook().handleTags("push", topMenu);
|
tag && useMultiTagsStoreHook().handleTags("push", topMenu);
|
||||||
return topMenu;
|
return topMenu;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import { store } from "@/store";
|
import {
|
||||||
import { defineStore } from "pinia";
|
type appType,
|
||||||
import type { appType } from "./types";
|
store,
|
||||||
import { getConfig, responsiveStorageNameSpace } from "@/config";
|
getConfig,
|
||||||
import { deviceDetection, storageLocal } from "@pureadmin/utils";
|
defineStore,
|
||||||
|
storageLocal,
|
||||||
|
deviceDetection,
|
||||||
|
responsiveStorageNameSpace
|
||||||
|
} from "../utils";
|
||||||
|
|
||||||
export const useAppStore = defineStore({
|
export const useAppStore = defineStore({
|
||||||
id: "pure-app",
|
id: "pure-app",
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import { store } from "@/store";
|
import {
|
||||||
import { defineStore } from "pinia";
|
store,
|
||||||
import { storageLocal } from "@pureadmin/utils";
|
getConfig,
|
||||||
import { getConfig, responsiveStorageNameSpace } from "@/config";
|
defineStore,
|
||||||
|
storageLocal,
|
||||||
|
responsiveStorageNameSpace
|
||||||
|
} from "../utils";
|
||||||
|
|
||||||
export const useEpThemeStore = defineStore({
|
export const useEpThemeStore = defineStore({
|
||||||
id: "pure-epTheme",
|
id: "pure-epTheme",
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
import { defineStore } from "pinia";
|
import {
|
||||||
import { store } from "@/store";
|
type multiType,
|
||||||
import { routerArrays } from "@/layout/types";
|
type positionType,
|
||||||
import { responsiveStorageNameSpace } from "@/config";
|
store,
|
||||||
import type { multiType, positionType } from "./types";
|
isUrl,
|
||||||
import { isEqual, isBoolean, isUrl, storageLocal } from "@pureadmin/utils";
|
isEqual,
|
||||||
|
isNumber,
|
||||||
|
isBoolean,
|
||||||
|
getConfig,
|
||||||
|
defineStore,
|
||||||
|
routerArrays,
|
||||||
|
storageLocal,
|
||||||
|
responsiveStorageNameSpace
|
||||||
|
} from "../utils";
|
||||||
|
import { usePermissionStoreHook } from "./permission";
|
||||||
|
|
||||||
export const useMultiTagsStore = defineStore({
|
export const useMultiTagsStore = defineStore({
|
||||||
id: "pure-multiTags",
|
id: "pure-multiTags",
|
||||||
@@ -15,7 +24,12 @@ export const useMultiTagsStore = defineStore({
|
|||||||
? storageLocal().getItem<StorageConfigs>(
|
? storageLocal().getItem<StorageConfigs>(
|
||||||
`${responsiveStorageNameSpace()}tags`
|
`${responsiveStorageNameSpace()}tags`
|
||||||
)
|
)
|
||||||
: [...routerArrays],
|
: [
|
||||||
|
...routerArrays,
|
||||||
|
...usePermissionStoreHook().flatteningRoutes.filter(
|
||||||
|
v => v?.meta?.fixedTag
|
||||||
|
)
|
||||||
|
],
|
||||||
multiTagsCache: storageLocal().getItem<StorageConfigs>(
|
multiTagsCache: storageLocal().getItem<StorageConfigs>(
|
||||||
`${responsiveStorageNameSpace()}configure`
|
`${responsiveStorageNameSpace()}configure`
|
||||||
)?.multiTagsCache
|
)?.multiTagsCache
|
||||||
@@ -100,6 +114,14 @@ export const useMultiTagsStore = defineStore({
|
|||||||
}
|
}
|
||||||
this.multiTags.push(value);
|
this.multiTags.push(value);
|
||||||
this.tagsCache(this.multiTags);
|
this.tagsCache(this.multiTags);
|
||||||
|
if (
|
||||||
|
getConfig()?.MaxTagsLevel &&
|
||||||
|
isNumber(getConfig().MaxTagsLevel)
|
||||||
|
) {
|
||||||
|
if (this.multiTags.length > getConfig().MaxTagsLevel) {
|
||||||
|
this.multiTags.splice(1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "splice":
|
case "splice":
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
import { defineStore } from "pinia";
|
import {
|
||||||
import { store } from "@/store";
|
type cacheType,
|
||||||
import type { cacheType } from "./types";
|
store,
|
||||||
import { constantMenus } from "@/router";
|
debounce,
|
||||||
|
ascending,
|
||||||
|
getKeyList,
|
||||||
|
filterTree,
|
||||||
|
defineStore,
|
||||||
|
constantMenus,
|
||||||
|
filterNoPermissionTree,
|
||||||
|
formatFlatteningRoutes
|
||||||
|
} from "../utils";
|
||||||
import { useMultiTagsStoreHook } from "./multiTags";
|
import { useMultiTagsStoreHook } from "./multiTags";
|
||||||
import { debounce, getKeyList } from "@pureadmin/utils";
|
|
||||||
import { ascending, filterTree, filterNoPermissionTree } from "@/router/utils";
|
|
||||||
|
|
||||||
export const usePermissionStore = defineStore({
|
export const usePermissionStore = defineStore({
|
||||||
id: "pure-permission",
|
id: "pure-permission",
|
||||||
@@ -13,6 +19,8 @@ export const usePermissionStore = defineStore({
|
|||||||
constantMenus,
|
constantMenus,
|
||||||
// 整体路由生成的菜单(静态、动态)
|
// 整体路由生成的菜单(静态、动态)
|
||||||
wholeMenus: [],
|
wholeMenus: [],
|
||||||
|
// 整体路由(一维数组格式)
|
||||||
|
flatteningRoutes: [],
|
||||||
// 缓存页面keepAlive
|
// 缓存页面keepAlive
|
||||||
cachePageList: []
|
cachePageList: []
|
||||||
}),
|
}),
|
||||||
@@ -22,6 +30,9 @@ export const usePermissionStore = defineStore({
|
|||||||
this.wholeMenus = filterNoPermissionTree(
|
this.wholeMenus = filterNoPermissionTree(
|
||||||
filterTree(ascending(this.constantMenus.concat(routes)))
|
filterTree(ascending(this.constantMenus.concat(routes)))
|
||||||
);
|
);
|
||||||
|
this.flatteningRoutes = formatFlatteningRoutes(
|
||||||
|
this.constantMenus.concat(routes)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
cacheOperate({ mode, name }: cacheType) {
|
cacheOperate({ mode, name }: cacheType) {
|
||||||
const delIndex = this.cachePageList.findIndex(v => v === name);
|
const delIndex = this.cachePageList.findIndex(v => v === name);
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
import { defineStore } from "pinia";
|
import { type setType, store, defineStore, getConfig } from "../utils";
|
||||||
import { store } from "@/store";
|
|
||||||
import { getConfig } from "@/config";
|
|
||||||
import type { setType } from "./types";
|
|
||||||
|
|
||||||
export const useSettingStore = defineStore({
|
export const useSettingStore = defineStore({
|
||||||
id: "pure-setting",
|
id: "pure-setting",
|
||||||
|
|||||||
@@ -1,19 +1,30 @@
|
|||||||
import { defineStore } from "pinia";
|
import {
|
||||||
import { store } from "@/store";
|
type userType,
|
||||||
import type { userType } from "./types";
|
store,
|
||||||
import { routerArrays } from "@/layout/types";
|
router,
|
||||||
import { router, resetRouter } from "@/router";
|
defineStore,
|
||||||
import { storageLocal } from "@pureadmin/utils";
|
resetRouter,
|
||||||
import { getLogin, refreshTokenApi } from "@/api/user";
|
routerArrays,
|
||||||
import type { UserResult, RefreshTokenResult } from "@/api/user";
|
storageLocal
|
||||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
} from "../utils";
|
||||||
|
import {
|
||||||
|
type UserResult,
|
||||||
|
type RefreshTokenResult,
|
||||||
|
getLogin,
|
||||||
|
refreshTokenApi
|
||||||
|
} from "@/api/user";
|
||||||
|
import { useMultiTagsStoreHook } from "./multiTags";
|
||||||
import { type DataInfo, setToken, removeToken, userKey } from "@/utils/auth";
|
import { type DataInfo, setToken, removeToken, userKey } from "@/utils/auth";
|
||||||
|
|
||||||
export const useUserStore = defineStore({
|
export const useUserStore = defineStore({
|
||||||
id: "pure-user",
|
id: "pure-user",
|
||||||
state: (): userType => ({
|
state: (): userType => ({
|
||||||
|
// 头像
|
||||||
|
avatar: storageLocal().getItem<DataInfo<number>>(userKey)?.avatar ?? "",
|
||||||
// 用户名
|
// 用户名
|
||||||
username: storageLocal().getItem<DataInfo<number>>(userKey)?.username ?? "",
|
username: storageLocal().getItem<DataInfo<number>>(userKey)?.username ?? "",
|
||||||
|
// 昵称
|
||||||
|
nickname: storageLocal().getItem<DataInfo<number>>(userKey)?.nickname ?? "",
|
||||||
// 页面级别权限
|
// 页面级别权限
|
||||||
roles: storageLocal().getItem<DataInfo<number>>(userKey)?.roles ?? [],
|
roles: storageLocal().getItem<DataInfo<number>>(userKey)?.roles ?? [],
|
||||||
// 前端生成的验证码(按实际需求替换)
|
// 前端生成的验证码(按实际需求替换)
|
||||||
@@ -26,10 +37,18 @@ export const useUserStore = defineStore({
|
|||||||
loginDay: 7
|
loginDay: 7
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
|
/** 存储头像 */
|
||||||
|
SET_AVATAR(avatar: string) {
|
||||||
|
this.avatar = avatar;
|
||||||
|
},
|
||||||
/** 存储用户名 */
|
/** 存储用户名 */
|
||||||
SET_USERNAME(username: string) {
|
SET_USERNAME(username: string) {
|
||||||
this.username = username;
|
this.username = username;
|
||||||
},
|
},
|
||||||
|
/** 存储昵称 */
|
||||||
|
SET_NICKNAME(nickname: string) {
|
||||||
|
this.nickname = nickname;
|
||||||
|
},
|
||||||
/** 存储角色 */
|
/** 存储角色 */
|
||||||
SET_ROLES(roles: Array<string>) {
|
SET_ROLES(roles: Array<string>) {
|
||||||
this.roles = roles;
|
this.roles = roles;
|
||||||
@@ -55,10 +74,8 @@ export const useUserStore = defineStore({
|
|||||||
return new Promise<UserResult>((resolve, reject) => {
|
return new Promise<UserResult>((resolve, reject) => {
|
||||||
getLogin(data)
|
getLogin(data)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data) {
|
if (data?.success) setToken(data.data);
|
||||||
setToken(data.data);
|
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ export type setType = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type userType = {
|
export type userType = {
|
||||||
|
avatar?: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
|
nickname?: string;
|
||||||
roles?: Array<string>;
|
roles?: Array<string>;
|
||||||
verifyCode?: string;
|
verifyCode?: string;
|
||||||
currentPage?: number;
|
currentPage?: number;
|
||||||
29
src/store/utils.ts
Normal file
29
src/store/utils.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
export { store } from "@/store";
|
||||||
|
export { defineStore } from "pinia";
|
||||||
|
export { routerArrays } from "@/layout/types";
|
||||||
|
export { router, resetRouter, constantMenus } from "@/router";
|
||||||
|
export { getConfig, responsiveStorageNameSpace } from "@/config";
|
||||||
|
export {
|
||||||
|
ascending,
|
||||||
|
filterTree,
|
||||||
|
filterNoPermissionTree,
|
||||||
|
formatFlatteningRoutes
|
||||||
|
} from "@/router/utils";
|
||||||
|
export {
|
||||||
|
isUrl,
|
||||||
|
isEqual,
|
||||||
|
isNumber,
|
||||||
|
debounce,
|
||||||
|
isBoolean,
|
||||||
|
getKeyList,
|
||||||
|
storageLocal,
|
||||||
|
deviceDetection
|
||||||
|
} from "@pureadmin/utils";
|
||||||
|
export type {
|
||||||
|
setType,
|
||||||
|
appType,
|
||||||
|
userType,
|
||||||
|
multiType,
|
||||||
|
cacheType,
|
||||||
|
positionType
|
||||||
|
} from "./types";
|
||||||
@@ -117,7 +117,7 @@ html.dark {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 项目配置面板 */
|
/* 系统配置面板 */
|
||||||
.right-panel-items {
|
.right-panel-items {
|
||||||
.el-divider__text {
|
.el-divider__text {
|
||||||
--el-bg-color: var(--el-bg-color);
|
--el-bg-color: var(--el-bg-color);
|
||||||
|
|||||||
@@ -263,8 +263,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
& > .el-menu {
|
& > .el-menu {
|
||||||
i {
|
i,
|
||||||
margin-right: 20px;
|
svg {
|
||||||
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,13 @@ export interface DataInfo<T> {
|
|||||||
expires: T;
|
expires: T;
|
||||||
/** 用于调用刷新accessToken的接口时所需的token */
|
/** 用于调用刷新accessToken的接口时所需的token */
|
||||||
refreshToken: string;
|
refreshToken: string;
|
||||||
|
/** 头像 */
|
||||||
|
avatar?: string;
|
||||||
/** 用户名 */
|
/** 用户名 */
|
||||||
username?: string;
|
username?: string;
|
||||||
/** 当前登陆用户的角色 */
|
/** 昵称 */
|
||||||
|
nickname?: string;
|
||||||
|
/** 当前登录用户的角色 */
|
||||||
roles?: Array<string>;
|
roles?: Array<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,15 +40,15 @@ export function getToken(): DataInfo<number> {
|
|||||||
/**
|
/**
|
||||||
* @description 设置`token`以及一些必要信息并采用无感刷新`token`方案
|
* @description 设置`token`以及一些必要信息并采用无感刷新`token`方案
|
||||||
* 无感刷新:后端返回`accessToken`(访问接口使用的`token`)、`refreshToken`(用于调用刷新`accessToken`的接口时所需的`token`,`refreshToken`的过期时间(比如30天)应大于`accessToken`的过期时间(比如2小时))、`expires`(`accessToken`的过期时间)
|
* 无感刷新:后端返回`accessToken`(访问接口使用的`token`)、`refreshToken`(用于调用刷新`accessToken`的接口时所需的`token`,`refreshToken`的过期时间(比如30天)应大于`accessToken`的过期时间(比如2小时))、`expires`(`accessToken`的过期时间)
|
||||||
* 将`accessToken`、`expires`这两条信息放在key值为authorized-token的cookie里(过期自动销毁)
|
* 将`accessToken`、`expires`、`refreshToken`这三条信息放在key值为authorized-token的cookie里(过期自动销毁)
|
||||||
* 将`username`、`roles`、`refreshToken`、`expires`这四条信息放在key值为`user-info`的localStorage里(利用`multipleTabsKey`当浏览器完全关闭后自动销毁)
|
* 将`avatar`、`username`、`nickname`、`roles`、`refreshToken`、`expires`这六条信息放在key值为`user-info`的localStorage里(利用`multipleTabsKey`当浏览器完全关闭后自动销毁)
|
||||||
*/
|
*/
|
||||||
export function setToken(data: DataInfo<Date>) {
|
export function setToken(data: DataInfo<Date>) {
|
||||||
let expires = 0;
|
let expires = 0;
|
||||||
const { accessToken, refreshToken } = data;
|
const { accessToken, refreshToken } = data;
|
||||||
const { isRemembered, loginDay } = useUserStoreHook();
|
const { isRemembered, loginDay } = useUserStoreHook();
|
||||||
expires = new Date(data.expires).getTime(); // 如果后端直接设置时间戳,将此处代码改为expires = data.expires,然后把上面的DataInfo<Date>改成DataInfo<number>即可
|
expires = new Date(data.expires).getTime(); // 如果后端直接设置时间戳,将此处代码改为expires = data.expires,然后把上面的DataInfo<Date>改成DataInfo<number>即可
|
||||||
const cookieString = JSON.stringify({ accessToken, expires });
|
const cookieString = JSON.stringify({ accessToken, expires, refreshToken });
|
||||||
|
|
||||||
expires > 0
|
expires > 0
|
||||||
? Cookies.set(TokenKey, cookieString, {
|
? Cookies.set(TokenKey, cookieString, {
|
||||||
@@ -62,26 +66,44 @@ export function setToken(data: DataInfo<Date>) {
|
|||||||
: {}
|
: {}
|
||||||
);
|
);
|
||||||
|
|
||||||
function setUserKey(username: string, roles: Array<string>) {
|
function setUserKey({ avatar, username, nickname, roles }) {
|
||||||
|
useUserStoreHook().SET_AVATAR(avatar);
|
||||||
useUserStoreHook().SET_USERNAME(username);
|
useUserStoreHook().SET_USERNAME(username);
|
||||||
|
useUserStoreHook().SET_NICKNAME(nickname);
|
||||||
useUserStoreHook().SET_ROLES(roles);
|
useUserStoreHook().SET_ROLES(roles);
|
||||||
storageLocal().setItem(userKey, {
|
storageLocal().setItem(userKey, {
|
||||||
refreshToken,
|
refreshToken,
|
||||||
expires,
|
expires,
|
||||||
|
avatar,
|
||||||
username,
|
username,
|
||||||
|
nickname,
|
||||||
roles
|
roles
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.username && data.roles) {
|
if (data.username && data.roles) {
|
||||||
const { username, roles } = data;
|
const { username, roles } = data;
|
||||||
setUserKey(username, roles);
|
setUserKey({
|
||||||
|
avatar: data?.avatar ?? "",
|
||||||
|
username,
|
||||||
|
nickname: data?.nickname ?? "",
|
||||||
|
roles
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
const avatar =
|
||||||
|
storageLocal().getItem<DataInfo<number>>(userKey)?.avatar ?? "";
|
||||||
const username =
|
const username =
|
||||||
storageLocal().getItem<DataInfo<number>>(userKey)?.username ?? "";
|
storageLocal().getItem<DataInfo<number>>(userKey)?.username ?? "";
|
||||||
|
const nickname =
|
||||||
|
storageLocal().getItem<DataInfo<number>>(userKey)?.nickname ?? "";
|
||||||
const roles =
|
const roles =
|
||||||
storageLocal().getItem<DataInfo<number>>(userKey)?.roles ?? [];
|
storageLocal().getItem<DataInfo<number>>(userKey)?.roles ?? [];
|
||||||
setUserKey(username, roles);
|
setUserKey({
|
||||||
|
avatar,
|
||||||
|
username,
|
||||||
|
nickname,
|
||||||
|
roles
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,16 +35,16 @@ class PureHttp {
|
|||||||
this.httpInterceptorsResponse();
|
this.httpInterceptorsResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** token过期后,暂存待执行的请求 */
|
/** `token`过期后,暂存待执行的请求 */
|
||||||
private static requests = [];
|
private static requests = [];
|
||||||
|
|
||||||
/** 防止重复刷新token */
|
/** 防止重复刷新`token` */
|
||||||
private static isRefreshing = false;
|
private static isRefreshing = false;
|
||||||
|
|
||||||
/** 初始化配置对象 */
|
/** 初始化配置对象 */
|
||||||
private static initConfig: PureHttpRequestConfig = {};
|
private static initConfig: PureHttpRequestConfig = {};
|
||||||
|
|
||||||
/** 保存当前Axios实例对象 */
|
/** 保存当前`Axios`实例对象 */
|
||||||
private static axiosInstance: AxiosInstance = Axios.create(defaultConfig);
|
private static axiosInstance: AxiosInstance = Axios.create(defaultConfig);
|
||||||
|
|
||||||
/** 重连原始请求 */
|
/** 重连原始请求 */
|
||||||
@@ -72,9 +72,9 @@ class PureHttp {
|
|||||||
PureHttp.initConfig.beforeRequestCallback(config);
|
PureHttp.initConfig.beforeRequestCallback(config);
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
/** 请求白名单,放置一些不需要token的接口(通过设置请求白名单,防止token过期后再请求造成的死循环问题) */
|
/** 请求白名单,放置一些不需要`token`的接口(通过设置请求白名单,防止`token`过期后再请求造成的死循环问题) */
|
||||||
const whiteList = ["/refresh-token", "/login"];
|
const whiteList = ["/refresh-token", "/login"];
|
||||||
return whiteList.find(url => url === config.url)
|
return whiteList.some(url => config.url.endsWith(url))
|
||||||
? config
|
? config
|
||||||
: new Promise(resolve => {
|
: new Promise(resolve => {
|
||||||
const data = getToken();
|
const data = getToken();
|
||||||
@@ -172,22 +172,22 @@ class PureHttp {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 单独抽离的post工具函数 */
|
/** 单独抽离的`post`工具函数 */
|
||||||
public post<T, P>(
|
public post<T, P>(
|
||||||
url: string,
|
url: string,
|
||||||
params?: AxiosRequestConfig<T>,
|
params?: AxiosRequestConfig<P>,
|
||||||
config?: PureHttpRequestConfig
|
config?: PureHttpRequestConfig
|
||||||
): Promise<P> {
|
): Promise<T> {
|
||||||
return this.request<P>("post", url, params, config);
|
return this.request<T>("post", url, params, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 单独抽离的get工具函数 */
|
/** 单独抽离的`get`工具函数 */
|
||||||
public get<T, P>(
|
public get<T, P>(
|
||||||
url: string,
|
url: string,
|
||||||
params?: AxiosRequestConfig<T>,
|
params?: AxiosRequestConfig<P>,
|
||||||
config?: PureHttpRequestConfig
|
config?: PureHttpRequestConfig
|
||||||
): Promise<P> {
|
): Promise<T> {
|
||||||
return this.request<P>("get", url, params, config);
|
return this.request<T>("get", url, params, config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ const Print = function (dom, options?: object): PrintFunction {
|
|||||||
printDoneCallBack: null
|
printDoneCallBack: null
|
||||||
};
|
};
|
||||||
for (const key in this.conf) {
|
for (const key in this.conf) {
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
|
||||||
if (key && options.hasOwnProperty(key)) {
|
if (key && options.hasOwnProperty(key)) {
|
||||||
this.conf[key] = options[key];
|
this.conf[key] = options[key];
|
||||||
}
|
}
|
||||||
@@ -132,9 +131,9 @@ Print.prototype = {
|
|||||||
"style",
|
"style",
|
||||||
"position:absolute;width:0;height:0;top:-10px;left:-10px;"
|
"position:absolute;width:0;height:0;top:-10px;left:-10px;"
|
||||||
);
|
);
|
||||||
// eslint-disable-next-line prefer-const
|
|
||||||
w = f.contentWindow || f.contentDocument;
|
w = f.contentWindow || f.contentDocument;
|
||||||
// eslint-disable-next-line prefer-const
|
|
||||||
doc = f.contentDocument || f.contentWindow.document;
|
doc = f.contentDocument || f.contentWindow.document;
|
||||||
doc.open();
|
doc.open();
|
||||||
doc.write(content);
|
doc.write(content);
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ export const injectResponsiveStorage = (app: App, config: PlatformConfigs) => {
|
|||||||
darkMode: config.DarkMode ?? false,
|
darkMode: config.DarkMode ?? false,
|
||||||
sidebarStatus: config.SidebarStatus ?? true,
|
sidebarStatus: config.SidebarStatus ?? true,
|
||||||
epThemeColor: config.EpThemeColor ?? "#409EFF",
|
epThemeColor: config.EpThemeColor ?? "#409EFF",
|
||||||
themeColor: config.Theme ?? "light", // 主题色(对应项目配置中的主题色,与theme不同的是它不会受到浅色、深色整体风格切换的影响,只会在手动点击主题色时改变)
|
themeColor: config.Theme ?? "light", // 主题色(对应系统配置中的主题色,与theme不同的是它不会受到浅色、深色整体风格切换的影响,只会在手动点击主题色时改变)
|
||||||
overallStyle: config.OverallStyle ?? "light" // 整体风格(浅色:light、深色:dark、自动:system)
|
overallStyle: config.OverallStyle ?? "light" // 整体风格(浅色:light、深色:dark、自动:system)
|
||||||
},
|
},
|
||||||
// 项目配置-界面显示
|
// 系统配置-界面显示
|
||||||
configure: Storage.getData("configure", nameSpace) ?? {
|
configure: Storage.getData("configure", nameSpace) ?? {
|
||||||
grey: config.Grey ?? false,
|
grey: config.Grey ?? false,
|
||||||
weak: config.Weak ?? false,
|
weak: config.Weak ?? false,
|
||||||
|
|||||||
66
src/views/account-settings/components/AccountManagement.vue
Normal file
66
src/views/account-settings/components/AccountManagement.vue
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { message } from "@/utils/message";
|
||||||
|
import { deviceDetection } from "@pureadmin/utils";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "AccountManagement"
|
||||||
|
});
|
||||||
|
|
||||||
|
const list = ref([
|
||||||
|
{
|
||||||
|
title: "账户密码",
|
||||||
|
illustrate: "当前密码强度:强",
|
||||||
|
button: "修改"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "密保手机",
|
||||||
|
illustrate: "已经绑定手机:158****6789",
|
||||||
|
button: "修改"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "密保问题",
|
||||||
|
illustrate: "未设置密保问题,密保问题可有效保护账户安全",
|
||||||
|
button: "修改"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "备用邮箱",
|
||||||
|
illustrate: "已绑定邮箱:pure***@163.com",
|
||||||
|
button: "修改"
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
function onClick(item) {
|
||||||
|
console.log("onClick", item.title);
|
||||||
|
message("请根据具体业务自行实现", { type: "success" });
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
:class="[
|
||||||
|
'min-w-[180px]',
|
||||||
|
deviceDetection() ? 'max-w-[100%]' : 'max-w-[70%]'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<h3 class="my-8">账户管理</h3>
|
||||||
|
<div v-for="(item, index) in list" :key="index">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="flex-1">
|
||||||
|
<p>{{ item.title }}</p>
|
||||||
|
<el-text class="mx-1" type="info">{{ item.illustrate }}</el-text>
|
||||||
|
</div>
|
||||||
|
<el-button type="primary" text @click="onClick(item)">
|
||||||
|
{{ item.button }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<el-divider />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.el-divider--horizontal {
|
||||||
|
border-top: 0.1px var(--el-border-color) var(--el-border-style);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
69
src/views/account-settings/components/Preferences.vue
Normal file
69
src/views/account-settings/components/Preferences.vue
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { message } from "@/utils/message";
|
||||||
|
import { deviceDetection } from "@pureadmin/utils";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "Preferences"
|
||||||
|
});
|
||||||
|
|
||||||
|
const list = ref([
|
||||||
|
{
|
||||||
|
title: "账户密码",
|
||||||
|
illustrate: "其他用户的消息将以站内信的形式通知",
|
||||||
|
checked: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "系统消息",
|
||||||
|
illustrate: "系统消息将以站内信的形式通知",
|
||||||
|
checked: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "待办任务",
|
||||||
|
illustrate: "待办任务将以站内信的形式通知",
|
||||||
|
checked: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
function onChange(val, item) {
|
||||||
|
console.log("onChange", val);
|
||||||
|
message(`${item.title}设置成功`, { type: "success" });
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
:class="[
|
||||||
|
'min-w-[180px]',
|
||||||
|
deviceDetection() ? 'max-w-[100%]' : 'max-w-[70%]'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<h3 class="my-8">偏好设置</h3>
|
||||||
|
<div v-for="(item, index) in list" :key="index">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="flex-1">
|
||||||
|
<p>{{ item.title }}</p>
|
||||||
|
<p class="wp-4">
|
||||||
|
<el-text class="mx-1" type="info">
|
||||||
|
{{ item.illustrate }}
|
||||||
|
</el-text>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<el-switch
|
||||||
|
v-model="item.checked"
|
||||||
|
inline-prompt
|
||||||
|
active-text="是"
|
||||||
|
inactive-text="否"
|
||||||
|
@change="val => onChange(val, item)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<el-divider />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.el-divider--horizontal {
|
||||||
|
border-top: 0.1px var(--el-border-color) var(--el-border-style);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
191
src/views/account-settings/components/Profile.vue
Normal file
191
src/views/account-settings/components/Profile.vue
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
|
import { formUpload } from "@/api/mock";
|
||||||
|
import { message } from "@/utils/message";
|
||||||
|
import { type UserInfo, getMine } from "@/api/user";
|
||||||
|
import type { FormInstance, FormRules } from "element-plus";
|
||||||
|
import ReCropperPreview from "@/components/ReCropperPreview";
|
||||||
|
import { createFormData, deviceDetection } from "@pureadmin/utils";
|
||||||
|
import uploadLine from "@iconify-icons/ri/upload-line";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "Profile"
|
||||||
|
});
|
||||||
|
|
||||||
|
const imgSrc = ref("");
|
||||||
|
const cropperInfo = ref();
|
||||||
|
const cropRef = ref();
|
||||||
|
const uploadRef = ref();
|
||||||
|
const isShow = ref(false);
|
||||||
|
const userInfoFormRef = ref<FormInstance>();
|
||||||
|
|
||||||
|
const userInfos = reactive({
|
||||||
|
avatar: "",
|
||||||
|
nickname: "",
|
||||||
|
email: "",
|
||||||
|
phone: "",
|
||||||
|
description: ""
|
||||||
|
});
|
||||||
|
|
||||||
|
const rules = reactive<FormRules<UserInfo>>({
|
||||||
|
nickname: [{ required: true, message: "昵称必填", trigger: "blur" }]
|
||||||
|
});
|
||||||
|
|
||||||
|
function queryEmail(queryString, callback) {
|
||||||
|
const emailList = [
|
||||||
|
{ value: "@qq.com" },
|
||||||
|
{ value: "@126.com" },
|
||||||
|
{ value: "@163.com" }
|
||||||
|
];
|
||||||
|
let results = [];
|
||||||
|
let queryList = [];
|
||||||
|
emailList.map(item =>
|
||||||
|
queryList.push({ value: queryString.split("@")[0] + item.value })
|
||||||
|
);
|
||||||
|
results = queryString
|
||||||
|
? queryList.filter(
|
||||||
|
item =>
|
||||||
|
item.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
||||||
|
)
|
||||||
|
: queryList;
|
||||||
|
callback(results);
|
||||||
|
}
|
||||||
|
|
||||||
|
const onChange = uploadFile => {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onload = e => {
|
||||||
|
imgSrc.value = e.target.result as string;
|
||||||
|
isShow.value = true;
|
||||||
|
};
|
||||||
|
reader.readAsDataURL(uploadFile.raw);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
cropRef.value.hidePopover();
|
||||||
|
uploadRef.value.clearFiles();
|
||||||
|
isShow.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onCropper = info => (cropperInfo.value = info);
|
||||||
|
|
||||||
|
const handleSubmitImage = () => {
|
||||||
|
const formData = createFormData({
|
||||||
|
files: new File([cropperInfo.value], "avatar")
|
||||||
|
});
|
||||||
|
formUpload(formData)
|
||||||
|
.then(({ success, data }) => {
|
||||||
|
if (success) {
|
||||||
|
message("更新头像成功", { type: "success" });
|
||||||
|
handleClose();
|
||||||
|
} else {
|
||||||
|
message("更新头像失败");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
message(`提交异常 ${error}`, { type: "error" });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 更新信息
|
||||||
|
const onSubmit = async (formEl: FormInstance) => {
|
||||||
|
await formEl.validate((valid, fields) => {
|
||||||
|
if (valid) {
|
||||||
|
console.log(userInfos);
|
||||||
|
message("更新信息成功", { type: "success" });
|
||||||
|
} else {
|
||||||
|
console.log("error submit!", fields);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
getMine().then(res => {
|
||||||
|
Object.assign(userInfos, res.data);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
:class="[
|
||||||
|
'min-w-[180px]',
|
||||||
|
deviceDetection() ? 'max-w-[100%]' : 'max-w-[70%]'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<h3 class="my-8">个人信息</h3>
|
||||||
|
<el-form
|
||||||
|
ref="userInfoFormRef"
|
||||||
|
label-position="top"
|
||||||
|
:rules="rules"
|
||||||
|
:model="userInfos"
|
||||||
|
>
|
||||||
|
<el-form-item label="头像">
|
||||||
|
<el-avatar :size="80" :src="userInfos.avatar" />
|
||||||
|
<el-upload
|
||||||
|
ref="uploadRef"
|
||||||
|
accept="image/*"
|
||||||
|
action="#"
|
||||||
|
:limit="1"
|
||||||
|
:auto-upload="false"
|
||||||
|
:show-file-list="false"
|
||||||
|
:on-change="onChange"
|
||||||
|
>
|
||||||
|
<el-button plain class="ml-4">
|
||||||
|
<IconifyIconOffline :icon="uploadLine" />
|
||||||
|
<span class="ml-2">更新头像</span>
|
||||||
|
</el-button>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="昵称" prop="nickname">
|
||||||
|
<el-input v-model="userInfos.nickname" placeholder="请输入昵称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="邮箱" prop="email">
|
||||||
|
<el-autocomplete
|
||||||
|
v-model="userInfos.email"
|
||||||
|
:fetch-suggestions="queryEmail"
|
||||||
|
:trigger-on-focus="false"
|
||||||
|
placeholder="请输入邮箱"
|
||||||
|
clearable
|
||||||
|
class="w-full"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话">
|
||||||
|
<el-input
|
||||||
|
v-model="userInfos.phone"
|
||||||
|
placeholder="请输入联系电话"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="简介">
|
||||||
|
<el-input
|
||||||
|
v-model="userInfos.description"
|
||||||
|
placeholder="请输入简介"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 6, maxRows: 8 }"
|
||||||
|
maxlength="56"
|
||||||
|
show-word-limit
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button type="primary" @click="onSubmit(userInfoFormRef)">
|
||||||
|
更新信息
|
||||||
|
</el-button>
|
||||||
|
</el-form>
|
||||||
|
<el-dialog
|
||||||
|
v-model="isShow"
|
||||||
|
width="40%"
|
||||||
|
title="编辑头像"
|
||||||
|
destroy-on-close
|
||||||
|
:closeOnClickModal="false"
|
||||||
|
:before-close="handleClose"
|
||||||
|
:fullscreen="deviceDetection()"
|
||||||
|
>
|
||||||
|
<ReCropperPreview ref="cropRef" :imgSrc="imgSrc" @cropper="onCropper" />
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button bg text @click="handleClose">取消</el-button>
|
||||||
|
<el-button bg text type="primary" @click="handleSubmitImage">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
91
src/views/account-settings/components/SecurityLog.vue
Normal file
91
src/views/account-settings/components/SecurityLog.vue
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import { getMineLogs } from "@/api/user";
|
||||||
|
import { reactive, ref, onMounted } from "vue";
|
||||||
|
import { deviceDetection } from "@pureadmin/utils";
|
||||||
|
import type { PaginationProps } from "@pureadmin/table";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "SecurityLog"
|
||||||
|
});
|
||||||
|
|
||||||
|
const loading = ref(true);
|
||||||
|
const dataList = ref([]);
|
||||||
|
const pagination = reactive<PaginationProps>({
|
||||||
|
total: 0,
|
||||||
|
pageSize: 10,
|
||||||
|
currentPage: 1,
|
||||||
|
background: true,
|
||||||
|
layout: "prev, pager, next"
|
||||||
|
});
|
||||||
|
const columns: TableColumnList = [
|
||||||
|
{
|
||||||
|
label: "详情",
|
||||||
|
prop: "summary",
|
||||||
|
minWidth: 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "IP 地址",
|
||||||
|
prop: "ip",
|
||||||
|
minWidth: 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "地点",
|
||||||
|
prop: "address",
|
||||||
|
minWidth: 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "操作系统",
|
||||||
|
prop: "system",
|
||||||
|
minWidth: 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "浏览器类型",
|
||||||
|
prop: "browser",
|
||||||
|
minWidth: 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "时间",
|
||||||
|
prop: "operatingTime",
|
||||||
|
minWidth: 180,
|
||||||
|
formatter: ({ operatingTime }) =>
|
||||||
|
dayjs(operatingTime).format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
async function onSearch() {
|
||||||
|
loading.value = true;
|
||||||
|
const { data } = await getMineLogs();
|
||||||
|
dataList.value = data.list;
|
||||||
|
pagination.total = data.total;
|
||||||
|
pagination.pageSize = data.pageSize;
|
||||||
|
pagination.currentPage = data.currentPage;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
loading.value = false;
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
onSearch();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
:class="[
|
||||||
|
'min-w-[180px]',
|
||||||
|
deviceDetection() ? 'max-w-[100%]' : 'max-w-[70%]'
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<h3 class="my-8">安全日志</h3>
|
||||||
|
<pure-table
|
||||||
|
row-key="id"
|
||||||
|
table-layout="auto"
|
||||||
|
:loading="loading"
|
||||||
|
:data="dataList"
|
||||||
|
:columns="columns"
|
||||||
|
:pagination="pagination"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
183
src/views/account-settings/index.vue
Normal file
183
src/views/account-settings/index.vue
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { getMine } from "@/api/user";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
import { ref, onBeforeMount } from "vue";
|
||||||
|
import { ReText } from "@/components/ReText";
|
||||||
|
import Profile from "./components/Profile.vue";
|
||||||
|
import Preferences from "./components/Preferences.vue";
|
||||||
|
import SecurityLog from "./components/SecurityLog.vue";
|
||||||
|
import { useGlobal, deviceDetection } from "@pureadmin/utils";
|
||||||
|
import AccountManagement from "./components/AccountManagement.vue";
|
||||||
|
import TopCollapse from "@/layout/components/sidebar/topCollapse.vue";
|
||||||
|
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
||||||
|
|
||||||
|
import leftLine from "@iconify-icons/ri/arrow-left-s-line";
|
||||||
|
import ProfileIcon from "@iconify-icons/ri/user-3-line";
|
||||||
|
import PreferencesIcon from "@iconify-icons/ri/settings-3-line";
|
||||||
|
import SecurityLogIcon from "@iconify-icons/ri/window-line";
|
||||||
|
import AccountManagementIcon from "@iconify-icons/ri/profile-line";
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "AccountSettings"
|
||||||
|
});
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const isOpen = ref(deviceDetection() ? false : true);
|
||||||
|
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
||||||
|
onBeforeMount(() => {
|
||||||
|
useDataThemeChange().dataThemeChange($storage.layout?.overallStyle);
|
||||||
|
});
|
||||||
|
|
||||||
|
const userInfo = ref({
|
||||||
|
avatar: "",
|
||||||
|
username: "",
|
||||||
|
nickname: ""
|
||||||
|
});
|
||||||
|
const panes = [
|
||||||
|
{
|
||||||
|
key: "profile",
|
||||||
|
label: "个人信息",
|
||||||
|
icon: ProfileIcon,
|
||||||
|
component: Profile
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "preferences",
|
||||||
|
label: "偏好设置",
|
||||||
|
icon: PreferencesIcon,
|
||||||
|
component: Preferences
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "securityLog",
|
||||||
|
label: "安全日志",
|
||||||
|
icon: SecurityLogIcon,
|
||||||
|
component: SecurityLog
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "accountManagement",
|
||||||
|
label: "账户管理",
|
||||||
|
icon: AccountManagementIcon,
|
||||||
|
component: AccountManagement
|
||||||
|
}
|
||||||
|
];
|
||||||
|
const witchPane = ref("profile");
|
||||||
|
|
||||||
|
getMine().then(res => {
|
||||||
|
userInfo.value = res.data;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-container class="h-full">
|
||||||
|
<el-aside
|
||||||
|
v-if="isOpen"
|
||||||
|
class="pure-account-settings overflow-hidden px-2 dark:!bg-[var(--el-bg-color)] border-r-[1px] border-[var(--pure-border-color)]"
|
||||||
|
:width="deviceDetection() ? '180px' : '240px'"
|
||||||
|
>
|
||||||
|
<el-menu :default-active="witchPane" class="pure-account-settings-menu">
|
||||||
|
<el-menu-item
|
||||||
|
class="hover:!transition-all hover:!duration-200 hover:!text-base !h-[50px]"
|
||||||
|
@click="router.go(-1)"
|
||||||
|
>
|
||||||
|
<div class="flex items-center">
|
||||||
|
<IconifyIconOffline :icon="leftLine" />
|
||||||
|
<span class="ml-2">返回</span>
|
||||||
|
</div>
|
||||||
|
</el-menu-item>
|
||||||
|
<div class="flex items-center ml-8 mt-4 mb-4">
|
||||||
|
<el-avatar :size="48" :src="userInfo.avatar" />
|
||||||
|
<div class="ml-4 flex flex-col max-w-[130px]">
|
||||||
|
<ReText class="font-bold !self-baseline">
|
||||||
|
{{ userInfo.nickname }}
|
||||||
|
</ReText>
|
||||||
|
<ReText class="!self-baseline" type="info">
|
||||||
|
{{ userInfo.username }}
|
||||||
|
</ReText>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-menu-item
|
||||||
|
v-for="item in panes"
|
||||||
|
:key="item.key"
|
||||||
|
:index="item.key"
|
||||||
|
@click="
|
||||||
|
() => {
|
||||||
|
witchPane = item.key;
|
||||||
|
if (deviceDetection()) {
|
||||||
|
isOpen = !isOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<div class="flex items-center z-10">
|
||||||
|
<el-icon><IconifyIconOffline :icon="item.icon" /></el-icon>
|
||||||
|
<span>{{ item.label }}</span>
|
||||||
|
</div>
|
||||||
|
</el-menu-item>
|
||||||
|
</el-menu>
|
||||||
|
</el-aside>
|
||||||
|
<el-main>
|
||||||
|
<TopCollapse
|
||||||
|
v-if="deviceDetection()"
|
||||||
|
class="px-0"
|
||||||
|
:is-active="isOpen"
|
||||||
|
@toggleClick="isOpen = !isOpen"
|
||||||
|
/>
|
||||||
|
<component
|
||||||
|
:is="panes.find(item => item.key === witchPane).component"
|
||||||
|
:class="[!deviceDetection() && 'ml-[120px]']"
|
||||||
|
/>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.pure-account-settings {
|
||||||
|
background: $menuBg;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pure-account-settings-menu {
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
.el-menu-item {
|
||||||
|
height: 48px !important;
|
||||||
|
color: $menuText;
|
||||||
|
background-color: transparent !important;
|
||||||
|
transition: color 0.2s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: $menuTitleHover !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-active {
|
||||||
|
color: #fff !important;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0 8px;
|
||||||
|
margin: 4px 0;
|
||||||
|
clear: both;
|
||||||
|
content: "";
|
||||||
|
background: var(--el-color-primary);
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
body[layout] {
|
||||||
|
.el-menu--vertical .is-active {
|
||||||
|
color: #fff !important;
|
||||||
|
transition: color 0.2s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -32,7 +32,7 @@ const handleChange = value => {
|
|||||||
href="https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/components/cascader.vue"
|
href="https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/components/cascader.vue"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
代码位 src/views/components/cascader.vue
|
代码位置 src/views/components/cascader.vue
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const handleChange = (val: string[]) => {
|
|||||||
href="https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/components/collapse.vue"
|
href="https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/components/collapse.vue"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
代码位 src/views/components/collapse.vue
|
代码位置 src/views/components/collapse.vue
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -280,6 +280,16 @@ function onUpdateClick() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// popconfirm 确认框
|
||||||
|
function onPopconfirmClick() {
|
||||||
|
addDialog({
|
||||||
|
width: "30%",
|
||||||
|
title: "popconfirm确认框示例",
|
||||||
|
popconfirm: { title: "是否确认修改当前数据" },
|
||||||
|
contentRenderer: () => <p>点击右下方确定按钮看看效果吧</p>
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 结合Form表单(第一种方式,弹框关闭立刻恢复初始值)通过 props 属性接收子组件的 prop 并赋值
|
// 结合Form表单(第一种方式,弹框关闭立刻恢复初始值)通过 props 属性接收子组件的 prop 并赋值
|
||||||
function onFormOneClick() {
|
function onFormOneClick() {
|
||||||
addDialog({
|
addDialog({
|
||||||
@@ -496,6 +506,7 @@ function onBeforeSureClick() {
|
|||||||
<el-button @click="onCloseCallBackClick"> 关闭后的回调 </el-button>
|
<el-button @click="onCloseCallBackClick"> 关闭后的回调 </el-button>
|
||||||
<el-button @click="onNestingClick"> 嵌套的弹框 </el-button>
|
<el-button @click="onNestingClick"> 嵌套的弹框 </el-button>
|
||||||
<el-button @click="onUpdateClick"> 更改弹框自身属性值 </el-button>
|
<el-button @click="onUpdateClick"> 更改弹框自身属性值 </el-button>
|
||||||
|
<el-button @click="onPopconfirmClick">popconfirm确认框</el-button>
|
||||||
</el-space>
|
</el-space>
|
||||||
<el-divider />
|
<el-divider />
|
||||||
<el-space wrap>
|
<el-space wrap>
|
||||||
|
|||||||
@@ -240,6 +240,9 @@ watch(size, val => (dynamicSize.value = size.value));
|
|||||||
<p class="mb-2">禁用</p>
|
<p class="mb-2">禁用</p>
|
||||||
<Segmented :options="optionsDisabled" :size="dynamicSize" />
|
<Segmented :options="optionsDisabled" :size="dynamicSize" />
|
||||||
<el-divider />
|
<el-divider />
|
||||||
|
<p class="mb-2">全局禁用</p>
|
||||||
|
<Segmented :options="optionsBasis" :size="dynamicSize" disabled />
|
||||||
|
<el-divider />
|
||||||
<p class="mb-2">block 属性(将宽度调整为父元素宽度)</p>
|
<p class="mb-2">block 属性(将宽度调整为父元素宽度)</p>
|
||||||
<Segmented :options="optionsBlock" block :size="dynamicSize" />
|
<Segmented :options="optionsBlock" block :size="dynamicSize" />
|
||||||
<el-divider />
|
<el-divider />
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ function reset() {
|
|||||||
href="https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/components/statistic.vue"
|
href="https://github.com/pure-admin/vue-pure-admin/blob/main/src/views/components/statistic.vue"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
代码位 src/views/components/statistic.vue
|
代码位置 src/views/components/statistic.vue
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
import base from "./base.vue";
|
export { default as EditorBase } from "./EditorBase.vue";
|
||||||
import multi from "./multi.vue";
|
export { default as EditorMulti } from "./EditorMulti.vue";
|
||||||
import picUpload from "./picUpload.vue";
|
export { default as EditorUpload } from "./EditorUpload.vue";
|
||||||
|
|
||||||
const Base = base;
|
|
||||||
const Multi = multi;
|
|
||||||
const PicUpload = picUpload;
|
|
||||||
|
|
||||||
export { Base, Multi, PicUpload };
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { Base, Multi, PicUpload } from "./components";
|
import { EditorBase, EditorMulti, EditorUpload } from "./components";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "Editor"
|
name: "Editor"
|
||||||
@@ -34,13 +34,13 @@ const activeNames = ref("1");
|
|||||||
</template>
|
</template>
|
||||||
<el-collapse v-model="activeNames" accordion>
|
<el-collapse v-model="activeNames" accordion>
|
||||||
<el-collapse-item title="基础用法" name="1">
|
<el-collapse-item title="基础用法" name="1">
|
||||||
<Base v-if="activeNames === '1'" />
|
<EditorBase v-if="activeNames === '1'" />
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
<el-collapse-item title="多个富文本" name="2">
|
<el-collapse-item title="多个富文本" name="2">
|
||||||
<Multi v-if="activeNames === '2'" />
|
<EditorMulti v-if="activeNames === '2'" />
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
<el-collapse-item title="自定义图片上传" name="3">
|
<el-collapse-item title="自定义图片上传" name="3">
|
||||||
<PicUpload v-if="activeNames === '3'" />
|
<EditorUpload v-if="activeNames === '3'" />
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ const GUIDE_STEPS = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
element: document.querySelector(".set-icon") as string | HTMLElement,
|
element: document.querySelector(".set-icon") as string | HTMLElement,
|
||||||
title: "项目配置",
|
title: "系统配置",
|
||||||
intro: "您可以在这里查看项目配置",
|
intro: "您可以在这里查看系统配置",
|
||||||
position: "left"
|
position: "left"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Card from "./components/Card.vue";
|
|
||||||
import { getCardList } from "@/api/list";
|
import { getCardList } from "@/api/list";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessageBox } from "element-plus";
|
||||||
import { ref, onMounted, nextTick } from "vue";
|
import { ref, onMounted, nextTick } from "vue";
|
||||||
import dialogForm from "./components/DialogForm.vue";
|
import ListCard from "./components/ListCard.vue";
|
||||||
|
import ListDialogForm from "./components/ListDialogForm.vue";
|
||||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||||
import AddFill from "@iconify-icons/ri/add-circle-line";
|
import AddFill from "@iconify-icons/ri/add-circle-line";
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "ListCard"
|
name: "CardList"
|
||||||
});
|
});
|
||||||
|
|
||||||
const svg = `
|
const svg = `
|
||||||
@@ -152,7 +152,7 @@ const handleManageProduct = product => {
|
|||||||
:lg="6"
|
:lg="6"
|
||||||
:xl="4"
|
:xl="4"
|
||||||
>
|
>
|
||||||
<Card
|
<ListCard
|
||||||
:product="product"
|
:product="product"
|
||||||
@delete-item="handleDeleteItem"
|
@delete-item="handleDeleteItem"
|
||||||
@manage-product="handleManageProduct"
|
@manage-product="handleManageProduct"
|
||||||
@@ -172,6 +172,6 @@ const handleManageProduct = product => {
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<dialogForm v-model:visible="formDialogVisible" :data="formData" />
|
<ListDialogForm v-model:visible="formDialogVisible" :data="formData" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -4,18 +4,18 @@ import Motion from "./utils/motion";
|
|||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { message } from "@/utils/message";
|
import { message } from "@/utils/message";
|
||||||
import { loginRules } from "./utils/rule";
|
import { loginRules } from "./utils/rule";
|
||||||
import phone from "./components/phone.vue";
|
|
||||||
import TypeIt from "@/components/ReTypeit";
|
import TypeIt from "@/components/ReTypeit";
|
||||||
import { debounce } from "@pureadmin/utils";
|
import { debounce } from "@pureadmin/utils";
|
||||||
import qrCode from "./components/qrCode.vue";
|
|
||||||
import regist from "./components/regist.vue";
|
|
||||||
import update from "./components/update.vue";
|
|
||||||
import { useNav } from "@/layout/hooks/useNav";
|
import { useNav } from "@/layout/hooks/useNav";
|
||||||
import { useEventListener } from "@vueuse/core";
|
import { useEventListener } from "@vueuse/core";
|
||||||
import type { FormInstance } from "element-plus";
|
import type { FormInstance } from "element-plus";
|
||||||
import { $t, transformI18n } from "@/plugins/i18n";
|
import { $t, transformI18n } from "@/plugins/i18n";
|
||||||
import { operates, thirdParty } from "./utils/enums";
|
import { operates, thirdParty } from "./utils/enums";
|
||||||
import { useLayout } from "@/layout/hooks/useLayout";
|
import { useLayout } from "@/layout/hooks/useLayout";
|
||||||
|
import LoginPhone from "./components/LoginPhone.vue";
|
||||||
|
import LoginRegist from "./components/LoginRegist.vue";
|
||||||
|
import LoginUpdate from "./components/LoginUpdate.vue";
|
||||||
|
import LoginQrCode from "./components/LoginQrCode.vue";
|
||||||
import { useUserStoreHook } from "@/store/modules/user";
|
import { useUserStoreHook } from "@/store/modules/user";
|
||||||
import { initRouter, getTopMenu } from "@/router/utils";
|
import { initRouter, getTopMenu } from "@/router/utils";
|
||||||
import { bg, avatar, illustration } from "./utils/static";
|
import { bg, avatar, illustration } from "./utils/static";
|
||||||
@@ -77,10 +77,12 @@ const onLogin = async (formEl: FormInstance | undefined) => {
|
|||||||
router
|
router
|
||||||
.push(getTopMenu(true).path)
|
.push(getTopMenu(true).path)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
message("登录成功", { type: "success" });
|
message(t("login.pureLoginSuccess"), { type: "success" });
|
||||||
})
|
})
|
||||||
.finally(() => (disabled.value = false));
|
.finally(() => (disabled.value = false));
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
message(t("login.pureLoginFail"), { type: "error" });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => (loading.value = false));
|
.finally(() => (loading.value = false));
|
||||||
@@ -316,13 +318,13 @@ watch(loginDay, value => {
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</Motion>
|
</Motion>
|
||||||
<!-- 手机号登录 -->
|
<!-- 手机号登录 -->
|
||||||
<phone v-if="currentPage === 1" />
|
<LoginPhone v-if="currentPage === 1" />
|
||||||
<!-- 二维码登录 -->
|
<!-- 二维码登录 -->
|
||||||
<qrCode v-if="currentPage === 2" />
|
<LoginQrCode v-if="currentPage === 2" />
|
||||||
<!-- 注册 -->
|
<!-- 注册 -->
|
||||||
<regist v-if="currentPage === 3" />
|
<LoginRegist v-if="currentPage === 3" />
|
||||||
<!-- 忘记密码 -->
|
<!-- 忘记密码 -->
|
||||||
<update v-if="currentPage === 4" />
|
<LoginUpdate v-if="currentPage === 4" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user