Compare commits

...

8 Commits

Author SHA1 Message Date
xiaoxian521
c219f315b2 release: update 5.1.0 2024-03-02 01:21:27 +08:00
zepeng
16122aec17 feat: 菜单搜索新增搜索历史和收藏功能 (#901)
* feat: 菜单搜索新增搜索历史和收藏功能
2024-03-02 01:08:52 +08:00
xiaoxian521
b5645b19e1 chore: 适配最新版element-plus v2.6.0 2024-03-01 21:07:27 +08:00
xiaoming
19ccd378f5 style: 重构标签页UI,点击关闭按钮更方便 (#950)
* style: 重构标签页`UI`,点击关闭按钮更方便

* chore: update
2024-03-01 16:37:15 +08:00
Banana Energy
2b71e8bd54 feat: 菜单支持a标签右键的所有浏览器行为(在新标签页中、新窗口中打开链接,拖拽到新标签页打开等) (#936)
* feat: 菜单支持a标签右键的所有浏览器行为(在新标签页中、新窗口中打开链接,拖拽到新标签页打开等)

* feat: 修复添加a标签样式问题

* feat: 修复windows下双滚动条问题

* feat: 修复添加a标签样式问题
2024-03-01 11:38:47 +08:00
xiaoxian521
51809546ed feat: 添加多选卡片示例 2024-02-29 13:12:14 +08:00
xiaoxian521
760eac1c4d perf: 规范注册本地图标时的命名规则,使其更好地配合图标选择器 2024-02-28 14:36:50 +08:00
windyeasy
7009a16180 fix: 修复windows系统下登录页出现滚动条的问题 (#940) 2024-02-27 23:09:04 +08:00
69 changed files with 1456 additions and 885 deletions

View File

@@ -1,8 +1,28 @@
# 5.1.0 (2024-03-02)
### ✔️ refactor
- Reconstruct the tab page `UI` to make it more convenient to click the close button
### 🎫 Feat
- Added multi-select card example
- The menu supports all browser behaviors of right-clicking on the `a` tag (opening links in new tabs, new windows, dragging and dropping to open in new tabs, etc.)
- Added search history and collection functions to menu search
### 🐞 Bug fixes
- Fixed the problem of scroll bars appearing on the login page under `windows` system
### 🍏 Perf
- Standardize the naming rules when registering local icons to better match the icon selector
# 5.0.0 (2024-02-26) # 5.0.0 (2024-02-26)
Totally `ESM` version Totally `ESM` version
### ✔refactor ### ✔️ refactor
- Upgrade `vite` to `v5` version, specify `node` version `>18.18.0`, `pnpm` version `>=8.6.10` - Upgrade `vite` to `v5` version, specify `node` version `>18.18.0`, `pnpm` version `>=8.6.10`
- Use [vite-plugin-fake-server](https://www.npmjs.com/package/vite-plugin-fake-server) to replace [vite-plugin-mock](https://www.npmjs.com/package/vite-plugin-mock), use [@faker-js/faker](https://www.npmjs.com/package/@faker-js/faker) to replace [mockjs](https://www.npmjs.com/package/mockjs) - Use [vite-plugin-fake-server](https://www.npmjs.com/package/vite-plugin-fake-server) to replace [vite-plugin-mock](https://www.npmjs.com/package/vite-plugin-mock), use [@faker-js/faker](https://www.npmjs.com/package/@faker-js/faker) to replace [mockjs](https://www.npmjs.com/package/mockjs)
@@ -18,7 +38,7 @@ Totally `ESM` version
- Cleaner and neater pop-up panel on the right side of project configuration - Cleaner and neater pop-up panel on the right side of project configuration
- Restructure the About page to make it more compact and key information more prominent - Restructure the About page to make it more compact and key information more prominent
### 🎫Feat ### 🎫 Feat
- Add system management-menu management - Add system management-menu management
- Improve system management-user management - Improve system management-user management
@@ -59,7 +79,7 @@ Totally `ESM` version
- Fixed the problem that the right-click tab page panel cannot be closed when clicking on the `iframe` page and the right-click tab page panel is blocked when on the `iframe` page - Fixed the problem that the right-click tab page panel cannot be closed when clicking on the `iframe` page and the right-click tab page panel is blocked when on the `iframe` page
- Fixed the problem of missing parameters when clicking on breadcrumbs to jump to the page in routing `query` and `params` modes - Fixed the problem of missing parameters when clicking on breadcrumbs to jump to the page in routing `query` and `params` modes
### 🍏Perf ### 🍏 Perf
- Optimize theme color - Optimize theme color
- Tabs can be slid left or right according to the sliding force - Tabs can be slid left or right according to the sliding force

View File

@@ -1,8 +1,28 @@
# 5.1.0 (2024-03-02)
### ✔️ refactor
- Reconstruct the tab page `UI` to make it more convenient to click the close button
### 🎫 Feat
- Added multi-select card example
- The menu supports all browser behaviors of right-clicking on the `a` tag (opening links in new tabs, new windows, dragging and dropping to open in new tabs, etc.)
- Added search history and collection functions to menu search
### 🐞 Bug fixes
- Fixed the problem of scroll bars appearing on the login page under `windows` system
### 🍏 Perf
- Standardize the naming rules when registering local icons to better match the icon selector
# 5.0.0 (2024-02-26) # 5.0.0 (2024-02-26)
Totally `ESM` version Totally `ESM` version
### ✔refactor ### ✔️ refactor
- Upgrade `vite` to `v5` version, specify `node` version `>18.18.0`, `pnpm` version `>=8.6.10` - Upgrade `vite` to `v5` version, specify `node` version `>18.18.0`, `pnpm` version `>=8.6.10`
- Use [vite-plugin-fake-server](https://www.npmjs.com/package/vite-plugin-fake-server) to replace [vite-plugin-mock](https://www.npmjs.com/package/vite-plugin-mock), use [@faker-js/faker](https://www.npmjs.com/package/@faker-js/faker) to replace [mockjs](https://www.npmjs.com/package/mockjs) - Use [vite-plugin-fake-server](https://www.npmjs.com/package/vite-plugin-fake-server) to replace [vite-plugin-mock](https://www.npmjs.com/package/vite-plugin-mock), use [@faker-js/faker](https://www.npmjs.com/package/@faker-js/faker) to replace [mockjs](https://www.npmjs.com/package/mockjs)
@@ -18,7 +38,7 @@ Totally `ESM` version
- Cleaner and neater pop-up panel on the right side of project configuration - Cleaner and neater pop-up panel on the right side of project configuration
- Restructure the About page to make it more compact and key information more prominent - Restructure the About page to make it more compact and key information more prominent
### 🎫Feat ### 🎫 Feat
- Add system management-menu management - Add system management-menu management
- Improve system management-user management - Improve system management-user management
@@ -59,7 +79,7 @@ Totally `ESM` version
- Fixed the problem that the right-click tab page panel cannot be closed when clicking on the `iframe` page and the right-click tab page panel is blocked when on the `iframe` page - Fixed the problem that the right-click tab page panel cannot be closed when clicking on the `iframe` page and the right-click tab page panel is blocked when on the `iframe` page
- Fixed the problem of missing parameters when clicking on breadcrumbs to jump to the page in routing `query` and `params` modes - Fixed the problem of missing parameters when clicking on breadcrumbs to jump to the page in routing `query` and `params` modes
### 🍏Perf ### 🍏 Perf
- Optimize theme color - Optimize theme color
- Tabs can be slid left or right according to the sliding force - Tabs can be slid left or right according to the sliding force

View File

@@ -1,3 +1,23 @@
# 5.1.0 (2024-03-02)
### ✔️ refactor
- 重构标签页`UI`,点击关闭按钮更方便
### 🎫 Feat
- 添加多选卡片示例
- 菜单支持`a`标签右键的所有浏览器行为(在新标签页中、新窗口中打开链接,拖拽到新标签页打开等)
- 菜单搜索新增搜索历史和收藏功能
### 🐞 Bug fixes
- 修复`windows`系统下登录页出现滚动条的问题
### 🍏 Perf
- 规范注册本地图标时的命名规则,使其更好地配合图标选择器
# 5.0.0 (2024-02-26) # 5.0.0 (2024-02-26)
全面`ESM`版本 全面`ESM`版本

View File

@@ -37,6 +37,7 @@ const include = [
"@pureadmin/utils", "@pureadmin/utils",
"@wangeditor/editor", "@wangeditor/editor",
"responsive-storage", "responsive-storage",
"plus-pro-components",
"@howdyjs/mouse-menu", "@howdyjs/mouse-menu",
"@logicflow/extension", "@logicflow/extension",
"vue-virtual-scroller", "vue-virtual-scroller",

View File

@@ -67,6 +67,7 @@ menus:
hsCollapse: Collapse hsCollapse: Collapse
hsProgress: Progress hsProgress: Progress
hsUpload: File Upload hsUpload: File Upload
hsCheckCard: CheckCard
hsmenus: MultiLevel Menu hsmenus: MultiLevel Menu
hsmenu1: Menu1 hsmenu1: Menu1
hsmenu1-1: Menu1-1 hsmenu1-1: Menu1-1

View File

@@ -67,6 +67,7 @@ menus:
hsCollapse: 折叠面板 hsCollapse: 折叠面板
hsProgress: 进度条 hsProgress: 进度条
hsUpload: 文件上传 hsUpload: 文件上传
hsCheckCard: 多选卡片
hsmenus: 多级菜单 hsmenus: 多级菜单
hsmenu1: 菜单1 hsmenu1: 菜单1
hsmenu1-1: 菜单1-1 hsmenu1-1: 菜单1-1

View File

@@ -1,6 +1,6 @@
{ {
"name": "vue-pure-admin", "name": "vue-pure-admin",
"version": "5.0.0", "version": "5.1.0",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
@@ -53,9 +53,9 @@
"@logicflow/core": "^1.2.22", "@logicflow/core": "^1.2.22",
"@logicflow/extension": "^1.2.22", "@logicflow/extension": "^1.2.22",
"@pureadmin/descriptions": "^1.2.0", "@pureadmin/descriptions": "^1.2.0",
"@pureadmin/table": "^3.0.2", "@pureadmin/table": "^3.1.0",
"@pureadmin/utils": "^2.4.4", "@pureadmin/utils": "^2.4.4",
"@vueuse/core": "^10.8.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",
"@wangeditor/editor-for-vue": "^5.1.12", "@wangeditor/editor-for-vue": "^5.1.12",
@@ -67,7 +67,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.5.6", "element-plus": "^2.6.0",
"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",
@@ -78,24 +78,25 @@
"path": "^0.12.7", "path": "^0.12.7",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"pinyin-pro": "^3.19.6", "pinyin-pro": "^3.19.6",
"plus-pro-components": "^0.0.1",
"qrcode": "^1.5.3", "qrcode": "^1.5.3",
"qs": "^6.11.2", "qs": "^6.11.2",
"responsive-storage": "^2.2.0", "responsive-storage": "^2.2.0",
"sortablejs": "^1.15.2", "sortablejs": "^1.15.2",
"swiper": "^11.0.6", "swiper": "^11.0.7",
"typeit": "8.7.1", "typeit": "8.7.1",
"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.14", "vue": "^3.4.21",
"vue-i18n": "^9.9.1", "vue-i18n": "^9.10.1",
"vue-json-pretty": "^2.3.0", "vue-json-pretty": "^2.3.0",
"vue-pdf-embed": "1.2.1", "vue-pdf-embed": "1.2.1",
"vue-router": "^4.3.0", "vue-router": "^4.3.0",
"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",
"vue-waterfall-plugin-next": "^2.3.1", "vue-waterfall-plugin-next": "^2.4.3",
"vue3-danmaku": "^1.6.0", "vue3-danmaku": "^1.6.0",
"vuedraggable": "^4.1.0", "vuedraggable": "^4.1.0",
"wavesurfer.js": "^7.7.3", "wavesurfer.js": "^7.7.3",
@@ -116,13 +117,13 @@
"@types/gradient-string": "^1.1.5", "@types/gradient-string": "^1.1.5",
"@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.20", "@types/node": "^20.11.24",
"@types/nprogress": "^0.2.3", "@types/nprogress": "^0.2.3",
"@types/qrcode": "^1.5.5", "@types/qrcode": "^1.5.5",
"@types/qs": "^6.9.11", "@types/qs": "^6.9.12",
"@types/sortablejs": "^1.15.8", "@types/sortablejs": "^1.15.8",
"@typescript-eslint/eslint-plugin": "^7.0.2", "@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.0.2", "@typescript-eslint/parser": "^7.1.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.17", "autoprefixer": "^10.4.17",

1012
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{ {
"Version": "5.0.0", "Version": "5.1.0",
"Title": "PureAdmin", "Title": "PureAdmin",
"FixedHeader": true, "FixedHeader": true,
"HiddenSideBar": false, "HiddenSideBar": false,
@@ -22,6 +22,7 @@
"CachingAsyncRoutes": false, "CachingAsyncRoutes": false,
"TooltipEffect": "light", "TooltipEffect": "light",
"ResponsiveStorageNameSpace": "responsive-", "ResponsiveStorageNameSpace": "responsive-",
"MenuSearchHistory": 6,
"MapConfigure": { "MapConfigure": {
"amapKey": "97b3248d1553172e81f168cf94ea667e", "amapKey": "97b3248d1553172e81f168cf94ea667e",
"options": { "options": {

View File

@@ -389,7 +389,6 @@ export default defineComponent({
interactive: true, interactive: true,
appendTo: "parent", appendTo: "parent",
// hideOnClick: false, // hideOnClick: false,
animation: "perspective",
placement: "bottom-end" placement: "bottom-end"
}); });

View File

@@ -1,55 +1,54 @@
// 这里存放本地图标,在 src/layout/index.vue 文件中加载,避免在首启动加载
import { addIcon } from "@iconify/vue/dist/offline"; import { addIcon } from "@iconify/vue/dist/offline";
/** // 本地菜单图标,后端在路由的 icon 中返回对应的图标字符串并且前端在此处使用 addIcon 添加即可渲染菜单图标
* 这里存放本地图标,在 src/layout/index.vue 文件中加载,避免在首启动加载 // @iconify-icons/ep
*/
// 本地菜单图标后端在路由的icon中返回对应的图标字符串并且前端在此处使用addIcon添加即可渲染菜单图标
import UbuntuFill from "@iconify-icons/ri/ubuntu-fill";
import Menu from "@iconify-icons/ep/menu"; import Menu from "@iconify-icons/ep/menu";
import Edit from "@iconify-icons/ep/edit"; import Edit from "@iconify-icons/ep/edit";
import InformationLine from "@iconify-icons/ri/information-line";
import SetUp from "@iconify-icons/ep/set-up"; import SetUp from "@iconify-icons/ep/set-up";
import TerminalWindowLine from "@iconify-icons/ri/terminal-window-line";
import Guide from "@iconify-icons/ep/guide"; import Guide from "@iconify-icons/ep/guide";
import HomeFilled from "@iconify-icons/ep/home-filled";
import Card from "@iconify-icons/ri/bank-card-line";
import ListCheck from "@iconify-icons/ri/list-check";
import Histogram from "@iconify-icons/ep/histogram";
import Ppt from "@iconify-icons/ri/file-ppt-2-line";
import CheckboxCircleLine from "@iconify-icons/ri/checkbox-circle-line";
import FlUser from "@iconify-icons/ri/admin-line";
import Role from "@iconify-icons/ri/admin-fill";
import Setting from "@iconify-icons/ri/settings-3-line";
import Dept from "@iconify-icons/ri/git-branch-line";
import Search from "@iconify-icons/ri/search-line";
import Lollipop from "@iconify-icons/ep/lollipop";
import Monitor from "@iconify-icons/ep/monitor"; import Monitor from "@iconify-icons/ep/monitor";
import Tag from "@iconify-icons/ri/bookmark-2-line"; import Lollipop from "@iconify-icons/ep/lollipop";
import Table from "@iconify-icons/ri/table-line"; import Histogram from "@iconify-icons/ep/histogram";
import Info from "@iconify-icons/ri/file-info-line"; import HomeFilled from "@iconify-icons/ep/home-filled";
import Artboard from "@iconify-icons/ri/artboard-line";
addIcon("ubuntuFill", UbuntuFill);
addIcon("ep:menu", Menu); addIcon("ep:menu", Menu);
addIcon("edit", Edit); addIcon("ep:edit", Edit);
addIcon("informationLine", InformationLine); addIcon("ep:set-up", SetUp);
addIcon("setUp", SetUp); addIcon("ep:guide", Guide);
addIcon("terminalWindowLine", TerminalWindowLine);
addIcon("guide", Guide);
addIcon("homeFilled", HomeFilled);
addIcon("card", Card);
addIcon("listCheck", ListCheck);
addIcon("histogram", Histogram);
addIcon("ppt", Ppt);
addIcon("checkboxCircleLine", CheckboxCircleLine);
addIcon("ri:admin-line", FlUser);
addIcon("ri:admin-fill", Role);
addIcon("ri:settings-3-line", Setting);
addIcon("ri:git-branch-line", Dept);
addIcon("search", Search);
addIcon("ep:lollipop", Lollipop);
addIcon("ep:monitor", Monitor); addIcon("ep:monitor", Monitor);
addIcon("ep:lollipop", Lollipop);
addIcon("ep:histogram", Histogram);
addIcon("ep:home-filled", HomeFilled);
// @iconify-icons/ri
import Tag from "@iconify-icons/ri/bookmark-2-line";
import Ppt from "@iconify-icons/ri/file-ppt-2-line";
import Card from "@iconify-icons/ri/bank-card-line";
import Role from "@iconify-icons/ri/admin-fill";
import Info from "@iconify-icons/ri/file-info-line";
import Dept from "@iconify-icons/ri/git-branch-line";
import Table from "@iconify-icons/ri/table-line";
import Search from "@iconify-icons/ri/search-line";
import FlUser from "@iconify-icons/ri/admin-line";
import Setting from "@iconify-icons/ri/settings-3-line";
import Artboard from "@iconify-icons/ri/artboard-line";
import ListCheck from "@iconify-icons/ri/list-check";
import UbuntuFill from "@iconify-icons/ri/ubuntu-fill";
import InformationLine from "@iconify-icons/ri/information-line";
import TerminalWindowLine from "@iconify-icons/ri/terminal-window-line";
import CheckboxCircleLine from "@iconify-icons/ri/checkbox-circle-line";
addIcon("ri:bookmark-2-line", Tag); addIcon("ri:bookmark-2-line", Tag);
addIcon("table", Table); addIcon("ri:file-ppt-2-line", Ppt);
addIcon("info", Info); addIcon("ri:bank-card-line", Card);
addIcon("artboard", Artboard); addIcon("ri:admin-fill", Role);
addIcon("ri:file-info-line", Info);
addIcon("ri:git-branch-line", Dept);
addIcon("ri:table-line", Table);
addIcon("ri:search-line", Search);
addIcon("ri:admin-line", FlUser);
addIcon("ri:settings-3-line", Setting);
addIcon("ri:artboard-line", Artboard);
addIcon("ri:list-check", ListCheck);
addIcon("ri:ubuntu-fill", UbuntuFill);
addIcon("ri:information-line", InformationLine);
addIcon("ri:terminal-window-line", TerminalWindowLine);
addIcon("ri:checkbox-circle-line", CheckboxCircleLine);

View File

@@ -317,7 +317,7 @@ export default defineComponent({
/> />
<el-checkbox <el-checkbox
key={item} key={item}
label={item} value={item}
onChange={value => onChange={value =>
handleCheckColumnListChange(value, item) handleCheckColumnListChange(value, item)
} }

View File

@@ -1,9 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import ArrowUpLine from "@iconify-icons/ri/arrow-up-line";
import ArrowDownLine from "@iconify-icons/ri/arrow-down-line";
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";
import ArrowUpLine from "@iconify-icons/ri/arrow-up-line";
import ArrowDownLine from "@iconify-icons/ri/arrow-down-line";
const props = withDefaults(defineProps<{ total: number }>(), { const props = withDefaults(defineProps<{ total: number }>(), {
total: 0 total: 0

View File

@@ -0,0 +1,198 @@
<script setup lang="ts">
import Sortable from "sortablejs";
import SearchHistoryItem from "./SearchHistoryItem.vue";
import type { optionsItem, dragItem, Props } from "../types";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
import { useResizeObserver, isArray, delay } from "@pureadmin/utils";
import { ref, watch, nextTick, computed, getCurrentInstance } from "vue";
interface Emits {
(e: "update:value", val: string): void;
(e: "enter"): void;
(e: "collect", val: optionsItem): void;
(e: "delete", val: optionsItem): void;
(e: "drag", val: dragItem): void;
}
const historyRef = ref();
const innerHeight = ref();
/** 判断是否停止鼠标移入事件处理 */
const stopMouseEvent = ref(false);
const emit = defineEmits<Emits>();
const instance = getCurrentInstance()!;
const props = withDefaults(defineProps<Props>(), {});
const itemStyle = computed(() => {
return item => {
return {
background:
item?.path === active.value ? useEpThemeStoreHook().epThemeColor : "",
color: item.path === active.value ? "#fff" : "",
fontSize: item.path === active.value ? "16px" : "14px"
};
};
});
const titleStyle = computed(() => {
return {
color: useEpThemeStoreHook().epThemeColor,
fontWeight: 500
};
});
const active = computed({
get() {
return props.value;
},
set(val: string) {
emit("update:value", val);
}
});
watch(
() => props.value,
newValue => {
if (newValue) {
if (stopMouseEvent.value) {
delay(100).then(() => (stopMouseEvent.value = false));
}
}
}
);
const historyList = computed(() => {
return props.options.filter(item => item.type === "history");
});
const collectList = computed(() => {
return props.options.filter(item => item.type === "collect");
});
function handleCollect(item) {
emit("collect", item);
}
function handleDelete(item) {
stopMouseEvent.value = true;
emit("delete", item);
}
/** 鼠标移入 */
async function handleMouse(item) {
if (!stopMouseEvent.value) active.value = item.path;
}
function handleTo() {
emit("enter");
}
function resizeResult() {
// el-scrollbar max-height="calc(90vh - 140px)"
innerHeight.value = window.innerHeight - window.innerHeight / 10 - 140;
}
useResizeObserver(historyRef, resizeResult);
function handleScroll(index: number) {
const curInstance = instance?.proxy?.$refs[`historyItemRef${index}`];
if (!curInstance) return 0;
const curRef = isArray(curInstance)
? (curInstance[0] as ElRef)
: (curInstance as ElRef);
const scrollTop = curRef.offsetTop + 128; // 128 两个history-item56px+56px=112px高度加上下margin8px+8px=16px
return scrollTop > innerHeight.value ? scrollTop - innerHeight.value : 0;
}
const handleChangeIndex = (evt): void => {
emit("drag", { oldIndex: evt.oldIndex, newIndex: evt.newIndex });
};
let sortableInstance = null;
watch(
collectList,
val => {
if (val.length > 1) {
nextTick(() => {
const wrapper: HTMLElement =
document.querySelector(".collect-container");
if (!wrapper || sortableInstance) return;
sortableInstance = Sortable.create(wrapper, {
animation: 160,
onStart: event => {
event.item.style.cursor = "move";
},
onEnd: event => {
event.item.style.cursor = "pointer";
},
onUpdate: handleChangeIndex
});
resizeResult();
});
}
},
{ deep: true, immediate: true }
);
defineExpose({ handleScroll });
</script>
<template>
<div ref="historyRef" class="history">
<template v-if="historyList.length">
<div :style="titleStyle">搜索历史</div>
<div
v-for="(item, index) in historyList"
:key="item.path"
:ref="'historyItemRef' + index"
class="history-item dark:bg-[#1d1d1d]"
:style="itemStyle(item)"
@click="handleTo"
@mouseenter="handleMouse(item)"
>
<SearchHistoryItem
:item="item"
@delete-item="handleDelete"
@collect-item="handleCollect"
/>
</div>
</template>
<template v-if="collectList.length">
<div :style="titleStyle">
收藏{{ collectList.length > 1 ? "(可拖拽排序)" : "" }}
</div>
<div class="collect-container">
<div
v-for="(item, index) in collectList"
:key="item.path"
:ref="'historyItemRef' + (index + historyList.length)"
class="history-item dark:bg-[#1d1d1d]"
:style="itemStyle(item)"
@click="handleTo"
@mouseenter="handleMouse(item)"
>
<SearchHistoryItem :item="item" @delete-item="handleDelete" />
</div>
</div>
</template>
</div>
</template>
<style lang="scss" scoped>
.history {
padding-bottom: 12px;
&-item {
display: flex;
align-items: center;
height: 56px;
padding: 14px;
margin: 8px auto 10px;
cursor: pointer;
border: 0.1px solid #ccc;
border-radius: 4px;
transition: font-size 0.16s;
}
}
</style>

View File

@@ -0,0 +1,53 @@
<script setup lang="ts">
import type { optionsItem } from "../types";
import { transformI18n } from "@/plugins/i18n";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import Star from "@iconify-icons/ep/star";
import Close from "@iconify-icons/ep/close";
interface Props {
item: optionsItem;
}
interface Emits {
(e: "collectItem", val: optionsItem): void;
(e: "deleteItem", val: optionsItem): void;
}
const emit = defineEmits<Emits>();
withDefaults(defineProps<Props>(), {});
function handleCollect(item) {
emit("collectItem", item);
}
function handleDelete(item) {
emit("deleteItem", item);
}
</script>
<template>
<component :is="useRenderIcon(item.meta?.icon)" />
<span class="history-item-title">
{{ transformI18n(item.meta?.title) }}
</span>
<IconifyIconOffline
v-show="item.type === 'history'"
:icon="Star"
class="w-[18px] h-[18px] mr-2 hover:text-[#d7d5d4]"
@click.stop="handleCollect(item)"
/>
<IconifyIconOffline
:icon="Close"
class="w-[18px] h-[18px] hover:text-[#d7d5d4] cursor-pointer"
@click.stop="handleDelete(item)"
/>
</template>
<style lang="scss" scoped>
.history-item-title {
display: flex;
flex: 1;
margin-left: 5px;
}
</style>

View File

@@ -1,15 +1,18 @@
<script setup lang="ts"> <script setup lang="ts">
import { match } from "pinyin-pro"; import { match } from "pinyin-pro";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { getConfig } from "@/config";
import { useRouter } from "vue-router"; 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 { transformI18n } from "@/plugins/i18n";
import { ref, computed, shallowRef } from "vue"; import SearchHistory from "./SearchHistory.vue";
import { cloneDeep, isAllEmpty } from "@pureadmin/utils"; import type { optionsItem, dragItem } from "../types";
import { ref, computed, shallowRef, watch } from "vue";
import { useDebounceFn, onKeyStroke } from "@vueuse/core"; import { useDebounceFn, onKeyStroke } from "@vueuse/core";
import { usePermissionStoreHook } from "@/store/modules/permission"; import { usePermissionStoreHook } from "@/store/modules/permission";
import { cloneDeep, isAllEmpty, storageLocal } from "@pureadmin/utils";
import Search from "@iconify-icons/ri/search-line"; import Search from "@iconify-icons/ri/search-line";
interface Props { interface Props {
@@ -24,16 +27,26 @@ interface Emits {
const { device } = useNav(); const { device } = useNav();
const emit = defineEmits<Emits>(); const emit = defineEmits<Emits>();
const props = withDefaults(defineProps<Props>(), {}); const props = withDefaults(defineProps<Props>(), {});
const router = useRouter(); const router = useRouter();
const { locale } = useI18n(); const { locale } = useI18n();
const HISTORY_TYPE = "history";
const COLLECT_TYPE = "collect";
const LOCALEHISTORYKEY = "menu-search-history";
const LOCALECOLLECTKEY = "menu-search-collect";
const keyword = ref(""); const keyword = ref("");
const scrollbarRef = ref();
const resultRef = ref(); const resultRef = ref();
const historyRef = ref();
const scrollbarRef = ref();
const activePath = ref(""); const activePath = ref("");
const inputRef = ref<HTMLInputElement | null>(null); const historyPath = ref("");
const resultOptions = shallowRef([]); const resultOptions = shallowRef([]);
const historyOptions = shallowRef([]);
const handleSearch = useDebounceFn(search, 300); const handleSearch = useDebounceFn(search, 300);
const historyNum = getConfig().MenuSearchHistory;
const inputRef = ref<HTMLInputElement | null>(null);
/** 菜单树形结构 */ /** 菜单树形结构 */
const menusData = computed(() => { const menusData = computed(() => {
@@ -49,6 +62,36 @@ const show = computed({
} }
}); });
watch(
() => props.value,
newValue => {
if (newValue) getHistory();
}
);
const showSearchResult = computed(() => {
return keyword.value && resultOptions.value.length > 0;
});
const showSearchHistory = computed(() => {
return !keyword.value && historyOptions.value.length > 0;
});
const showEmpty = computed(() => {
return (
(!keyword.value && historyOptions.value.length === 0) ||
(keyword.value && resultOptions.value.length === 0)
);
});
function getStorageItem(key) {
return storageLocal().getItem<optionsItem[]>(key) || [];
}
function setStorageItem(key, value) {
storageLocal().setItem(key, value);
}
/** 将菜单树形结构扁平化为一维数组,用于菜单查询 */ /** 将菜单树形结构扁平化为一维数组,用于菜单查询 */
function flatTree(arr) { function flatTree(arr) {
const res = []; const res = [];
@@ -79,11 +122,8 @@ function search() {
)) ))
: false : false
); );
if (resultOptions.value?.length > 0) { activePath.value =
activePath.value = resultOptions.value[0].path; resultOptions.value?.length > 0 ? resultOptions.value[0].path : "";
} else {
activePath.value = "";
}
} }
function handleClose() { function handleClose() {
@@ -91,54 +131,143 @@ function handleClose() {
/** 延时处理防止用户看到某些操作 */ /** 延时处理防止用户看到某些操作 */
setTimeout(() => { setTimeout(() => {
resultOptions.value = []; resultOptions.value = [];
historyPath.value = "";
keyword.value = ""; keyword.value = "";
}, 200); }, 200);
} }
function scrollTo(index) { function scrollTo(index) {
const scrollTop = resultRef.value.handleScroll(index); const ref = resultOptions.value.length ? resultRef.value : historyRef.value;
const scrollTop = ref.handleScroll(index);
scrollbarRef.value.setScrollTop(scrollTop); scrollbarRef.value.setScrollTop(scrollTop);
} }
/** 获取当前选项和路径 */
function getCurrentOptionsAndPath() {
const isResultOptions = resultOptions.value.length > 0;
const options = isResultOptions ? resultOptions.value : historyOptions.value;
const currentPath = isResultOptions ? activePath.value : historyPath.value;
return { options, currentPath, isResultOptions };
}
/** 更新路径并滚动到指定项 */
function updatePathAndScroll(newIndex, isResultOptions) {
if (isResultOptions) {
activePath.value = resultOptions.value[newIndex].path;
} else {
historyPath.value = historyOptions.value[newIndex].path;
}
scrollTo(newIndex);
}
/** key up */ /** key up */
function handleUp() { function handleUp() {
const { length } = resultOptions.value; const { options, currentPath, isResultOptions } = getCurrentOptionsAndPath();
if (length === 0) return; if (options.length === 0) return;
const index = resultOptions.value.findIndex( const index = options.findIndex(item => item.path === currentPath);
item => item.path === activePath.value const prevIndex = (index - 1 + options.length) % options.length;
); updatePathAndScroll(prevIndex, isResultOptions);
if (index === 0) {
activePath.value = resultOptions.value[length - 1].path;
scrollTo(resultOptions.value.length - 1);
} else {
activePath.value = resultOptions.value[index - 1].path;
scrollTo(index - 1);
}
} }
/** key down */ /** key down */
function handleDown() { function handleDown() {
const { length } = resultOptions.value; const { options, currentPath, isResultOptions } = getCurrentOptionsAndPath();
if (length === 0) return; if (options.length === 0) return;
const index = resultOptions.value.findIndex( const index = options.findIndex(item => item.path === currentPath);
item => item.path === activePath.value const nextIndex = (index + 1) % options.length;
); updatePathAndScroll(nextIndex, isResultOptions);
if (index + 1 === length) {
activePath.value = resultOptions.value[0].path;
} else {
activePath.value = resultOptions.value[index + 1].path;
}
scrollTo(index + 1);
} }
/** key enter */ /** key enter */
function handleEnter() { function handleEnter() {
const { length } = resultOptions.value; const { options, currentPath, isResultOptions } = getCurrentOptionsAndPath();
if (length === 0 || activePath.value === "") return; if (options.length === 0 || currentPath === "") return;
router.push(activePath.value); const index = options.findIndex(item => item.path === currentPath);
if (index === -1) return;
if (isResultOptions) {
saveHistory();
} else {
updateHistory();
}
router.push(options[index].path);
handleClose(); handleClose();
} }
/** 删除历史记录 */
function handleDelete(item) {
const key = item.type === HISTORY_TYPE ? LOCALEHISTORYKEY : LOCALECOLLECTKEY;
let list = getStorageItem(key);
list = list.filter(listItem => listItem.path !== item.path);
setStorageItem(key, list);
getHistory();
}
/** 收藏历史记录 */
function handleCollect(item) {
let searchHistoryList = getStorageItem(LOCALEHISTORYKEY);
let searchCollectList = getStorageItem(LOCALECOLLECTKEY);
searchHistoryList = searchHistoryList.filter(
historyItem => historyItem.path !== item.path
);
setStorageItem(LOCALEHISTORYKEY, searchHistoryList);
if (!searchCollectList.some(collectItem => collectItem.path === item.path)) {
searchCollectList.unshift({ ...item, type: COLLECT_TYPE });
setStorageItem(LOCALECOLLECTKEY, searchCollectList);
}
getHistory();
}
/** 存储搜索记录 */
function saveHistory() {
const { path, meta } = resultOptions.value.find(
item => item.path === activePath.value
);
const searchHistoryList = getStorageItem(LOCALEHISTORYKEY);
const searchCollectList = getStorageItem(LOCALECOLLECTKEY);
const isCollected = searchCollectList.some(item => item.path === path);
const existingIndex = searchHistoryList.findIndex(item => item.path === path);
if (!isCollected) {
if (existingIndex !== -1) searchHistoryList.splice(existingIndex, 1);
if (searchHistoryList.length >= historyNum) searchHistoryList.pop();
searchHistoryList.unshift({ path, meta, type: HISTORY_TYPE });
storageLocal().setItem(LOCALEHISTORYKEY, searchHistoryList);
}
}
/** 更新存储的搜索记录 */
function updateHistory() {
let searchHistoryList = getStorageItem(LOCALEHISTORYKEY);
const historyIndex = searchHistoryList.findIndex(
item => item.path === historyPath.value
);
if (historyIndex !== -1) {
const [historyItem] = searchHistoryList.splice(historyIndex, 1);
searchHistoryList.unshift(historyItem);
setStorageItem(LOCALEHISTORYKEY, searchHistoryList);
}
}
/** 获取本地历史记录 */
function getHistory() {
const searchHistoryList = getStorageItem(LOCALEHISTORYKEY);
const searchCollectList = getStorageItem(LOCALECOLLECTKEY);
historyOptions.value = [...searchHistoryList, ...searchCollectList];
historyPath.value = historyOptions.value[0]?.path;
}
/** 拖拽改变收藏顺序 */
function handleDrag(item: dragItem) {
const searchCollectList = getStorageItem(LOCALECOLLECTKEY);
const [reorderedItem] = searchCollectList.splice(item.oldIndex, 1);
searchCollectList.splice(item.newIndex, 0, reorderedItem);
storageLocal().setItem(LOCALECOLLECTKEY, searchCollectList);
historyOptions.value = [
...getStorageItem(LOCALEHISTORYKEY),
...getStorageItem(LOCALECOLLECTKEY)
];
historyPath.value = reorderedItem.path;
}
onKeyStroke("Enter", handleEnter); onKeyStroke("Enter", handleEnter);
onKeyStroke("ArrowUp", handleUp); onKeyStroke("ArrowUp", handleUp);
onKeyStroke("ArrowDown", handleDown); onKeyStroke("ArrowDown", handleDown);
@@ -174,14 +303,21 @@ onKeyStroke("ArrowDown", handleDown);
/> />
</template> </template>
</el-input> </el-input>
<div class="search-result-container"> <div class="search-content">
<el-scrollbar ref="scrollbarRef" max-height="calc(90vh - 140px)"> <el-scrollbar ref="scrollbarRef" max-height="calc(90vh - 140px)">
<el-empty <el-empty v-if="showEmpty" description="暂无搜索结果" />
v-if="resultOptions.length === 0" <SearchHistory
description="暂无搜索结果" v-if="showSearchHistory"
ref="historyRef"
v-model:value="historyPath"
:options="historyOptions"
@click="handleEnter"
@delete="handleDelete"
@collect="handleCollect"
@drag="handleDrag"
/> />
<SearchResult <SearchResult
v-else v-if="showSearchResult"
ref="resultRef" ref="resultRef"
v-model:value="activePath" v-model:value="activePath"
:options="resultOptions" :options="resultOptions"
@@ -196,7 +332,7 @@ onKeyStroke("ArrowDown", handleDown);
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.search-result-container { .search-content {
margin-top: 12px; margin-top: 12px;
} }
</style> </style>

View File

@@ -1,24 +1,11 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Props } from "../types";
import { transformI18n } from "@/plugins/i18n"; import { transformI18n } from "@/plugins/i18n";
import { useResizeObserver } from "@pureadmin/utils"; import { useResizeObserver } from "@pureadmin/utils";
import { useEpThemeStoreHook } from "@/store/modules/epTheme"; import { useEpThemeStoreHook } from "@/store/modules/epTheme";
import { useRenderIcon } from "@/components/ReIcon/src/hooks"; import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import { ref, computed, getCurrentInstance, onMounted } from "vue"; import { ref, computed, getCurrentInstance, onMounted } from "vue";
import enterOutlined from "@/assets/svg/enter_outlined.svg?component"; import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
import Bookmark2Line from "@iconify-icons/ri/bookmark-2-line";
interface optionsItem {
path: string;
meta?: {
icon?: string;
title?: string;
};
}
interface Props {
value: string;
options: Array<optionsItem>;
}
interface Emits { interface Emits {
(e: "update:value", val: string): void; (e: "update:value", val: string): void;
@@ -27,9 +14,9 @@ interface Emits {
const resultRef = ref(); const resultRef = ref();
const innerHeight = ref(); const innerHeight = ref();
const props = withDefaults(defineProps<Props>(), {});
const emit = defineEmits<Emits>(); const emit = defineEmits<Emits>();
const instance = getCurrentInstance()!; const instance = getCurrentInstance()!;
const props = withDefaults(defineProps<Props>(), {});
const itemStyle = computed(() => { const itemStyle = computed(() => {
return item => { return item => {
@@ -93,7 +80,7 @@ defineExpose({ handleScroll });
@click="handleTo" @click="handleTo"
@mouseenter="handleMouse(item)" @mouseenter="handleMouse(item)"
> >
<component :is="useRenderIcon(item.meta?.icon ?? Bookmark2Line)" /> <component :is="useRenderIcon(item.meta?.icon)" />
<span class="result-item-title"> <span class="result-item-title">
{{ transformI18n(item.meta?.title) }} {{ transformI18n(item.meta?.title) }}
</span> </span>

View File

@@ -14,7 +14,7 @@ function handleSearch() {
class="search-container w-[40px] h-[48px] flex-c cursor-pointer navbar-bg-hover" class="search-container w-[40px] h-[48px] flex-c cursor-pointer navbar-bg-hover"
@click="handleSearch" @click="handleSearch"
> >
<IconifyIconOffline icon="search" /> <IconifyIconOffline icon="ri:search-line" />
</div> </div>
<SearchModal v-model:value="show" /> <SearchModal v-model:value="show" />
</div> </div>

View File

@@ -0,0 +1,20 @@
interface optionsItem {
path: string;
type: "history" | "collect";
meta: {
icon?: string;
title?: string;
};
}
interface dragItem {
oldIndex: number;
newIndex: number;
}
interface Props {
value: string;
options: Array<optionsItem>;
}
export type { optionsItem, dragItem, Props };

View File

@@ -0,0 +1,36 @@
<script setup lang="ts">
import { computed } from "vue";
import { isUrl } from "@pureadmin/utils";
import { menuType } from "@/layout/types";
defineOptions({
name: "LinkItem"
});
const props = defineProps<{
to: menuType;
}>();
const isExternalLink = computed(() => isUrl(props.to.name));
const getLinkProps = (item: menuType) => {
if (isExternalLink.value) {
return {
href: item.name,
target: "_blank",
rel: "noopener"
};
}
return {
to: item
};
};
</script>
<template>
<component
:is="isExternalLink ? 'a' : 'router-link'"
v-bind="getLinkProps(to)"
>
<slot />
</component>
</template>

View File

@@ -48,6 +48,7 @@ const { title, getLogo } = useNav();
flex-wrap: nowrap; flex-wrap: nowrap;
align-items: center; align-items: center;
height: 100%; height: 100%;
padding-left: 10px;
img { img {
display: inline-block; display: inline-block;

View File

@@ -1,19 +1,28 @@
<script setup lang="ts"> <script setup lang="ts">
import path from "path"; import path from "path";
import { getConfig } from "@/config"; import { getConfig } from "@/config";
import LinkItem from "./linkItem.vue";
import { menuType } from "../../types"; import { menuType } from "../../types";
import extraIcon from "./extraIcon.vue"; import extraIcon from "./extraIcon.vue";
import { ReText } from "@/components/ReText"; import { ReText } from "@/components/ReText";
import { useNav } from "@/layout/hooks/useNav"; import { useNav } from "@/layout/hooks/useNav";
import { transformI18n } from "@/plugins/i18n"; import { transformI18n } from "@/plugins/i18n";
import { useRenderIcon } from "@/components/ReIcon/src/hooks"; import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import { type CSSProperties, type PropType, computed, ref, toRaw } from "vue"; import {
type PropType,
type CSSProperties,
ref,
toRaw,
computed,
useAttrs
} from "vue";
import ArrowUp from "@iconify-icons/ep/arrow-up-bold"; import ArrowUp from "@iconify-icons/ep/arrow-up-bold";
import EpArrowDown from "@iconify-icons/ep/arrow-down-bold"; import EpArrowDown from "@iconify-icons/ep/arrow-down-bold";
import ArrowLeft from "@iconify-icons/ep/arrow-left-bold"; import ArrowLeft from "@iconify-icons/ep/arrow-left-bold";
import ArrowRight from "@iconify-icons/ep/arrow-right-bold"; import ArrowRight from "@iconify-icons/ep/arrow-right-bold";
const attrs = useAttrs();
const { layout, isCollapse, tooltipEffect, getDivStyle } = useNav(); const { layout, isCollapse, tooltipEffect, getDivStyle } = useNav();
const props = defineProps({ const props = defineProps({
@@ -32,6 +41,7 @@ const props = defineProps({
const getNoDropdownStyle = computed((): CSSProperties => { const getNoDropdownStyle = computed((): CSSProperties => {
return { return {
width: "100%",
display: "flex", display: "flex",
alignItems: "center" alignItems: "center"
}; };
@@ -96,61 +106,66 @@ function resolvePath(routePath) {
</script> </script>
<template> <template>
<el-menu-item <link-item
v-if=" v-if="
hasOneShowingChild(props.item.children, props.item) && hasOneShowingChild(props.item.children, props.item) &&
(!onlyOneChild.children || onlyOneChild.noShowingChildren) (!onlyOneChild.children || onlyOneChild.noShowingChildren)
" "
:index="resolvePath(onlyOneChild.path)" :to="item"
:class="{ 'submenu-title-noDropdown': !isNest }"
:style="getNoDropdownStyle"
> >
<div <el-menu-item
v-if="toRaw(props.item.meta.icon)" :index="resolvePath(onlyOneChild.path)"
class="sub-menu-icon" :class="{ 'submenu-title-noDropdown': !isNest }"
:style="getSubMenuIconStyle" :style="getNoDropdownStyle"
v-bind="attrs"
> >
<component <div
:is=" v-if="toRaw(props.item.meta.icon)"
useRenderIcon( class="sub-menu-icon"
toRaw(onlyOneChild.meta.icon) || :style="getSubMenuIconStyle"
(props.item.meta && toRaw(props.item.meta.icon)) >
) <component
" :is="
/> useRenderIcon(
</div> toRaw(onlyOneChild.meta.icon) ||
<el-text (props.item.meta && toRaw(props.item.meta.icon))
v-if=" )
(!props.item?.meta.icon && "
isCollapse && />
layout === 'vertical' &&
props.item?.pathList?.length === 1) ||
(!onlyOneChild.meta.icon &&
isCollapse &&
layout === 'mix' &&
props.item?.pathList?.length === 2)
"
truncated
class="!px-4 !text-inherit"
>
{{ transformI18n(onlyOneChild.meta.title) }}
</el-text>
<template #title>
<div :style="getDivStyle">
<ReText
:tippyProps="{
offset: [0, -10],
theme: tooltipEffect
}"
class="!text-inherit"
>
{{ transformI18n(onlyOneChild.meta.title) }}
</ReText>
<extraIcon :extraIcon="onlyOneChild.meta.extraIcon" />
</div> </div>
</template> <el-text
</el-menu-item> v-if="
(!props.item?.meta.icon &&
isCollapse &&
layout === 'vertical' &&
props.item?.pathList?.length === 1) ||
(!onlyOneChild.meta.icon &&
isCollapse &&
layout === 'mix' &&
props.item?.pathList?.length === 2)
"
truncated
class="!px-4 !text-inherit"
>
{{ transformI18n(onlyOneChild.meta.title) }}
</el-text>
<template #title>
<div :style="getDivStyle">
<ReText
:tippyProps="{
offset: [0, -10],
theme: tooltipEffect
}"
class="!text-inherit"
>
{{ transformI18n(onlyOneChild.meta.title) }}
</ReText>
<extraIcon :extraIcon="onlyOneChild.meta.extraIcon" />
</div>
</template>
</el-menu-item>
</link-item>
<el-sub-menu <el-sub-menu
v-else v-else
ref="subMenu" ref="subMenu"

View File

@@ -18,26 +18,6 @@
} }
} }
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes close {
from {
transform: translate(-50%, -50%);
}
to {
transform: translate(0, -50%);
}
}
.tags-view { .tags-view {
position: relative; position: relative;
display: flex; display: flex;
@@ -51,41 +31,35 @@
.scroll-item { .scroll-item {
position: relative; position: relative;
display: inline-block; display: inline-block;
height: 28px; height: 34px;
padding: 0 6px; padding-left: 6px;
margin-right: 4px; line-height: 34px;
line-height: 28px;
cursor: pointer; cursor: pointer;
border-radius: 3px 3px 0 0;
box-shadow: 0 0 1px #888;
transition: all 0.4s; transition: all 0.4s;
&:not(:first-child) {
padding-right: 24px;
}
.el-icon-close { .el-icon-close {
position: absolute; position: absolute;
top: 50%; top: 50%;
font-size: 10px; display: inline-flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
color: var(--el-color-primary); color: var(--el-color-primary);
cursor: pointer; cursor: pointer;
transition: font-size 0.2s; border-radius: 4px;
transform: translate(-50%, -50%); transition:
background-color 0.12s,
color 0.12s;
transform: translate(0, -50%);
&:hover { &:hover {
font-size: 13px; color: rgb(0 0 0 / 88%) !important;
color: #fff; background-color: rgb(0 0 0 / 6%);
background: #b4bccc;
border-radius: 50%;
}
}
&.is-closable:not(:first-child) {
&:hover {
padding-right: 18px;
&:not(.is-active) {
.el-icon-close {
animation: close 200ms ease-in forwards;
}
}
} }
} }
} }
@@ -99,7 +73,6 @@
.scroll-container { .scroll-container {
position: relative; position: relative;
flex: 1; flex: 1;
padding: 5px 0;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
@@ -114,7 +87,7 @@
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
&:nth-child(1) { &:nth-child(1) {
margin-left: 5px; padding: 0 12px;
} }
} }
} }
@@ -194,14 +167,7 @@
.scroll-item.is-active { .scroll-item.is-active {
position: relative; position: relative;
color: #fff; color: #fff;
box-shadow: 0 0 0.7px #888;
&:not(:first-child) {
padding-right: 18px;
}
.el-icon-close {
transform: translate(0, -50%);
}
.tag-title { .tag-title {
color: var(--el-color-primary) !important; color: var(--el-color-primary) !important;
@@ -212,16 +178,16 @@
.arrow-right, .arrow-right,
.arrow-down { .arrow-down {
position: relative; position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 40px; width: 40px;
height: 38px; height: 34px;
color: var(--el-text-color-primary); color: var(--el-text-color-primary);
svg { svg {
position: absolute;
left: 50%;
width: 20px; width: 20px;
height: 20px; height: 20px;
transform: translate(-50%, 50%);
} }
} }

View File

@@ -21,9 +21,9 @@ import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
import ArrowDown from "@iconify-icons/ri/arrow-down-s-line"; import ArrowDown from "@iconify-icons/ri/arrow-down-s-line";
import ArrowRightSLine from "@iconify-icons/ri/arrow-right-s-line"; import ArrowRightSLine from "@iconify-icons/ri/arrow-right-s-line";
import ArrowLeftSLine from "@iconify-icons/ri/arrow-left-s-line"; import ArrowLeftSLine from "@iconify-icons/ri/arrow-left-s-line";
import CloseBold from "@iconify-icons/ep/close-bold";
const { const {
Close,
route, route,
router, router,
visible, visible,
@@ -156,7 +156,8 @@ const handleWheel = (event: WheelEvent): void => {
}; };
const smoothScroll = (offset: number): void => { const smoothScroll = (offset: number): void => {
const scrollAmount = 20; // 每帧滚动的距离 // 每帧滚动的距离
const scrollAmount = 20;
let remaining = Math.abs(offset); let remaining = Math.abs(offset);
const scrollStep = () => { const scrollStep = () => {
@@ -586,7 +587,7 @@ onBeforeUnmount(() => {
class="el-icon-close" class="el-icon-close"
@click.stop="deleteMenu(item)" @click.stop="deleteMenu(item)"
> >
<IconifyIconOffline :icon="CloseBold" /> <IconifyIconOffline :icon="Close" />
</span> </span>
<span <span
v-if="showModel !== 'card'" v-if="showModel !== 'card'"

View File

@@ -216,6 +216,7 @@ export function useTags() {
}); });
return { return {
Close,
route, route,
router, router,
visible, visible,

View File

@@ -8,7 +8,7 @@ export const routerArrays: Array<RouteConfigs> =
path: "/welcome", path: "/welcome",
meta: { meta: {
title: "menus.hshome", title: "menus.hshome",
icon: "homeFilled" icon: "ep:home-filled"
} }
} }
] ]
@@ -62,6 +62,7 @@ export interface setType {
export type menuType = { export type menuType = {
id?: number; id?: number;
name?: string;
path?: string; path?: string;
noShowingChildren?: boolean; noShowingChildren?: boolean;
children?: menuType[]; children?: menuType[];

View File

@@ -5,7 +5,7 @@ export default {
path: "/able", path: "/able",
redirect: "/able/watermark", redirect: "/able/watermark",
meta: { meta: {
icon: "ubuntuFill", icon: "ri:ubuntu-fill",
title: $t("menus.hsAble"), title: $t("menus.hsAble"),
rank: able rank: able
}, },

View File

@@ -5,7 +5,7 @@ export default {
path: "/about", path: "/about",
redirect: "/about/index", redirect: "/about/index",
meta: { meta: {
icon: "info", icon: "ri:file-info-line",
title: $t("menus.hsAbout"), title: $t("menus.hsAbout"),
rank: about rank: about
}, },

View File

@@ -6,7 +6,7 @@ export default {
path: "/board", path: "/board",
redirect: "/board/index", redirect: "/board/index",
meta: { meta: {
icon: "artboard", icon: "ri:artboard-line",
title: $t("menus.hsboard"), title: $t("menus.hsboard"),
rank: board rank: board
}, },
@@ -17,8 +17,7 @@ export default {
component: IFrame, component: IFrame,
meta: { meta: {
title: $t("menus.hsboard"), title: $t("menus.hsboard"),
frameSrc: "https://songlh.top/paint-board/", frameSrc: "https://songlh.top/paint-board/"
extraIcon: "IF-pure-iconfont-new svg"
} }
} }
] ]

View File

@@ -31,7 +31,15 @@ export default {
name: "PureUpload", name: "PureUpload",
component: () => import("@/views/components/upload/index.vue"), component: () => import("@/views/components/upload/index.vue"),
meta: { meta: {
title: $t("menus.hsUpload"), title: $t("menus.hsUpload")
}
},
{
path: "/components/check-card",
name: "CheckCard",
component: () => import("@/views/components/check-card.vue"),
meta: {
title: $t("menus.hsCheckCard"),
extraIcon: "IF-pure-iconfont-new svg" extraIcon: "IF-pure-iconfont-new svg"
} }
}, },

View File

@@ -5,7 +5,7 @@ export default {
path: "/editor", path: "/editor",
redirect: "/editor/index", redirect: "/editor/index",
meta: { meta: {
icon: "edit", icon: "ep:edit",
title: $t("menus.hseditor"), title: $t("menus.hseditor"),
rank: editor rank: editor
}, },

View File

@@ -5,7 +5,7 @@ export default {
path: "/error", path: "/error",
redirect: "/error/403", redirect: "/error/403",
meta: { meta: {
icon: "informationLine", icon: "ri:information-line",
// showLink: false, // showLink: false,
title: $t("menus.hsabnormal"), title: $t("menus.hsabnormal"),
rank: error rank: error

View File

@@ -5,7 +5,7 @@ export default {
path: "/flow-chart", path: "/flow-chart",
redirect: "/flow-chart/index", redirect: "/flow-chart/index",
meta: { meta: {
icon: "setUp", icon: "ep:set-up",
title: $t("menus.hsflowChart"), title: $t("menus.hsflowChart"),
rank: flowchart rank: flowchart
}, },

View File

@@ -6,7 +6,7 @@ export default {
path: "/form-design", path: "/form-design",
redirect: "/form-design/index", redirect: "/form-design/index",
meta: { meta: {
icon: "terminalWindowLine", icon: "ri:terminal-window-line",
title: $t("menus.hsFormDesign"), title: $t("menus.hsFormDesign"),
rank: formdesign rank: formdesign
}, },

View File

@@ -5,7 +5,7 @@ export default {
path: "/guide", path: "/guide",
redirect: "/guide/index", redirect: "/guide/index",
meta: { meta: {
icon: "guide", icon: "ep:guide",
title: $t("menus.hsguide"), title: $t("menus.hsguide"),
rank: guide rank: guide
}, },

View File

@@ -9,7 +9,7 @@ export default {
component: Layout, component: Layout,
redirect: "/welcome", redirect: "/welcome",
meta: { meta: {
icon: "homeFilled", icon: "ep:home-filled",
title: $t("menus.hshome"), title: $t("menus.hshome"),
rank: home rank: home
}, },

View File

@@ -5,7 +5,7 @@ export default {
path: "/list", path: "/list",
redirect: "/list/card", redirect: "/list/card",
meta: { meta: {
icon: "listCheck", icon: "ri:list-check",
title: $t("menus.hsList"), title: $t("menus.hsList"),
rank: list rank: list
}, },
@@ -15,7 +15,7 @@ export default {
name: "ListCard", name: "ListCard",
component: () => import("@/views/list/card/index.vue"), component: () => import("@/views/list/card/index.vue"),
meta: { meta: {
icon: "card", icon: "ri:bank-card-line",
title: $t("menus.hsListCard"), title: $t("menus.hsListCard"),
showParent: true showParent: true
} }

View File

@@ -6,7 +6,7 @@ export default {
redirect: "/nested/menu1/menu1-1", redirect: "/nested/menu1/menu1-1",
meta: { meta: {
title: $t("menus.hsmenus"), title: $t("menus.hsmenus"),
icon: "histogram", icon: "ep:histogram",
rank: nested rank: nested
}, },
children: [ children: [

View File

@@ -5,7 +5,7 @@ export default {
path: "/ppt", path: "/ppt",
redirect: "/ppt/index", redirect: "/ppt/index",
meta: { meta: {
icon: "ppt", icon: "ri:file-ppt-2-line",
title: "PPT", title: "PPT",
rank: ppt rank: ppt
}, },

View File

@@ -5,7 +5,7 @@ export default {
path: "/result", path: "/result",
redirect: "/result/success", redirect: "/result/success",
meta: { meta: {
icon: "checkboxCircleLine", icon: "ri:checkbox-circle-line",
title: $t("menus.hsResult"), title: $t("menus.hsResult"),
rank: result rank: result
}, },

View File

@@ -5,7 +5,7 @@ export default {
path: "/pure-table", path: "/pure-table",
redirect: "/pure-table/index", redirect: "/pure-table/index",
meta: { meta: {
icon: "table", icon: "ri:table-line",
title: "pure-admin-table", title: "pure-admin-table",
rank: table rank: table
}, },

View File

@@ -45,6 +45,15 @@ html.dark {
.arrow-right { .arrow-right {
border-left: 1px solid $border-style; border-left: 1px solid $border-style;
} }
.scroll-item {
.el-icon-close {
&:hover {
color: rgb(255 255 255 / 85%) !important;
background-color: rgb(255 255 255 / 12%);
}
}
}
} }
/* 项目配置面板 */ /* 项目配置面板 */

View File

@@ -102,7 +102,6 @@
/* 克隆并自定义 ElMessage 样式,不会影响 ElMessage 原本样式,在 src/utils/message.ts 中调用自定义样式 ElMessage 方法即可,整体暗色风格在 src/style/dark.scss 文件进行了适配 */ /* 克隆并自定义 ElMessage 样式,不会影响 ElMessage 原本样式,在 src/utils/message.ts 中调用自定义样式 ElMessage 方法即可,整体暗色风格在 src/style/dark.scss 文件进行了适配 */
.pure-message { .pure-message {
padding: 10px 13px !important;
background: #fff !important; background: #fff !important;
border-width: 0 !important; border-width: 0 !important;
box-shadow: box-shadow:
@@ -110,22 +109,13 @@
0 6px 16px #00000014, 0 6px 16px #00000014,
0 9px 28px 8px #0000000d !important; 0 9px 28px 8px #0000000d !important;
&.el-message.is-closable .el-message__content {
padding-right: 17px !important;
}
& .el-message__content { & .el-message__content {
color: #000000d9 !important; color: #000000d9 !important;
pointer-events: all !important; pointer-events: all !important;
background-image: initial !important; background-image: initial !important;
} }
& .el-message__icon {
margin-right: 8px !important;
}
& .el-message__closeBtn { & .el-message__closeBtn {
right: 9px !important;
border-radius: 4px; border-radius: 4px;
outline: none; outline: none;
transition: transition:

View File

@@ -10,6 +10,7 @@
.login-container { .login-container {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
max-width: 100%;
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
grid-gap: 18rem; grid-gap: 18rem;

View File

@@ -14,6 +14,11 @@
} }
} }
/* 修复 windows 下双滚动条问题 https://github.com/pure-admin/vue-pure-admin/pull/936#issuecomment-1968125992 */
.el-popper.pure-scrollbar {
overflow: hidden;
}
/* popper menu 超出内容区可滚动 */ /* popper menu 超出内容区可滚动 */
.pure-scrollbar { .pure-scrollbar {
max-height: calc(100vh - calc(50px * 2.5)); max-height: calc(100vh - calc(50px * 2.5));
@@ -130,11 +135,9 @@
} }
a { a {
display: inline-block;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
width: 100%; width: 100%;
padding-left: 10px;
} }
.el-menu { .el-menu {
@@ -331,9 +334,18 @@
margin-top: 0; margin-top: 0;
} }
/* 无子菜单时激活 border-bottom */
a > .is-active.submenu-title-noDropdown {
border-bottom: 2px solid var(--el-menu-active-color);
}
.el-menu--popup { .el-menu--popup {
background-color: $subMenuBg !important; background-color: $subMenuBg !important;
a > .is-active.submenu-title-noDropdown {
border-bottom: none;
}
.el-menu-item { .el-menu-item {
color: $menuText; color: $menuText;
background-color: $subMenuBg; background-color: $subMenuBg;
@@ -348,12 +360,6 @@
} }
} }
/* 无子菜单时激活 border-bottom */
.router-link-exact-active > .submenu-title-noDropdown {
height: 60px;
border-bottom: 2px solid var(--el-menu-active-color);
}
/* 子菜单中还有子菜单 */ /* 子菜单中还有子菜单 */
.el-menu .el-sub-menu__title { .el-menu .el-sub-menu__title {
min-width: $sideBarWidth !important; min-width: $sideBarWidth !important;

View File

@@ -85,6 +85,22 @@ class StorageProxy implements ProxyStorage {
}); });
}); });
} }
/**
* @description 获取数据仓库中所有的key
*/
public async keys() {
return new Promise<string[]>((resolve, reject) => {
this.storage
.keys()
.then(keys => {
resolve(keys);
})
.catch(err => {
reject(err);
});
});
}
} }
/** /**

View File

@@ -94,10 +94,10 @@ watch(size, val =>
<el-space wrap :size="40"> <el-space wrap :size="40">
<span style="font-size: 16px; font-weight: 800"> 可选按钮 </span> <span style="font-size: 16px; font-weight: 800"> 可选按钮 </span>
<el-radio-group v-model="size" size="small"> <el-radio-group v-model="size" size="small">
<el-radio label="large">大尺寸</el-radio> <el-radio value="large">大尺寸</el-radio>
<el-radio label="default">默认尺寸</el-radio> <el-radio value="default">默认尺寸</el-radio>
<el-radio label="small">小尺寸</el-radio> <el-radio value="small">小尺寸</el-radio>
<el-radio label="disabled">禁用</el-radio> <el-radio value="disabled">禁用</el-radio>
</el-radio-group> </el-radio-group>
</el-space> </el-space>
</div> </div>
@@ -108,9 +108,9 @@ watch(size, val =>
:size="dynamicSize" :size="dynamicSize"
:disabled="size === 'disabled'" :disabled="size === 'disabled'"
> >
<el-radio-button label="wait">等待中</el-radio-button> <el-radio-button value="wait">等待中</el-radio-button>
<el-radio-button label="progress">进行中</el-radio-button> <el-radio-button value="progress">进行中</el-radio-button>
<el-radio-button label="complete">已完成</el-radio-button> <el-radio-button value="complete">已完成</el-radio-button>
</el-radio-group> </el-radio-group>
<el-divider /> <el-divider />
@@ -120,9 +120,9 @@ watch(size, val =>
:size="dynamicSize" :size="dynamicSize"
:disabled="size === 'disabled'" :disabled="size === 'disabled'"
> >
<el-radio label="wait" border>等待中</el-radio> <el-radio value="wait" border>等待中</el-radio>
<el-radio label="progress" border>进行中</el-radio> <el-radio value="progress" border>进行中</el-radio>
<el-radio label="complete" border>已完成</el-radio> <el-radio value="complete" border>已完成</el-radio>
</el-radio-group> </el-radio-group>
<el-divider /> <el-divider />
@@ -132,19 +132,19 @@ watch(size, val =>
:size="dynamicSize" :size="dynamicSize"
:disabled="size === 'disabled'" :disabled="size === 'disabled'"
> >
<el-radio-button label="wait"> <el-radio-button value="wait">
<span class="flex"> <span class="flex">
<IconifyIconOnline icon="ri:progress-8-fill" class="mr-1" /> <IconifyIconOnline icon="ri:progress-8-fill" class="mr-1" />
等待中 等待中
</span> </span>
</el-radio-button> </el-radio-button>
<el-radio-button label="progress"> <el-radio-button value="progress">
<span class="flex"> <span class="flex">
<IconifyIconOnline icon="ri:progress-6-line" class="mr-1" /> <IconifyIconOnline icon="ri:progress-6-line" class="mr-1" />
进行中 进行中
</span> </span>
</el-radio-button> </el-radio-button>
<el-radio-button label="complete"> <el-radio-button value="complete">
<span class="flex"> <span class="flex">
<IconifyIconOnline icon="ri:progress-8-line" class="mr-1" /> <IconifyIconOnline icon="ri:progress-8-line" class="mr-1" />
已完成 已完成
@@ -159,9 +159,9 @@ watch(size, val =>
:size="dynamicSize" :size="dynamicSize"
:disabled="size === 'disabled'" :disabled="size === 'disabled'"
> >
<el-checkbox-button label="apple">苹果</el-checkbox-button> <el-checkbox-button value="apple">苹果</el-checkbox-button>
<el-checkbox-button label="tomato">西红柿</el-checkbox-button> <el-checkbox-button value="tomato">西红柿</el-checkbox-button>
<el-checkbox-button label="banana">香蕉</el-checkbox-button> <el-checkbox-button value="banana">香蕉</el-checkbox-button>
</el-checkbox-group> </el-checkbox-group>
<el-divider /> <el-divider />
@@ -171,9 +171,9 @@ watch(size, val =>
:size="dynamicSize" :size="dynamicSize"
:disabled="size === 'disabled'" :disabled="size === 'disabled'"
> >
<el-checkbox label="cucumber" border>黄瓜</el-checkbox> <el-checkbox value="cucumber" border>黄瓜</el-checkbox>
<el-checkbox label="onion" border>洋葱</el-checkbox> <el-checkbox value="onion" border>洋葱</el-checkbox>
<el-checkbox label="blueberry" border>蓝莓</el-checkbox> <el-checkbox value="blueberry" border>蓝莓</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<el-divider /> <el-divider />
@@ -184,13 +184,13 @@ watch(size, val =>
:size="dynamicSize" :size="dynamicSize"
:disabled="size === 'disabled'" :disabled="size === 'disabled'"
> >
<el-checkbox-button label="tomato"> <el-checkbox-button value="tomato">
<span class="flex"> <span class="flex">
<IconifyIconOnline icon="streamline-emojis:tomato" class="mr-1" /> <IconifyIconOnline icon="streamline-emojis:tomato" class="mr-1" />
番茄 番茄
</span> </span>
</el-checkbox-button> </el-checkbox-button>
<el-checkbox-button label="watermelon"> <el-checkbox-button value="watermelon">
<span class="flex"> <span class="flex">
<IconifyIconOnline <IconifyIconOnline
icon="streamline-emojis:watermelon-1" icon="streamline-emojis:watermelon-1"
@@ -199,7 +199,7 @@ watch(size, val =>
西瓜 西瓜
</span> </span>
</el-checkbox-button> </el-checkbox-button>
<el-checkbox-button label="strawberry"> <el-checkbox-button value="strawberry">
<span class="flex"> <span class="flex">
<IconifyIconOnline <IconifyIconOnline
icon="streamline-emojis:strawberry-1" icon="streamline-emojis:strawberry-1"

View File

@@ -0,0 +1,82 @@
<script setup lang="ts">
import { ref, watch } from "vue";
// https://plus-pro-components.com/components/check-card-group.html
import { PlusCheckCardGroup } from "plus-pro-components";
import "plus-pro-components/es/components/check-card-group/style/css";
defineOptions({
name: "CheckCard"
});
const size = ref("default");
const dynamicSize = ref();
const list = ref("0");
const list1 = ref([]);
const options = [
{
title: "标题一",
value: "0",
description: "坚持梦想,成就不凡的自己",
avatar:
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
},
{
title: "标题二",
value: "1",
description: "每一次努力,都是成长的契机",
avatar:
"https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg"
}
];
watch(size, val =>
val === "disabled"
? (dynamicSize.value = "default")
: (dynamicSize.value = size.value)
);
</script>
<template>
<el-card shadow="never">
<template #header>
<div class="card-header">
<el-space wrap :size="40">
<el-link
v-tippy="{
content: '点击查看详细文档'
}"
href="https://plus-pro-components.com/components/check-card-group.html"
target="_blank"
style="font-size: 16px; font-weight: 800"
>
多选卡片组
</el-link>
<el-radio-group v-model="size" size="small">
<el-radio value="large">大尺寸</el-radio>
<el-radio value="default">默认尺寸</el-radio>
<el-radio value="small">小尺寸</el-radio>
<el-radio value="disabled">禁用</el-radio>
</el-radio-group>
</el-space>
</div>
</template>
<p class="mb-2 mt-4">单选</p>
<PlusCheckCardGroup
v-model="list"
:options="options"
:size="dynamicSize"
:disabled="size === 'disabled'"
/>
<p class="mb-2 mt-4">多选</p>
<PlusCheckCardGroup
v-model="list1"
:options="options"
:size="dynamicSize"
:disabled="size === 'disabled'"
multiple
/>
</el-card>
</template>

View File

@@ -45,8 +45,8 @@ const handleChange = (val: string[]) => {
<p class="mb-2">基础用法</p> <p class="mb-2">基础用法</p>
<el-radio-group v-model="radio" class="mb-3"> <el-radio-group v-model="radio" class="mb-3">
<el-radio label="">可同时展开多个面板</el-radio> <el-radio value="">可同时展开多个面板</el-radio>
<el-radio label="accordion">每次只能展开一个面板</el-radio> <el-radio value="accordion">每次只能展开一个面板</el-radio>
</el-radio-group> </el-radio-group>
<el-button size="small" text bg class="ml-8 mb-1" @click="onClick"> <el-button size="small" text bg class="ml-8 mb-1" @click="onClick">
外部触发打开、关闭 外部触发打开、关闭

View File

@@ -57,10 +57,10 @@ function onClick() {
颜色选择器 颜色选择器
</el-link> </el-link>
<el-radio-group v-model="size" size="small"> <el-radio-group v-model="size" size="small">
<el-radio label="large">大尺寸</el-radio> <el-radio value="large">大尺寸</el-radio>
<el-radio label="default">默认尺寸</el-radio> <el-radio value="default">默认尺寸</el-radio>
<el-radio label="small">小尺寸</el-radio> <el-radio value="small">小尺寸</el-radio>
<el-radio label="disabled">禁用</el-radio> <el-radio value="disabled">禁用</el-radio>
</el-radio-group> </el-radio-group>
</el-space> </el-space>
</div> </div>

View File

@@ -144,10 +144,10 @@ watch(size, val =>
日期选择器 日期选择器
</el-link> </el-link>
<el-radio-group v-model="size" size="small"> <el-radio-group v-model="size" size="small">
<el-radio label="large">大尺寸</el-radio> <el-radio value="large">大尺寸</el-radio>
<el-radio label="default">默认尺寸</el-radio> <el-radio value="default">默认尺寸</el-radio>
<el-radio label="small">小尺寸</el-radio> <el-radio value="small">小尺寸</el-radio>
<el-radio label="disabled">禁用</el-radio> <el-radio value="disabled">禁用</el-radio>
</el-radio-group> </el-radio-group>
</el-space> </el-space>
</div> </div>
@@ -245,9 +245,9 @@ watch(size, val =>
:disabled="size === 'disabled'" :disabled="size === 'disabled'"
@change="value7 = ''" @change="value7 = ''"
> >
<el-radio label="">Date</el-radio> <el-radio value="">Date</el-radio>
<el-radio label="YYYY-MM-DD">年月日</el-radio> <el-radio value="YYYY-MM-DD">年月日</el-radio>
<el-radio label="x">时间戳</el-radio> <el-radio value="x">时间戳</el-radio>
</el-radio-group> </el-radio-group>
<br /> <br />
<el-space wrap> <el-space wrap>

View File

@@ -170,10 +170,10 @@ watch(size, val =>
日期时间选择器 日期时间选择器
</el-link> </el-link>
<el-radio-group v-model="size" size="small"> <el-radio-group v-model="size" size="small">
<el-radio label="large">大尺寸</el-radio> <el-radio value="large">大尺寸</el-radio>
<el-radio label="default">默认尺寸</el-radio> <el-radio value="default">默认尺寸</el-radio>
<el-radio label="small">小尺寸</el-radio> <el-radio value="small">小尺寸</el-radio>
<el-radio label="disabled">禁用</el-radio> <el-radio value="disabled">禁用</el-radio>
</el-radio-group> </el-radio-group>
</el-space> </el-space>
</div> </div>
@@ -197,9 +197,9 @@ watch(size, val =>
:disabled="size === 'disabled'" :disabled="size === 'disabled'"
@change="value1 = ''" @change="value1 = ''"
> >
<el-radio label="">Date</el-radio> <el-radio value="">Date</el-radio>
<el-radio label="YYYY-MM-DD HH:mm:ss">年月日 时分秒</el-radio> <el-radio value="YYYY-MM-DD HH:mm:ss">年月日 时分秒</el-radio>
<el-radio label="x">时间戳</el-radio> <el-radio value="x">时间戳</el-radio>
</el-radio-group> </el-radio-group>
<br /> <br />
<el-space wrap> <el-space wrap>

View File

@@ -68,10 +68,10 @@ watch(size, val =>
Button 按钮 Button 按钮
</el-link> </el-link>
<el-radio-group v-model="size" size="small"> <el-radio-group v-model="size" size="small">
<el-radio label="large">大尺寸</el-radio> <el-radio value="large">大尺寸</el-radio>
<el-radio label="default">默认尺寸</el-radio> <el-radio value="default">默认尺寸</el-radio>
<el-radio label="small">小尺寸</el-radio> <el-radio value="small">小尺寸</el-radio>
<el-radio label="disabled">禁用</el-radio> <el-radio value="disabled">禁用</el-radio>
</el-radio-group> </el-radio-group>
</el-space> </el-space>
</div> </div>
@@ -79,13 +79,13 @@ watch(size, val =>
<p class="mb-2">基础按钮</p> <p class="mb-2">基础按钮</p>
<el-radio-group v-model="baseRadio" class="mb-3"> <el-radio-group v-model="baseRadio" class="mb-3">
<el-radio label="default" /> <el-radio label="default" value="default" />
<el-radio label="plain" /> <el-radio label="plain" value="plain" />
<el-radio label="round" /> <el-radio label="round" value="round" />
<el-radio label="circle" /> <el-radio label="circle" value="circle" />
<el-radio label="link" /> <el-radio label="link" value="link" />
<el-radio label="text" /> <el-radio label="text" value="text" />
<el-radio label="text-bg" /> <el-radio label="text-bg" value="text-bg" />
</el-radio-group> </el-radio-group>
<br /> <br />
<el-space wrap> <el-space wrap>

View File

@@ -86,7 +86,7 @@ const optionsIcon: Array<OptionsType> = [
}, },
{ {
label: "周三", label: "周三",
icon: "terminalWindowLine" icon: "ri:terminal-window-line"
}, },
{ {
label: "周四" label: "周四"
@@ -103,7 +103,7 @@ const optionsOnlyIcon: Array<OptionsType> = [
icon: HomeFilled icon: HomeFilled
}, },
{ {
icon: "terminalWindowLine" icon: "ri:terminal-window-line"
}, },
{ {
icon: "streamline-emojis:cow-face" icon: "streamline-emojis:cow-face"
@@ -131,7 +131,7 @@ const optionsLabel: Array<OptionsType> = [
{ {
label: () => ( label: () => (
<div> <div>
{h(useRenderIcon("terminalWindowLine"), { {h(useRenderIcon("ri:terminal-window-line"), {
class: "m-auto mt-1 w-[18px] h-[18px]" class: "m-auto mt-1 w-[18px] h-[18px]"
})} })}
<p>周二</p> <p>周二</p>

View File

@@ -79,9 +79,9 @@ const handleInputConfirm = () => {
Tag 标签 Tag 标签
</el-link> </el-link>
<el-radio-group v-model="size" size="small"> <el-radio-group v-model="size" size="small">
<el-radio label="large">大尺寸</el-radio> <el-radio value="large">大尺寸</el-radio>
<el-radio label="default">默认尺寸</el-radio> <el-radio value="default">默认尺寸</el-radio>
<el-radio label="small">小尺寸</el-radio> <el-radio value="small">小尺寸</el-radio>
</el-radio-group> </el-radio-group>
</el-space> </el-space>
</div> </div>
@@ -89,9 +89,9 @@ const handleInputConfirm = () => {
<p class="mb-2">基础按钮</p> <p class="mb-2">基础按钮</p>
<el-radio-group v-model="baseTag" class="mb-3"> <el-radio-group v-model="baseTag" class="mb-3">
<el-radio label="dark" /> <el-radio label="dark" value="dark" />
<el-radio label="light" /> <el-radio label="light" value="light" />
<el-radio label="plain" /> <el-radio label="plain" value="plain" />
</el-radio-group> </el-radio-group>
<br /> <br />
<el-space class="mb-3"> <el-space class="mb-3">

View File

@@ -69,10 +69,10 @@ const endTime = ref("");
时间选择器 时间选择器
</el-link> </el-link>
<el-radio-group v-model="size" size="small"> <el-radio-group v-model="size" size="small">
<el-radio label="large">大尺寸</el-radio> <el-radio value="large">大尺寸</el-radio>
<el-radio label="default">默认尺寸</el-radio> <el-radio value="default">默认尺寸</el-radio>
<el-radio label="small">小尺寸</el-radio> <el-radio value="small">小尺寸</el-radio>
<el-radio label="disabled">禁用</el-radio> <el-radio value="disabled">禁用</el-radio>
</el-radio-group> </el-radio-group>
</el-space> </el-space>
</div> </div>

View File

@@ -102,8 +102,8 @@ const rules = {
</el-form-item> </el-form-item>
<el-form-item label="产品状态" prop="status"> <el-form-item label="产品状态" prop="status">
<el-radio-group v-model="formData.status"> <el-radio-group v-model="formData.status">
<el-radio label="0">已停用</el-radio> <el-radio value="0">已停用</el-radio>
<el-radio label="1">已启用</el-radio> <el-radio value="1">已启用</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="产品描述" prop="description"> <el-form-item label="产品描述" prop="description">

View File

@@ -110,7 +110,7 @@ const handleManageProduct = product => {
<el-icon class="el-input__icon"> <el-icon class="el-input__icon">
<IconifyIconOffline <IconifyIconOffline
v-show="searchValue.length === 0" v-show="searchValue.length === 0"
icon="search" icon="ri:search-line"
/> />
</el-icon> </el-icon>
</template> </template>

View File

@@ -25,8 +25,8 @@ const columns: TableColumnList = [
<template> <template>
<div> <div>
<el-radio-group v-model="tableLayout"> <el-radio-group v-model="tableLayout">
<el-radio-button label="fixed" /> <el-radio-button label="fixed" value="fixed" />
<el-radio-button label="auto" /> <el-radio-button label="auto" value="auto" />
</el-radio-group> </el-radio-group>
<pure-table <pure-table

View File

@@ -23,36 +23,36 @@ const {
<el-space class="float-right mb-4"> <el-space class="float-right mb-4">
<p class="text-sm">多选</p> <p class="text-sm">多选</p>
<el-radio-group v-model="select" size="small"> <el-radio-group v-model="select" size="small">
<el-radio-button label="yes"></el-radio-button> <el-radio-button value="yes"></el-radio-button>
<el-radio-button label="no"></el-radio-button> <el-radio-button value="no"></el-radio-button>
</el-radio-group> </el-radio-group>
<el-divider direction="vertical" /> <el-divider direction="vertical" />
<p class="text-sm">动态列</p> <p class="text-sm">动态列</p>
<el-radio-group v-model="hideVal" size="small"> <el-radio-group v-model="hideVal" size="small">
<el-radio-button label="nohide">不隐藏</el-radio-button> <el-radio-button value="nohide">不隐藏</el-radio-button>
<el-radio-button label="hideDate">隐藏日期</el-radio-button> <el-radio-button value="hideDate">隐藏日期</el-radio-button>
<el-radio-button label="hideName">隐藏姓名</el-radio-button> <el-radio-button value="hideName">隐藏姓名</el-radio-button>
<el-radio-button label="hideAddress">隐藏地址</el-radio-button> <el-radio-button value="hideAddress">隐藏地址</el-radio-button>
</el-radio-group> </el-radio-group>
<el-divider direction="vertical" /> <el-divider direction="vertical" />
<p class="text-sm">表格大小</p> <p class="text-sm">表格大小</p>
<el-radio-group v-model="tableSize" size="small"> <el-radio-group v-model="tableSize" size="small">
<el-radio-button label="large">large</el-radio-button> <el-radio-button value="large">large</el-radio-button>
<el-radio-button label="default">default</el-radio-button> <el-radio-button value="default">default</el-radio-button>
<el-radio-button label="small">small</el-radio-button> <el-radio-button value="small">small</el-radio-button>
</el-radio-group> </el-radio-group>
<el-divider direction="vertical" /> <el-divider direction="vertical" />
<p class="text-sm">分页大小</p> <p class="text-sm">分页大小</p>
<el-radio-group v-model="paginationSmall" size="small" @change="onChange"> <el-radio-group v-model="paginationSmall" size="small" @change="onChange">
<el-radio-button :label="false">no small</el-radio-button> <el-radio-button :value="false">no small</el-radio-button>
<el-radio-button :label="true">small</el-radio-button> <el-radio-button :value="true">small</el-radio-button>
</el-radio-group> </el-radio-group>
<el-divider direction="vertical" /> <el-divider direction="vertical" />
<p class="text-sm">分页的对齐方式</p> <p class="text-sm">分页的对齐方式</p>
<el-radio-group v-model="paginationAlign" size="small"> <el-radio-group v-model="paginationAlign" size="small">
<el-radio-button label="right">right</el-radio-button> <el-radio-button value="right">right</el-radio-button>
<el-radio-button label="center">center</el-radio-button> <el-radio-button value="center">center</el-radio-button>
<el-radio-button label="left">left</el-radio-button> <el-radio-button value="left">left</el-radio-button>
</el-radio-group> </el-radio-group>
</el-space> </el-space>

View File

@@ -9,8 +9,8 @@ const model = ref("radio");
<template> <template>
<el-space> <el-space>
<el-radio-group v-model="model"> <el-radio-group v-model="model">
<el-radio-button label="radio">单选</el-radio-button> <el-radio-button value="radio">单选</el-radio-button>
<el-radio-button label="multiple">多选</el-radio-button> <el-radio-button value="multiple">多选</el-radio-button>
</el-radio-group> </el-radio-group>
<el-divider direction="vertical" /> <el-divider direction="vertical" />
<component <component

View File

@@ -91,7 +91,7 @@ const {
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
/> />
<el-button <el-button
class="absolute bottom-[17px]" class="absolute bottom-[25px] left-[20px]"
type="primary" type="primary"
size="small" size="small"
text text

View File

@@ -58,7 +58,7 @@ const {
<el-form-item> <el-form-item>
<el-button <el-button
type="primary" type="primary"
:icon="useRenderIcon('search')" :icon="useRenderIcon('ri:search-line')"
:loading="loading" :loading="loading"
@click="onSearch" @click="onSearch"
> >

View File

@@ -48,7 +48,7 @@ const {
<el-form-item> <el-form-item>
<el-button <el-button
type="primary" type="primary"
:icon="useRenderIcon('search')" :icon="useRenderIcon('ri:search-line')"
:loading="loading" :loading="loading"
@click="onSearch" @click="onSearch"
> >

View File

@@ -74,7 +74,7 @@ const {
<el-form-item> <el-form-item>
<el-button <el-button
type="primary" type="primary"
:icon="useRenderIcon('search')" :icon="useRenderIcon('ri:search-line')"
:loading="loading" :loading="loading"
@click="onSearch" @click="onSearch"
> >

View File

@@ -95,7 +95,7 @@ const {
<el-form-item> <el-form-item>
<el-button <el-button
type="primary" type="primary"
:icon="useRenderIcon('search')" :icon="useRenderIcon('ri:search-line')"
:loading="loading" :loading="loading"
@click="onSearch" @click="onSearch"
> >

View File

@@ -110,7 +110,7 @@ defineExpose({ onTreeReset });
<el-icon class="el-input__icon"> <el-icon class="el-input__icon">
<IconifyIconOffline <IconifyIconOffline
v-show="searchValue.length === 0" v-show="searchValue.length === 0"
icon="search" icon="ri:search-line"
/> />
</el-icon> </el-icon>
</template> </template>

View File

@@ -36,7 +36,7 @@ const { loading, columns, dataList, pagination, Empty, onCurrentChange } =
circle circle
size="small" size="small"
:title="`查看序号为${row.id}的详情`" :title="`查看序号为${row.id}的详情`"
:icon="useRenderIcon('search')" :icon="useRenderIcon('ri:search-line')"
/> />
</template> </template>
</pure-table> </pure-table>

2
types/global.d.ts vendored
View File

@@ -96,6 +96,7 @@ declare global {
CachingAsyncRoutes?: boolean; CachingAsyncRoutes?: boolean;
TooltipEffect?: Effect; TooltipEffect?: Effect;
ResponsiveStorageNameSpace?: string; ResponsiveStorageNameSpace?: string;
MenuSearchHistory?: number;
MapConfigure?: { MapConfigure?: {
amapKey?: string; amapKey?: string;
options: { options: {
@@ -131,6 +132,7 @@ declare global {
overallStyle?: string; overallStyle?: string;
showLogo?: boolean; showLogo?: boolean;
showModel?: string; showModel?: string;
menuSearchHistory?: number;
mapConfigure?: { mapConfigure?: {
amapKey?: string; amapKey?: string;
options: { options: {