From 5a00171c9abbf89288b39969a6e3aec65c308546 Mon Sep 17 00:00:00 2001 From: lt5227 <995362096@qq.com> Date: Mon, 9 Dec 2024 14:36:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=8F=B3=E9=94=AE=E8=87=AA=E5=AE=9A=E4=B9=89=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E8=BF=9B=E8=A1=8C=E8=8A=82=E7=82=B9=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=9A=84=E6=A0=91=E5=BD=A2=E7=BB=84=E4=BB=B6.=20#569?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 13 +- mock/role/index.mock.ts | 8 + src/components/Tree/index.ts | 3 + src/components/Tree/src/Tree.vue | 147 ++++++++++++++++++ src/locales/en.ts | 8 +- src/locales/zh-CN.ts | 7 +- src/views/Components/Tree.vue | 252 +++++++++++++++++++++++++++++++ 7 files changed, 435 insertions(+), 3 deletions(-) create mode 100644 src/components/Tree/index.ts create mode 100644 src/components/Tree/src/Tree.vue create mode 100644 src/views/Components/Tree.vue diff --git a/.vscode/settings.json b/.vscode/settings.json index c6be8a8..1166e6a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,5 +15,16 @@ "i18n-ally.sourceLanguage": "en", "i18n-ally.displayLanguage": "zh-CN", "i18n-ally.enabledFrameworks": ["vue", "react"], - "god.tsconfig": "./tsconfig.json" + "god.tsconfig": "./tsconfig.json", + "editor.gotoLocation.alternativeDeclarationCommand": "editor.action.revealDefinition", + "editor.gotoLocation.alternativeDefinitionCommand": "editor.action.revealDefinition", + "editor.gotoLocation.alternativeTypeDefinitionCommand": "editor.action.revealDefinition", + "editor.selectionHighlight": false, + "files.autoSave": "onFocusChange", + "editor.suggest.snippetsPreventQuickSuggestions": false, + "editor.quickSuggestions": { + "other": "on", + "comments": "off", + "strings": "on" + } } diff --git a/mock/role/index.mock.ts b/mock/role/index.mock.ts index a0ec69c..910b2cc 100644 --- a/mock/role/index.mock.ts +++ b/mock/role/index.mock.ts @@ -348,6 +348,14 @@ const adminList = [ meta: { title: 'router.iAgree' } + }, + { + path: 'tree', + component: 'views/Components/Tree', + name: 'Tree', + meta: { + title: 'router.tree' + } } ] }, diff --git a/src/components/Tree/index.ts b/src/components/Tree/index.ts new file mode 100644 index 0000000..bee5f92 --- /dev/null +++ b/src/components/Tree/index.ts @@ -0,0 +1,3 @@ +import Tree from './src/Tree.vue' + +export { Tree } diff --git a/src/components/Tree/src/Tree.vue b/src/components/Tree/src/Tree.vue new file mode 100644 index 0000000..66597d1 --- /dev/null +++ b/src/components/Tree/src/Tree.vue @@ -0,0 +1,147 @@ + + + diff --git a/src/locales/en.ts b/src/locales/en.ts index f26eb8f..04e4e42 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -190,7 +190,8 @@ export default { personalCenter: 'Personal center', personal: 'Personal', avatars: 'Avatars', - iAgree: 'I agree' + iAgree: 'I agree', + tree: 'Tree' }, permission: { hasPermission: 'Please set the operation permission value' @@ -393,6 +394,11 @@ export default { logoStyle: 'Logo style', size: 'size config' }, + treeDemo: { + treeTitle: 'Tree control (right-click node to customize menu options)', + message: + 'The tree component is based on the secondary packaging of the tree component of ElementPlus' + }, highlightDemo: { highlight: 'Highlight', message: 'The best time to plant a tree is ten years ago, followed by now.', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 8f38c0a..fe74dfb 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -186,7 +186,8 @@ export default { personalCenter: '个人中心', personal: '个人', avatars: '头像列表', - iAgree: '我同意' + iAgree: '我同意', + tree: 'Tree 树形控件' }, permission: { hasPermission: '请设置操作权限值' @@ -385,6 +386,10 @@ export default { logoStyle: 'logo样式', size: '大小配置' }, + treeDemo: { + treeTitle: '树形控件(节点右键可自定义菜单选项)', + message: '基于 ElementPlus 的 Tree 组件二次封装' + }, highlightDemo: { highlight: '高亮', message: '种一棵树最好的时间是十年前,其次就是现在。', diff --git a/src/views/Components/Tree.vue b/src/views/Components/Tree.vue new file mode 100644 index 0000000..661732e --- /dev/null +++ b/src/views/Components/Tree.vue @@ -0,0 +1,252 @@ + + + + From 0735371c637964bd328073c2c0150edf14d53b3a Mon Sep 17 00:00:00 2001 From: lt5227 <995362096@qq.com> Date: Mon, 9 Dec 2024 14:39:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=8F=B3=E9=94=AE=E8=87=AA=E5=AE=9A=E4=B9=89=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E8=BF=9B=E8=A1=8C=E8=8A=82=E7=82=B9=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=9A=84=E6=A0=91=E5=BD=A2=E7=BB=84=E4=BB=B6.=20#569?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 1166e6a..c6be8a8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,16 +15,5 @@ "i18n-ally.sourceLanguage": "en", "i18n-ally.displayLanguage": "zh-CN", "i18n-ally.enabledFrameworks": ["vue", "react"], - "god.tsconfig": "./tsconfig.json", - "editor.gotoLocation.alternativeDeclarationCommand": "editor.action.revealDefinition", - "editor.gotoLocation.alternativeDefinitionCommand": "editor.action.revealDefinition", - "editor.gotoLocation.alternativeTypeDefinitionCommand": "editor.action.revealDefinition", - "editor.selectionHighlight": false, - "files.autoSave": "onFocusChange", - "editor.suggest.snippetsPreventQuickSuggestions": false, - "editor.quickSuggestions": { - "other": "on", - "comments": "off", - "strings": "on" - } + "god.tsconfig": "./tsconfig.json" }