From ff83d333a5b022281fb96458f1b928b06c508d0c Mon Sep 17 00:00:00 2001 From: Zheng-Changfu Date: Fri, 16 May 2025 13:06:59 +0800 Subject: [PATCH] feat(projects): add example for pro-naive-ui. --- build/plugins/router.ts | 1 + build/plugins/unplugin.ts | 2 + package.json | 2 + pnpm-lock.yaml | 111 +++++++++++ src/locales/langs/en-us.ts | 85 +++++++++ src/locales/langs/zh-cn.ts | 85 +++++++++ src/main.ts | 11 +- src/plugins/components.ts | 10 + src/plugins/index.ts | 1 + src/router/elegant/imports.ts | 5 + src/router/elegant/routes.ts | 80 ++++++++ src/router/elegant/transform.ts | 9 + src/router/routes/index.ts | 14 ++ src/typings/app.d.ts | 76 ++++++++ src/typings/components.d.ts | 12 ++ src/typings/elegant-router.d.ts | 17 ++ src/views/pro-naive/ConfigProvider.vue | 17 ++ src/views/pro-naive/form/basic/index.vue | 184 +++++++++++++++++++ src/views/pro-naive/form/query/index.vue | 99 ++++++++++ src/views/pro-naive/form/step/index.vue | 72 ++++++++ src/views/pro-naive/table/remote/index.vue | 142 ++++++++++++++ src/views/pro-naive/table/row-edit/index.vue | 138 ++++++++++++++ 22 files changed, 1172 insertions(+), 1 deletion(-) create mode 100644 src/plugins/components.ts create mode 100644 src/views/pro-naive/ConfigProvider.vue create mode 100644 src/views/pro-naive/form/basic/index.vue create mode 100644 src/views/pro-naive/form/query/index.vue create mode 100644 src/views/pro-naive/form/step/index.vue create mode 100644 src/views/pro-naive/table/remote/index.vue create mode 100644 src/views/pro-naive/table/row-edit/index.vue diff --git a/build/plugins/router.ts b/build/plugins/router.ts index 65460f92..c63e8dfb 100644 --- a/build/plugins/router.ts +++ b/build/plugins/router.ts @@ -19,6 +19,7 @@ export function setupElegantRouter() { 'document_vite', 'document_unocss', 'document_naive', + 'document_pro-naive', 'document_antd', 'document_alova' ] diff --git a/build/plugins/unplugin.ts b/build/plugins/unplugin.ts index 2055c4f5..71e23df3 100644 --- a/build/plugins/unplugin.ts +++ b/build/plugins/unplugin.ts @@ -6,6 +6,7 @@ import Icons from 'unplugin-icons/vite'; import IconsResolver from 'unplugin-icons/resolver'; import Components from 'unplugin-vue-components/vite'; import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'; +import { ProNaiveUIResolver } from 'pro-naive-ui-resolver'; import { FileSystemIconLoader } from 'unplugin-icons/loaders'; export function setupUnplugin(viteEnv: Env.ImportMeta) { @@ -32,6 +33,7 @@ export function setupUnplugin(viteEnv: Env.ImportMeta) { types: [{ from: 'vue-router', names: ['RouterLink', 'RouterView'] }], resolvers: [ NaiveUiResolver(), + ProNaiveUIResolver(), IconsResolver({ customCollections: [collectionName], componentPrefix: VITE_ICON_PREFIX }) ] }), diff --git a/package.json b/package.json index 35b201e1..6fe761e4 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "pinia": "3.0.1", "pinyin-pro": "3.26.0", "print-js": "1.6.0", + "pro-naive-ui": "^2.1.2", "swiper": "11.2.5", "tailwind-merge": "3.0.2", "typeit": "8.8.7", @@ -114,6 +115,7 @@ "eslint-plugin-vue": "10.0.0", "kolorist": "1.8.0", "lint-staged": "15.5.0", + "pro-naive-ui-resolver": "^1.0.2", "sass": "1.86.0", "simple-git-hooks": "2.11.1", "tsx": "4.19.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c4554614..0b13c08b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,6 +101,9 @@ importers: print-js: specifier: 1.6.0 version: 1.6.0 + pro-naive-ui: + specifier: ^2.1.2 + version: 2.1.2(naive-ui@2.41.0(vue@3.5.13(typescript@5.8.2)))(vue@3.5.13(typescript@5.8.2)) swiper: specifier: 11.2.5 version: 11.2.5 @@ -204,6 +207,9 @@ importers: lint-staged: specifier: 15.5.0 version: 15.5.0 + pro-naive-ui-resolver: + specifier: ^1.0.2 + version: 1.0.2 sass: specifier: 1.86.0 version: 1.86.0 @@ -1521,6 +1527,9 @@ packages: '@types/web-animations-js@2.2.16': resolution: {integrity: sha512-ATELeWMFwj8eQiH0KmvsCl1V2lu/qx/CjOBmv4ADSZS5u8r4reMyjCXtxG7khqyiwH3IOMNdrON/Ugn94OUcRA==} + '@types/web-bluetooth@0.0.20': + resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} + '@types/web-bluetooth@0.0.21': resolution: {integrity: sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==} @@ -1619,6 +1628,9 @@ packages: peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0 + '@vicons/antd@0.13.0': + resolution: {integrity: sha512-yrUGoUSz2BbGupk9ghQOahc04n5H3MwUDM9pVPsLh9U1uqB47oRWZvYRiZaT1JKPqgTgSE6BXcVw4i9MOF4M+g==} + '@visactor/vchart-theme@1.12.2': resolution: {integrity: sha512-r298TUdK+CKbHGVYWgQnNSEB5uqpFvF2/aMNZ/2POQnd2CovAPJOx2nTE6hAcOn8rra2FwJ2xF8AyP1O5OhrTw==} peerDependencies: @@ -1809,14 +1821,23 @@ packages: peerDependencies: vue: ^3.5.0 + '@vueuse/core@11.3.0': + resolution: {integrity: sha512-7OC4Rl1f9G8IT6rUfi9JrKiXy4bfmHhZ5x2Ceojy0jnd3mHNEvV4JaRygH362ror6/NZ+Nl+n13LPzGiPN8cKA==} + '@vueuse/core@13.0.0': resolution: {integrity: sha512-rkgb4a8/0b234lMGCT29WkCjPfsX0oxrIRR7FDndRoW3FsaC9NBzefXg/9TLhAgwM11f49XnutshM4LzJBrQ5g==} peerDependencies: vue: ^3.5.0 + '@vueuse/metadata@11.3.0': + resolution: {integrity: sha512-pwDnDspTqtTo2HwfLw4Rp6yywuuBdYnPYDq+mO38ZYKGebCUQC/nVj/PXSiK9HX5otxLz8Fn7ECPbjiRz2CC3g==} + '@vueuse/metadata@13.0.0': resolution: {integrity: sha512-TRNksqmvtvqsuHf7bbgH9OSXEV2b6+M3BSN4LR5oxWKykOFT9gV78+C2/0++Pq9KCp9KQ1OQDPvGlWNQpOb2Mw==} + '@vueuse/shared@11.3.0': + resolution: {integrity: sha512-P8gSSWQeucH5821ek2mn/ciCk+MS/zoRKqdQIM3bHq6p7GXDAJLmnRRKmF5F65sAVJIfzQlwR3aDzwCn10s8hA==} + '@vueuse/shared@13.0.0': resolution: {integrity: sha512-9MiHhAPw+sqCF/RLo8V6HsjRqEdNEWVpDLm2WBRW2G/kSQjb8X901sozXpSCaeLG0f7TEfMrT4XNaA5m1ez7Dg==} peerDependencies: @@ -4442,6 +4463,22 @@ packages: print-js@1.6.0: resolution: {integrity: sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg==} + pro-composables@3.3.0: + resolution: {integrity: sha512-lsd14qzKVI7FxsNgm06TMKhjKtgkbp0DEI1W2maHnQOinWXuNBnwh2NyKMBOCDJnRzlOW4QSSrt/YdIfjh01FQ==} + peerDependencies: + vue: '>= 3.3.0' + + pro-naive-ui-resolver@1.0.2: + resolution: {integrity: sha512-CEPDm2B4RSIxtVWdN+mlXNs8rQ4EQi5mp2x4ZTLgVhcvvC3v0NwxqHtjjR+swqGcBbKJ0ZN4/UlkxRIgd3+AdA==} + engines: {node: '>=18.12.0'} + + pro-naive-ui@2.1.2: + resolution: {integrity: sha512-Ec9t2D9TNNp1ghPEsq5zMqZfgwyepbcyECapyrvIuL13DRcBoFF0HBZGFOZWa3jZ+qkYuntJWBAuCUQNqe9vyw==} + engines: {node: '>=18.12.0'} + peerDependencies: + naive-ui: ^2.38.2 + vue: '>= 3.3.0' + progress@2.0.3: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} engines: {node: '>=0.4.0'} @@ -4785,6 +4822,9 @@ packages: resolution: {integrity: sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==} engines: {node: '>=0.10.0'} + sortablejs@1.15.6: + resolution: {integrity: sha512-aNfiuwMEpfBM/CN6LY0ibyhxPfPbyFeBTYJKCvzkJ2GkUpazIt3H+QIPAMHwqQ7tMKaHz1Qj+rJJCqljnf4p3A==} + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -5336,6 +5376,17 @@ packages: '@vue/composition-api': optional: true + vue-demi@0.14.10: + resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} + engines: {node: '>=12'} + hasBin: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + vue-draggable-plus@0.6.0: resolution: {integrity: sha512-G5TSfHrt9tX9EjdG49InoFJbt2NYk0h3kgjgKxkFWr3ulIUays0oFObr5KZ8qzD4+QnhtALiRwIqY6qul4egqw==} peerDependencies: @@ -6731,6 +6782,8 @@ snapshots: '@types/web-animations-js@2.2.16': {} + '@types/web-bluetooth@0.0.20': {} + '@types/web-bluetooth@0.0.21': {} '@typescript-eslint/eslint-plugin@8.26.1(@typescript-eslint/parser@8.26.1(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2))(eslint@9.22.0(jiti@2.4.2))(typescript@5.8.2)': @@ -6907,6 +6960,7 @@ snapshots: transitivePeerDependencies: - vue + '@vicons/antd@0.13.0': {} '@visactor/vchart-theme@1.12.2(@visactor/vchart@1.13.7)': dependencies: '@visactor/vchart': 1.13.7 @@ -7305,6 +7359,16 @@ snapshots: '@vueuse/shared': 13.0.0(vue@3.5.13(typescript@5.8.2)) vue: 3.5.13(typescript@5.8.2) + '@vueuse/core@11.3.0(vue@3.5.13(typescript@5.8.2))': + dependencies: + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 11.3.0 + '@vueuse/shared': 11.3.0(vue@3.5.13(typescript@5.8.2)) + vue-demi: 0.14.10(vue@3.5.13(typescript@5.8.2)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + '@vueuse/core@13.0.0(vue@3.5.13(typescript@5.8.2))': dependencies: '@types/web-bluetooth': 0.0.21 @@ -7312,8 +7376,17 @@ snapshots: '@vueuse/shared': 13.0.0(vue@3.5.13(typescript@5.8.2)) vue: 3.5.13(typescript@5.8.2) + '@vueuse/metadata@11.3.0': {} + '@vueuse/metadata@13.0.0': {} + '@vueuse/shared@11.3.0(vue@3.5.13(typescript@5.8.2))': + dependencies: + vue-demi: 0.14.10(vue@3.5.13(typescript@5.8.2)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + '@vueuse/shared@13.0.0(vue@3.5.13(typescript@5.8.2))': dependencies: vue: 3.5.13(typescript@5.8.2) @@ -10207,6 +10280,38 @@ snapshots: print-js@1.6.0: {} + pro-composables@3.3.0(vue@3.5.13(typescript@5.8.2)): + dependencies: + '@types/lodash-es': 4.17.12 + '@vueuse/core': 11.3.0(vue@3.5.13(typescript@5.8.2)) + lodash-es: 4.17.21 + type-fest: 4.37.0 + vue: 3.5.13(typescript@5.8.2) + transitivePeerDependencies: + - '@vue/composition-api' + + pro-naive-ui-resolver@1.0.2: {} + + pro-naive-ui@2.1.2(naive-ui@2.41.0(vue@3.5.13(typescript@5.8.2)))(vue@3.5.13(typescript@5.8.2)): + dependencies: + '@css-render/plugin-bem': 0.15.14(css-render@0.15.14) + '@css-render/vue3-ssr': 0.15.14(vue@3.5.13(typescript@5.8.2)) + '@types/lodash-es': 4.17.12 + '@types/sortablejs': 1.15.8 + '@vicons/antd': 0.13.0 + '@vueuse/core': 11.3.0(vue@3.5.13(typescript@5.8.2)) + css-render: 0.15.14 + date-fns: 3.6.0 + lodash-es: 4.17.21 + naive-ui: 2.41.0(vue@3.5.13(typescript@5.8.2)) + pro-composables: 3.3.0(vue@3.5.13(typescript@5.8.2)) + sortablejs: 1.15.6 + type-fest: 4.37.0 + vooks: 0.2.12(vue@3.5.13(typescript@5.8.2)) + vue: 3.5.13(typescript@5.8.2) + transitivePeerDependencies: + - '@vue/composition-api' + progress@2.0.3: {} prompts@2.4.2: @@ -10622,6 +10727,8 @@ snapshots: transitivePeerDependencies: - supports-color + sortablejs@1.15.6: {} + source-map-js@1.2.1: {} source-map-resolve@0.5.3: @@ -11222,6 +11329,10 @@ snapshots: dependencies: vue: 3.5.13(typescript@5.8.2) + vue-demi@0.14.10(vue@3.5.13(typescript@5.8.2)): + dependencies: + vue: 3.5.13(typescript@5.8.2) + vue-draggable-plus@0.6.0(@types/sortablejs@1.15.8): dependencies: '@types/sortablejs': 1.15.8 diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 2444ddb9..8e3eb7f6 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -170,6 +170,7 @@ const local: App.I18n.Schema = { document_vite: 'Vite Document', document_unocss: 'UnoCSS Document', document_naive: 'Naive UI Document', + 'document_pro-naive': 'Pro Naive UI Document', document_antd: 'Ant Design Vue Document', document_alova: 'Alova Document', 'user-center': 'User Center', @@ -179,6 +180,14 @@ const local: App.I18n.Schema = { alova_request: 'Alova Request', alova_user: 'User List', alova_scenes: 'Scenario Request', + 'pro-naive': 'Pro Naive Example', + 'pro-naive_form': 'Form', + 'pro-naive_form_basic': 'Basic Form', + 'pro-naive_form_query': 'Query Form', + 'pro-naive_form_step': 'Step Form', + 'pro-naive_table': 'Table', + 'pro-naive_table_remote': 'Remote', + 'pro-naive_table_row-edit': 'Row Edit', function_tab: 'Tab', 'function_multi-tab': 'Multi Tab', 'function_hide-child': 'Hide Child', @@ -370,6 +379,82 @@ const local: App.I18n.Schema = { triggerAllRequest: 'Manually Trigger All Automated Requests' } }, + proNaive: { + form: { + basic: { + title: 'Basic Example', + appName: 'ApplicationName', + appStatus: 'ApplicationStatus', + createTime: 'CreateTime', + responseDate: 'ResponseDate', + specificationInfo: 'SpecificationInfo', + specificate: 'Specificate', + specificationName: 'SpecificationName', + specificationValue: 'SpecificationValue', + specificationColorRed: 'Red', + specificationColorOrange: 'Orange', + addSpecificateItem: 'Add Specificate Item', + fillValue: 'FillValue', + reset: 'Reset', + submit: 'Submit', + add: 'Add', + delete: 'Delete', + color: 'Color', + normal: 'Normal', + anomaly: 'Anomaly' + }, + query: { + title1: 'Query Example, which expands by default', + title2: 'Query Example, which fold by default, and two lines are retained when folding', + appName: 'ApplicationName', + appStatus: 'ApplicationStatus', + createTime: 'CreateTime', + responseDate: 'ResponseDate', + endDate: 'EndDate', + field: 'Field' + }, + step: { + title: 'Step Form', + step1: { + title: 'Form 1', + field: 'Form 1 field', + nextStep: 'Next Step' + }, + step2: { + title: 'Form 2', + field: 'Form 2 field', + prevStep: 'Prev Step', + submit: 'Submit' + } + } + }, + table: { + remote: { + filterCondition: 'Filter Condition', + name: 'Name', + createTime: 'CreateTime', + responseTime: 'ResponseTime', + title: 'Remote Loading', + replicableText: 'Replicable Text', + tags: 'Tags', + dateFormatting: 'Date Formatting', + image: 'Image' + }, + rowEdit: { + title: 'Edit Table', + reset: 'Reset', + submit: 'Submit', + edit: 'Edit', + delete: 'Delete', + save: 'Save', + task: 'Task', + score: 'Score', + time: 'Time', + name: 'Name', + action: 'Action' + } + } + }, manage: { common: { status: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index ffce4039..318c88e2 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -170,6 +170,7 @@ const local: App.I18n.Schema = { document_vite: 'Vite文档', document_unocss: 'UnoCSS文档', document_naive: 'Naive UI文档', + 'document_pro-naive': 'Pro Naive UI文档', document_antd: 'Ant Design Vue文档', document_alova: 'Alova文档', 'user-center': '个人中心', @@ -179,6 +180,14 @@ const local: App.I18n.Schema = { alova_request: 'alova请求', alova_user: '用户列表', alova_scenes: '场景化请求', + 'pro-naive': 'Pro Naive UI 示例', + 'pro-naive_form': '表单', + 'pro-naive_form_basic': '基础表单', + 'pro-naive_form_query': '查询表单', + 'pro-naive_form_step': '分步表单', + 'pro-naive_table': '表格', + 'pro-naive_table_remote': '远程加载', + 'pro-naive_table_row-edit': '行编辑', function_tab: '标签页', 'function_multi-tab': '多标签页', 'function_hide-child': '隐藏子菜单', @@ -370,6 +379,82 @@ const local: App.I18n.Schema = { triggerAllRequest: '手动触发所有自动请求' } }, + proNaive: { + form: { + basic: { + title: '基础示例', + appName: '应用名称', + appStatus: '应用状态', + createTime: '创建时间', + responseDate: '响应日期', + specificationInfo: '规格信息', + specificate: '规格', + specificationName: '规格名', + specificationValue: '规格值', + specificationColorRed: '红', + specificationColorOrange: '橙', + addSpecificateItem: '添加规格项', + fillValue: '填充值', + reset: '重置', + submit: '提交', + add: '新建', + delete: '删除', + color: '颜色', + normal: '正常', + anomaly: '异常' + }, + query: { + title1: '查询表单,默认展开', + title2: '查询表单,默认折叠,折叠时保留2行', + appName: '应用名称', + appStatus: '应用状态', + createTime: '创建时间', + responseDate: '响应日期', + endDate: '结束日期', + field: '字段' + }, + step: { + title: '分步表单', + step1: { + title: '表单1', + field: '表单1字段', + nextStep: '下一步' + }, + step2: { + title: '表单2', + field: '表单2字段', + prevStep: '上一步', + submit: '提交' + } + } + }, + table: { + remote: { + filterCondition: '筛选条件', + name: '名称', + createTime: '创建时间', + responseTime: '响应时间', + title: '远程加载', + replicableText: '可复制文本', + tags: 'tags', + dateFormatting: '日期格式化', + image: '图片' + }, + rowEdit: { + title: '编辑表格', + reset: '重置', + submit: '提交', + edit: '编辑', + delete: '删除', + save: '保存', + task: '任务', + score: '评分', + time: '时间', + name: '名称', + action: '操作' + } + } + }, manage: { common: { status: { diff --git a/src/main.ts b/src/main.ts index b97a0d93..5d207075 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,13 @@ import { createApp } from 'vue'; import './plugins/assets'; -import { setupAppVersionNotification, setupDayjs, setupIconifyOffline, setupLoading, setupNProgress } from './plugins'; +import { + setupAppVersionNotification, + setupDayjs, + setupIconifyOffline, + setupLoading, + setupNProgress, + setupProNaiveComponents +} from './plugins'; import { setupStore } from './store'; import { setupRouter } from './router'; import { setupI18n } from './locales'; @@ -21,6 +28,8 @@ async function setupApp() { await setupRouter(app); + setupProNaiveComponents(app); + setupI18n(app); setupAppVersionNotification(); diff --git a/src/plugins/components.ts b/src/plugins/components.ts new file mode 100644 index 00000000..f0c2b134 --- /dev/null +++ b/src/plugins/components.ts @@ -0,0 +1,10 @@ +import type { App } from 'vue'; +import { ProDate, ProDateTime, ProInput, ProRate, create } from 'pro-naive-ui'; + +/** pro-naive-ui 支持配置表单的按需加载,所以需要注册 */ +export function setupProNaiveComponents(app: App) { + const proNaive = create({ + components: [ProInput, ProDate, ProDateTime, ProRate] + }); + app.use(proNaive); +} diff --git a/src/plugins/index.ts b/src/plugins/index.ts index b2c9f9b5..3f5a0014 100644 --- a/src/plugins/index.ts +++ b/src/plugins/index.ts @@ -1,5 +1,6 @@ export * from './loading'; export * from './nprogress'; +export * from './components'; export * from './iconify'; export * from './dayjs'; export * from './app'; diff --git a/src/router/elegant/imports.ts b/src/router/elegant/imports.ts index 27bc8c48..1fa448d2 100644 --- a/src/router/elegant/imports.ts +++ b/src/router/elegant/imports.ts @@ -58,5 +58,10 @@ export const views: Record Promise import("@/views/plugin/tables/vtable/index.vue"), plugin_typeit: () => import("@/views/plugin/typeit/index.vue"), plugin_video: () => import("@/views/plugin/video/index.vue"), + "pro-naive_form_basic": () => import("@/views/pro-naive/form/basic/index.vue"), + "pro-naive_form_query": () => import("@/views/pro-naive/form/query/index.vue"), + "pro-naive_form_step": () => import("@/views/pro-naive/form/step/index.vue"), + "pro-naive_table_remote": () => import("@/views/pro-naive/table/remote/index.vue"), + "pro-naive_table_row-edit": () => import("@/views/pro-naive/table/row-edit/index.vue"), "user-center": () => import("@/views/user-center/index.vue"), }; diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index 3dc302a7..302cc7c6 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -622,6 +622,86 @@ export const generatedRoutes: GeneratedRoute[] = [ } ] }, + { + name: 'pro-naive', + path: '/pro-naive', + component: 'layout.base', + meta: { + title: 'pro-naive', + i18nKey: 'route.pro-naive', + order: 7, + icon: 'material-symbols-light:demography-outline-rounded' + }, + children: [ + { + name: 'pro-naive_form', + path: '/pro-naive/form', + meta: { + title: 'pro-naive_form', + i18nKey: 'route.pro-naive_form', + icon: 'fluent:form-28-regular' + }, + children: [ + { + name: 'pro-naive_form_basic', + path: '/pro-naive/form/basic', + component: 'view.pro-naive_form_basic', + meta: { + title: 'pro-naive_form_basic', + i18nKey: 'route.pro-naive_form_basic' + } + }, + { + name: 'pro-naive_form_query', + path: '/pro-naive/form/query', + component: 'view.pro-naive_form_query', + meta: { + title: 'pro-naive_form_query', + i18nKey: 'route.pro-naive_form_query' + } + }, + { + name: 'pro-naive_form_step', + path: '/pro-naive/form/step', + component: 'view.pro-naive_form_step', + meta: { + title: 'pro-naive_form_step', + i18nKey: 'route.pro-naive_form_step' + } + } + ] + }, + { + name: 'pro-naive_table', + path: '/pro-naive/table', + meta: { + title: 'pro-naive_table', + i18nKey: 'route.pro-naive_table', + icon: 'mynaui:table' + }, + children: [ + { + name: 'pro-naive_table_remote', + path: '/pro-naive/table/remote', + component: 'view.pro-naive_table_remote', + meta: { + title: 'pro-naive_table_remote', + i18nKey: 'route.pro-naive_table_remote' + } + }, + { + name: 'pro-naive_table_row-edit', + path: '/pro-naive/table/row-edit', + component: 'view.pro-naive_table_row-edit', + meta: { + title: 'pro-naive_table_row-edit', + i18nKey: 'route.pro-naive_table_row-edit' + } + } + ] + } + ] + }, { name: 'user-center', path: '/user-center', diff --git a/src/router/elegant/transform.ts b/src/router/elegant/transform.ts index ed5a79c4..fdf087e8 100644 --- a/src/router/elegant/transform.ts +++ b/src/router/elegant/transform.ts @@ -174,6 +174,7 @@ const routeMap: RouteMap = { "document_vite": "/document/vite", "document_unocss": "/document/unocss", "document_naive": "/document/naive", + "document_pro-naive": "/document/pro-naive", "document_antd": "/document/antd", "document_alova": "/document/alova", "403": "/403", @@ -232,6 +233,14 @@ const routeMap: RouteMap = { "plugin_tables_vtable": "/plugin/tables/vtable", "plugin_typeit": "/plugin/typeit", "plugin_video": "/plugin/video", + "pro-naive": "/pro-naive", + "pro-naive_form": "/pro-naive/form", + "pro-naive_form_basic": "/pro-naive/form/basic", + "pro-naive_form_query": "/pro-naive/form/query", + "pro-naive_form_step": "/pro-naive/form/step", + "pro-naive_table": "/pro-naive/table", + "pro-naive_table_remote": "/pro-naive/table/remote", + "pro-naive_table_row-edit": "/pro-naive/table/row-edit", "user-center": "/user-center" }; diff --git a/src/router/routes/index.ts b/src/router/routes/index.ts index 5be1e3b7..56f75106 100644 --- a/src/router/routes/index.ts +++ b/src/router/routes/index.ts @@ -91,6 +91,20 @@ const customRoutes: CustomRoute[] = [ icon: 'logos:naiveui' } }, + { + name: 'document_pro-naive', + path: '/document/pro-naive', + component: 'view.iframe-page', + props: { + url: 'https://naive-ui.pro-components.cn/' + }, + meta: { + title: 'document_pro-naive', + i18nKey: 'route.document_pro-naive', + order: 6, + icon: 'logos:naiveui' + } + }, { name: 'document_alova', path: '/document/alova', diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index cc882d86..13603b97 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -554,6 +554,82 @@ declare namespace App { triggerAllRequest: string; }; }; + proNaive: { + form: { + basic: { + title: string; + appName: string; + appStatus: string; + createTime: string; + responseDate: string; + specificationInfo: string; + specificate: string; + specificationName: string; + specificationValue: string; + specificationColorRed: string; + specificationColorOrange: string; + addSpecificateItem: string; + fillValue: string; + reset: string; + submit: string; + add: string; + delete: string; + color: string; + normal: string; + anomaly: string; + }; + query: { + title1: string; + title2: string; + appName: string; + appStatus: string; + createTime: string; + responseDate: string; + endDate: string; + field: string; + }; + step: { + title: string; + step1: { + title: string; + field: string; + nextStep: string; + }; + step2: { + title: string; + field: string; + prevStep: string; + submit: string; + }; + }; + }; + table: { + remote: { + filterCondition: string; + name: string; + createTime: string; + responseTime: string; + title: string; + replicableText: string; + tags: string; + dateFormatting: string; + image: string; + }; + rowEdit: { + title: string; + reset: string; + submit: string; + edit: string; + delete: string; + save: string; + task: string; + score: string; + time: string; + name: string; + action: string; + }; + }; + }; manage: { common: { status: { diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index d6999ab6..e3f5c8a3 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -102,6 +102,8 @@ declare module 'vue' { NSpace: typeof import('naive-ui')['NSpace'] NSpin: typeof import('naive-ui')['NSpin'] NStatistic: typeof import('naive-ui')['NStatistic'] + NStep: typeof import('naive-ui')['NStep'] + NSteps: typeof import('naive-ui')['NSteps'] NSwitch: typeof import('naive-ui')['NSwitch'] NTab: typeof import('naive-ui')['NTab'] NTabPane: typeof import('naive-ui')['NTabPane'] @@ -112,6 +114,16 @@ declare module 'vue' { NTree: typeof import('naive-ui')['NTree'] NWatermark: typeof import('naive-ui')['NWatermark'] PinToggler: typeof import('./../components/common/pin-toggler.vue')['default'] + ProCard: typeof import('pro-naive-ui')['ProCard'] + ProConfigProvider: typeof import('pro-naive-ui')['ProConfigProvider'] + ProDataTable: typeof import('pro-naive-ui')['ProDataTable'] + ProDate: typeof import('pro-naive-ui')['ProDate'] + ProEditDataTable: typeof import('pro-naive-ui')['ProEditDataTable'] + ProForm: typeof import('pro-naive-ui')['ProForm'] + ProFormList: typeof import('pro-naive-ui')['ProFormList'] + ProInput: typeof import('pro-naive-ui')['ProInput'] + ProSearchForm: typeof import('pro-naive-ui')['ProSearchForm'] + ProSelect: typeof import('pro-naive-ui')['ProSelect'] ReloadButton: typeof import('./../components/common/reload-button.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] diff --git a/src/typings/elegant-router.d.ts b/src/typings/elegant-router.d.ts index e7c44fbb..07cfa917 100644 --- a/src/typings/elegant-router.d.ts +++ b/src/typings/elegant-router.d.ts @@ -28,6 +28,7 @@ declare module "@elegant-router/types" { "document_vite": "/document/vite"; "document_unocss": "/document/unocss"; "document_naive": "/document/naive"; + "document_pro-naive": "/document/pro-naive"; "document_antd": "/document/antd"; "document_alova": "/document/alova"; "403": "/403"; @@ -86,6 +87,14 @@ declare module "@elegant-router/types" { "plugin_tables_vtable": "/plugin/tables/vtable"; "plugin_typeit": "/plugin/typeit"; "plugin_video": "/plugin/video"; + "pro-naive": "/pro-naive"; + "pro-naive_form": "/pro-naive/form"; + "pro-naive_form_basic": "/pro-naive/form/basic"; + "pro-naive_form_query": "/pro-naive/form/query"; + "pro-naive_form_step": "/pro-naive/form/step"; + "pro-naive_table": "/pro-naive/table"; + "pro-naive_table_remote": "/pro-naive/table/remote"; + "pro-naive_table_row-edit": "/pro-naive/table/row-edit"; "user-center": "/user-center"; }; @@ -117,6 +126,7 @@ declare module "@elegant-router/types" { | "document_vite" | "document_unocss" | "document_naive" + | "document_pro-naive" | "document_antd" | "document_alova" >; @@ -143,6 +153,7 @@ declare module "@elegant-router/types" { | "manage" | "multi-menu" | "plugin" + | "pro-naive" | "user-center" >; @@ -205,6 +216,11 @@ declare module "@elegant-router/types" { | "plugin_tables_vtable" | "plugin_typeit" | "plugin_video" + | "pro-naive_form_basic" + | "pro-naive_form_query" + | "pro-naive_form_step" + | "pro-naive_table_remote" + | "pro-naive_table_row-edit" | "user-center" >; @@ -224,6 +240,7 @@ declare module "@elegant-router/types" { | "document_vite" | "document_unocss" | "document_naive" + | "document_pro-naive" | "document_antd" | "document_alova" >; diff --git a/src/views/pro-naive/ConfigProvider.vue b/src/views/pro-naive/ConfigProvider.vue new file mode 100644 index 00000000..04e0440a --- /dev/null +++ b/src/views/pro-naive/ConfigProvider.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/views/pro-naive/form/basic/index.vue b/src/views/pro-naive/form/basic/index.vue new file mode 100644 index 00000000..41cfb2ca --- /dev/null +++ b/src/views/pro-naive/form/basic/index.vue @@ -0,0 +1,184 @@ + + + diff --git a/src/views/pro-naive/form/query/index.vue b/src/views/pro-naive/form/query/index.vue new file mode 100644 index 00000000..3e3c5ccf --- /dev/null +++ b/src/views/pro-naive/form/query/index.vue @@ -0,0 +1,99 @@ + + + diff --git a/src/views/pro-naive/form/step/index.vue b/src/views/pro-naive/form/step/index.vue new file mode 100644 index 00000000..9c95ce5b --- /dev/null +++ b/src/views/pro-naive/form/step/index.vue @@ -0,0 +1,72 @@ + + + diff --git a/src/views/pro-naive/table/remote/index.vue b/src/views/pro-naive/table/remote/index.vue new file mode 100644 index 00000000..16d8ae80 --- /dev/null +++ b/src/views/pro-naive/table/remote/index.vue @@ -0,0 +1,142 @@ + + + diff --git a/src/views/pro-naive/table/row-edit/index.vue b/src/views/pro-naive/table/row-edit/index.vue new file mode 100644 index 00000000..0f52a3da --- /dev/null +++ b/src/views/pro-naive/table/row-edit/index.vue @@ -0,0 +1,138 @@ + + +