From 9ab851d882a6ce28fbd2c95d5afe687823ceb31b Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Tue, 19 Mar 2024 16:06:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B=EF=BC=8C=E5=8F=AF=E9=80=9A=E8=BF=87`JSON`?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=85=8D=E7=BD=AE=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en.yaml | 1 + locales/zh-CN.yaml | 3 +- package.json | 2 +- pnpm-lock.yaml | 8 +- src/App.vue | 8 +- src/components/ReIcon/src/offlineIcon.ts | 2 + src/router/enums.ts | 36 ++-- src/router/modules/form.ts | 23 +++ src/views/components/check-card.vue | 2 +- src/views/schema-form/form/base.vue | 161 ++++++++++++++++++ src/views/schema-form/form/dialog.vue | 205 +++++++++++++++++++++++ src/views/schema-form/form/drawer.vue | 205 +++++++++++++++++++++++ src/views/schema-form/form/search.vue | 162 ++++++++++++++++++ src/views/schema-form/form/steps.vue | 204 ++++++++++++++++++++++ src/views/schema-form/index.vue | 67 ++++++++ src/views/schema-form/list.tsx | 41 +++++ types/shims-vue.d.ts | 4 +- 17 files changed, 1107 insertions(+), 27 deletions(-) create mode 100644 src/router/modules/form.ts create mode 100644 src/views/schema-form/form/base.vue create mode 100644 src/views/schema-form/form/dialog.vue create mode 100644 src/views/schema-form/form/drawer.vue create mode 100644 src/views/schema-form/form/search.vue create mode 100644 src/views/schema-form/form/steps.vue create mode 100644 src/views/schema-form/index.vue create mode 100644 src/views/schema-form/list.tsx diff --git a/locales/en.yaml b/locales/en.yaml index af00d37e5..91916826d 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -128,6 +128,7 @@ menus: hsSensitive: Sensitive Filter hsPinyin: PinYin hsdanmaku: Danmaku + hsSchemaForm: Form hsPureTableBase: Base Usage hsPureTableHigh: High Usage hsPureTableEdit: Edit Usage diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index 882ed3241..5665d00e0 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -113,7 +113,7 @@ menus: hsIconSelect: 图标选择器 hsTimeline: 时间线 hsLineTree: 树形连接线 - hsList: 列表页 + hsList: 列表页面 hsListCard: 卡片列表页 hsDebounce: 防抖节流 hsFormDesign: 表单设计器 @@ -128,6 +128,7 @@ menus: hsSensitive: 敏感词过滤 hsPinyin: 汉语拼音 hsdanmaku: 弹幕 + hsSchemaForm: 表单 hsPureTableBase: 基础用法 hsPureTableHigh: 高级用法 hsPureTableEdit: 可编辑用法 diff --git a/package.json b/package.json index d97c6b499..512777aa9 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "path": "^0.12.7", "pinia": "^2.1.7", "pinyin-pro": "^3.19.6", - "plus-pro-components": "^0.0.2", + "plus-pro-components": "^0.0.4", "qrcode": "^1.5.3", "qs": "^6.12.0", "responsive-storage": "^2.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cc7ee20d1..672faa84d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,8 +96,8 @@ dependencies: specifier: ^3.19.6 version: 3.19.6 plus-pro-components: - specifier: ^0.0.2 - version: 0.0.2(element-plus@2.6.1)(vue@3.4.21) + specifier: ^0.0.4 + version: 0.0.4(element-plus@2.6.1)(vue@3.4.21) qrcode: specifier: ^1.5.3 version: 1.5.3 @@ -6803,8 +6803,8 @@ packages: mlly: 1.6.1 pathe: 1.1.2 - /plus-pro-components@0.0.2(element-plus@2.6.1)(vue@3.4.21): - resolution: {integrity: sha512-r75t3O413czu1A4gryeCcBrZ857UGsvsGnLTLTCFMGAL+91bv1t60v6loOOXttR36yR+ithZTBxrgTGNwGOgeQ==} + /plus-pro-components@0.0.4(element-plus@2.6.1)(vue@3.4.21): + resolution: {integrity: sha512-pcvUAecwXBOZ1jtrgkeuYedEjLCaD1a7xXZQ+QJWdVAebY/KKuWD3i882XBQsPKs5KfztNK19GuxFWC/hZf13g==} peerDependencies: element-plus: ^2.3.4 vue: ^3.2.0 diff --git a/src/App.vue b/src/App.vue index f675b20df..c3784c0cd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,9 +9,11 @@ import { defineComponent } from "vue"; import { checkVersion } from "version-rocket"; import { ElConfigProvider } from "element-plus"; -import en from "element-plus/dist/locale/en.mjs"; import { ReDialog } from "@/components/ReDialog"; +import en from "element-plus/dist/locale/en.mjs"; import zhCn from "element-plus/dist/locale/zh-cn.mjs"; +import plusEn from "plus-pro-components/locale/en.mjs"; +import plusZhCn from "plus-pro-components/locale/zh-cn.mjs"; export default defineComponent({ name: "app", @@ -21,7 +23,9 @@ export default defineComponent({ }, computed: { currentLocale() { - return this.$storage.locale?.locale === "zh" ? zhCn : en; + return this.$storage.locale?.locale === "zh" + ? { ...zhCn, ...plusZhCn } + : { ...en, ...plusEn }; } }, beforeCreate() { diff --git a/src/components/ReIcon/src/offlineIcon.ts b/src/components/ReIcon/src/offlineIcon.ts index faeacc37d..1582250e9 100644 --- a/src/components/ReIcon/src/offlineIcon.ts +++ b/src/components/ReIcon/src/offlineIcon.ts @@ -37,6 +37,7 @@ import SystemLog from "@iconify-icons/ri/file-search-line"; import ListCheck from "@iconify-icons/ri/list-check"; import UbuntuFill from "@iconify-icons/ri/ubuntu-fill"; import OnlineUser from "@iconify-icons/ri/user-voice-line"; +import EditBoxLine from "@iconify-icons/ri/edit-box-line"; import OperationLog from "@iconify-icons/ri/history-fill"; import InformationLine from "@iconify-icons/ri/information-line"; import TerminalWindowLine from "@iconify-icons/ri/terminal-window-line"; @@ -58,6 +59,7 @@ addIcon("ri:artboard-line", Artboard); addIcon("ri:list-check", ListCheck); addIcon("ri:ubuntu-fill", UbuntuFill); addIcon("ri:user-voice-line", OnlineUser); +addIcon("ri:edit-box-line", EditBoxLine); addIcon("ri:history-fill", OperationLog); addIcon("ri:information-line", InformationLine); addIcon("ri:terminal-window-line", TerminalWindowLine); diff --git a/src/router/enums.ts b/src/router/enums.ts index 9670bffd8..46eb721cb 100644 --- a/src/router/enums.ts +++ b/src/router/enums.ts @@ -4,29 +4,31 @@ const home = 0, // 平台规定只有 home 路由的 rank 才能为 0 ,所以 components = 1, able = 2, table = 3, - list = 4, - result = 5, - error = 6, - frame = 7, - nested = 8, - permission = 9, - system = 10, - monitor = 11, - tabs = 12, - about = 13, - editor = 14, - flowchart = 15, - formdesign = 16, - board = 17, - ppt = 18, - guide = 19, - menuoverflow = 20; + form = 4, + list = 5, + result = 6, + error = 7, + frame = 8, + nested = 9, + permission = 10, + system = 11, + monitor = 12, + tabs = 13, + about = 14, + editor = 15, + flowchart = 16, + formdesign = 17, + board = 18, + ppt = 19, + guide = 20, + menuoverflow = 21; export { home, components, able, table, + form, list, result, error, diff --git a/src/router/modules/form.ts b/src/router/modules/form.ts new file mode 100644 index 000000000..832e3c531 --- /dev/null +++ b/src/router/modules/form.ts @@ -0,0 +1,23 @@ +import { $t } from "@/plugins/i18n"; +import { form } from "@/router/enums"; + +export default { + path: "/form", + redirect: "/form/index", + meta: { + icon: "ri:edit-box-line", + title: $t("menus.hsSchemaForm"), + rank: form + }, + children: [ + { + path: "/form/index", + name: "SchemaForm", + component: () => import("@/views/schema-form/index.vue"), + meta: { + title: $t("menus.hsSchemaForm"), + extraIcon: "IF-pure-iconfont-new svg" + } + } + ] +} satisfies RouteConfigsTable; diff --git a/src/views/components/check-card.vue b/src/views/components/check-card.vue index 93dad97ef..150381d6c 100644 --- a/src/views/components/check-card.vue +++ b/src/views/components/check-card.vue @@ -1,8 +1,8 @@ + + diff --git a/src/views/schema-form/form/dialog.vue b/src/views/schema-form/form/dialog.vue new file mode 100644 index 000000000..303bc6cb7 --- /dev/null +++ b/src/views/schema-form/form/dialog.vue @@ -0,0 +1,205 @@ + + + diff --git a/src/views/schema-form/form/drawer.vue b/src/views/schema-form/form/drawer.vue new file mode 100644 index 000000000..0529ad6a4 --- /dev/null +++ b/src/views/schema-form/form/drawer.vue @@ -0,0 +1,205 @@ + + + diff --git a/src/views/schema-form/form/search.vue b/src/views/schema-form/form/search.vue new file mode 100644 index 000000000..88d226b98 --- /dev/null +++ b/src/views/schema-form/form/search.vue @@ -0,0 +1,162 @@ + + + diff --git a/src/views/schema-form/form/steps.vue b/src/views/schema-form/form/steps.vue new file mode 100644 index 000000000..073ef5734 --- /dev/null +++ b/src/views/schema-form/form/steps.vue @@ -0,0 +1,204 @@ + + + diff --git a/src/views/schema-form/index.vue b/src/views/schema-form/index.vue new file mode 100644 index 000000000..e0eed5e84 --- /dev/null +++ b/src/views/schema-form/index.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/src/views/schema-form/list.tsx b/src/views/schema-form/list.tsx new file mode 100644 index 000000000..5c98df946 --- /dev/null +++ b/src/views/schema-form/list.tsx @@ -0,0 +1,41 @@ +import Base from "./form/base.vue"; +import Dialog from "./form/dialog.vue"; +import Drawer from "./form/drawer.vue"; +import Steps from "./form/steps.vue"; +import Search from "./form/search.vue"; + +const rendContent = (val: string) => + `代码位置:src/views/schema-form/form/${val}.vue`; + +export const list = [ + { + key: "base", + content: rendContent("base"), + title: "基础表单", + component: Base + }, + { + key: "dialog", + content: rendContent("dialog"), + title: "弹框表单", + component: Dialog + }, + { + key: "drawer", + content: rendContent("drawer"), + title: "抽屉表单", + component: Drawer + }, + { + key: "steps", + content: rendContent("steps"), + title: "分步表单", + component: Steps + }, + { + key: "search", + content: rendContent("search"), + title: "搜索表单", + component: Search + } +]; diff --git a/types/shims-vue.d.ts b/types/shims-vue.d.ts index 07e615518..ed166cd04 100644 --- a/types/shims-vue.d.ts +++ b/types/shims-vue.d.ts @@ -1,5 +1,5 @@ declare module "*.vue" { - import { DefineComponent } from "vue"; + import type { DefineComponent } from "vue"; const component: DefineComponent<{}, {}, any>; export default component; } @@ -13,3 +13,5 @@ declare module "vue-virtual-scroller"; declare module "vuedraggable/src/vuedraggable"; declare module "element-plus/dist/locale/en.mjs"; declare module "element-plus/dist/locale/zh-cn.mjs"; +declare module "plus-pro-components/locale/en.mjs"; +declare module "plus-pro-components/locale/zh-cn.mjs";