hs-admin-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +11 -0
- package/.env.development +5 -0
- package/.env.production +5 -0
- package/.eslintignore +18 -0
- package/.eslintrc.js +104 -0
- package/.prettierrc.js +39 -0
- package/.vite/deps_temp_3669a513/chunk-FVXAE7ZR.js +11400 -0
- package/.vite/deps_temp_3669a513/chunk-ZS7NZCD4.js +36 -0
- package/.vite/deps_temp_3669a513/default-passive-events.js +25 -0
- package/.vite/deps_temp_3669a513/element-plus.js +65013 -0
- package/.vite/deps_temp_3669a513/lodash.js +5497 -0
- package/.vite/deps_temp_3669a513/package.json +3 -0
- package/.vite/deps_temp_3669a513/vue.js +324 -0
- package/.vite/deps_temp_3669a513/vxe-table.js +32336 -0
- package/CHANGELOG.md +1 -0
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/directoryList.md +180 -0
- package/package.json +78 -0
- package/postcss.config.js +7 -0
- package/src/App.vue +88 -0
- package/src/api/fieldConfigController/index.ts +76 -0
- package/src/api/fieldConfigController/type.ts +44 -0
- package/src/api/login/index.ts +78 -0
- package/src/api/loginController/index.ts +74 -0
- package/src/api/menu/index.ts +34 -0
- package/src/api/menu/index2.ts +291 -0
- package/src/api/menuController/index.ts +189 -0
- package/src/api/systemController/index.ts +26 -0
- package/src/api/systemController/type.ts +16 -0
- package/src/api/test/index.ts +22 -0
- package/src/api/user/index.ts +30 -0
- package/src/assets/404.png +0 -0
- package/src/assets/logo-main.svg +12 -0
- package/src/assets/logo-mini.svg +12 -0
- package/src/components/base/hsAffix/src/hsAffix.vue +22 -0
- package/src/components/base/hsAlert/src/hsAlert.vue +15 -0
- package/src/components/base/hsAutocomplete/src/hsAutocomplete.vue +36 -0
- package/src/components/base/hsButton/src/hsButton.vue +26 -0
- package/src/components/base/hsButton/src/hsButtonGroup.vue +8 -0
- package/src/components/base/hsButton/useButtonEvents.ts +19 -0
- package/src/components/base/hsCalendar/src/hsCalendar.vue +36 -0
- package/src/components/base/hsCarousel/src/hsCarousel.vue +15 -0
- package/src/components/base/hsCarousel/src/hsCarouselItem.vue +15 -0
- package/src/components/base/hsCascader/src/hsCascader.vue +36 -0
- package/src/components/base/hsCascader/src/hsCascaderPanel.vue +29 -0
- package/src/components/base/hsCheckbox/src/hsCheckbox.vue +32 -0
- package/src/components/base/hsCheckbox/src/hsCheckboxButton.vue +18 -0
- package/src/components/base/hsCheckbox/src/hsCheckboxGroup.vue +32 -0
- package/src/components/base/hsCol/src/hsCol.vue +20 -0
- package/src/components/base/hsCollapse/src/hsCollapse.vue +36 -0
- package/src/components/base/hsCollapse/src/hsCollapseItem.vue +22 -0
- package/src/components/base/hsColorPicker/src/hsColorPicker.vue +32 -0
- package/src/components/base/hsDatePicker/src/hsDatePicker.vue +40 -0
- package/src/components/base/hsDialog/src/hsDialog.vue +36 -0
- package/src/components/base/hsDrawer/src/hsDrawer.vue +29 -0
- package/src/components/base/hsDropdown/src/hsDropdown.vue +15 -0
- package/src/components/base/hsDropdown/src/hsDropdownItem.vue +15 -0
- package/src/components/base/hsDropdown/src/hsDropdownMenu.vue +15 -0
- package/src/components/base/hsForm/src/hsForm.vue +23 -0
- package/src/components/base/hsForm/src/hsFormItem.vue +22 -0
- package/src/components/base/hsGetApi/src/hsGetApis.vue +231 -0
- package/src/components/base/hsGetApi/useGetApis.ts +158 -0
- package/src/components/base/hsInput/src/hsInput.vue +40 -0
- package/src/components/base/hsInput/useInputEvents.ts +52 -0
- package/src/components/base/hsInputNumber/src/hsInputNumber.vue +31 -0
- package/src/components/base/hsPopconfirm/src/hsPopconfirm.vue +15 -0
- package/src/components/base/hsPopover/src/hsPopover.vue +22 -0
- package/src/components/base/hsProgress/src/hsProgress.vue +15 -0
- package/src/components/base/hsRadio/src/hsRadio.vue +32 -0
- package/src/components/base/hsRadio/src/hsRadioButton.vue +18 -0
- package/src/components/base/hsRadio/src/hsRadioGroup.vue +32 -0
- package/src/components/base/hsRate/src/hsRate.vue +33 -0
- package/src/components/base/hsResult/src/hsResult.vue +15 -0
- package/src/components/base/hsRow/src/hsRow.vue +20 -0
- package/src/components/base/hsScrollbar/src/hsScrollbar.vue +22 -0
- package/src/components/base/hsSelect/src/hsOption.vue +8 -0
- package/src/components/base/hsSelect/src/hsOptionGroup.vue +8 -0
- package/src/components/base/hsSelect/src/hsSelect.vue +42 -0
- package/src/components/base/hsSelect/useSelectEvents.ts +60 -0
- package/src/components/base/hsSlider/src/hsSlider.vue +25 -0
- package/src/components/base/hsSteps/src/hsStep.vue +15 -0
- package/src/components/base/hsSteps/src/hsSteps.vue +15 -0
- package/src/components/base/hsSwitch/src/hsSwitch.vue +35 -0
- package/src/components/base/hsTable/hsBCTable.vue +116 -0
- package/src/components/base/hsTable/hsTable copy.vue +226 -0
- package/src/components/base/hsTable/hsTable.vue +213 -0
- package/src/components/base/hsTable/useHsTableConfig.ts +95 -0
- package/src/components/base/hsTable/useTableEvents.ts +118 -0
- package/src/components/base/hsTabs/src/hsTabPane.vue +15 -0
- package/src/components/base/hsTabs/src/hsTabs.vue +29 -0
- package/src/components/base/hsTag/src/hsCheckTag.vue +16 -0
- package/src/components/base/hsTag/src/hsTag.vue +15 -0
- package/src/components/base/hsTest/HsTest.vue +320 -0
- package/src/components/base/hsTooltip/src/hsTooltip.vue +22 -0
- package/src/components/base/hsTour/src/hsTour.vue +31 -0
- package/src/components/base/hsTour/src/hsTourStep.vue +15 -0
- package/src/components/base/hsTransfer/src/hsTransfer.vue +36 -0
- package/src/components/base/hsTree/src/hsTree.vue +24 -0
- package/src/components/base/hsTreeSelect/src/hsTreeSelect.vue +39 -0
- package/src/components/base/hsUpload/src/hsUpload.vue +32 -0
- package/src/components/base/hsWatermark/src/hsWatermark.vue +15 -0
- package/src/components/business/bcAutoComplete/bcAutoComplete.vue +38 -0
- package/src/components/business/bcAutoComplete/defaultData.ts +25 -0
- package/src/components/business/bcAutoComplete/useAutoComplete.ts +65 -0
- package/src/components/business/bcBtn/bcBtn.vue +40 -0
- package/src/components/business/bcForm/bcForm.vue +113 -0
- package/src/components/business/bcForm/bcFormDrag.vue +104 -0
- package/src/components/business/bcForm/bcFormSearch.vue +154 -0
- package/src/components/business/bcForm/components/sortForm/index.ts +18 -0
- package/src/components/business/bcForm/components/sortForm/sortForm.vue +92 -0
- package/src/components/business/bcFormConfig/bcFormConfig.vue +196 -0
- package/src/components/business/bcFormTable/bcFormTable.vue +91 -0
- package/src/components/business/bcFormTable/components/bcTabs/bcTabs.vue +53 -0
- package/src/components/business/bcFormTable/components/contextBody/contextBody.vue +67 -0
- package/src/components/business/bcFormTable/components/contextBody/useContextMenu.ts +53 -0
- package/src/components/business/bcFormTable/components/formSearchBtn/formSearchBtn.vue +21 -0
- package/src/components/business/bcFormTable/methods/cellDetailMethod.ts +5 -0
- package/src/components/business/bcFormTable/methods/filterAgeMethod.ts +5 -0
- package/src/components/business/bcFormTable/methods/footerMethod.ts +25 -0
- package/src/components/business/bcFormTable/methods/index.ts +10 -0
- package/src/components/business/bcFormTable/utils/onFormKey.ts +121 -0
- package/src/components/business/bcFormTable/utils/onTableKey.ts +119 -0
- package/src/components/business/bcFormTable/utils/parseTable.ts +201 -0
- package/src/components/business/bcFormTable/utils/useButon.ts +20 -0
- package/src/components/business/bcFormTable/utils/useTableHeight.ts +44 -0
- package/src/components/business/bcPageConfig/bcPageConfig.vue +79 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsAttrBtn.vue +39 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsBtnConfigList.vue +45 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsBtnItemConfig.vue +32 -0
- package/src/components/business/bcPageConfig/components/hsBtn/src/hsBtnPanel.vue +45 -0
- package/src/components/business/bcPageConfig/components/hsBtn/useAttrBtn.ts +58 -0
- package/src/components/business/bcPageConfig/components/hsBtn/useBtnConfigList.ts +71 -0
- package/src/components/business/bcPageConfig/components/hsBtn/useBtnItemConfig.ts +35 -0
- package/src/components/business/bcPageConfig/components/hsExpand/src/hsExpand.vue +33 -0
- package/src/components/business/bcPageConfig/components/hsExpand/useExpand.ts +9 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsAttrForm.vue +54 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsFormConfig.vue +180 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsFormConfigList.vue +45 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsFormPanel.vue +64 -0
- package/src/components/business/bcPageConfig/components/hsForm/src/hsFormParse.vue +24 -0
- package/src/components/business/bcPageConfig/components/hsForm/useAttrForm.ts +108 -0
- package/src/components/business/bcPageConfig/components/hsForm/useFormListConfig.ts +69 -0
- package/src/components/business/bcPageConfig/components/hsForm/useFormParse.ts +120 -0
- package/src/components/business/bcPageConfig/components/hsSaveForm/saveFormConfig.ts +66 -0
- package/src/components/business/bcPageConfig/components/hsSaveForm/src/saveForm.vue +48 -0
- package/src/components/business/bcPageConfig/components/hsSaveForm/useSaveForm.ts +148 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsAttrTable.vue +122 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsRecursionConfig.vue +36 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsTableConfig.vue +51 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsTableConfigList.vue +46 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsTablePanel.vue +68 -0
- package/src/components/business/bcPageConfig/components/hsTables/src/hsTableParse.vue +24 -0
- package/src/components/business/bcPageConfig/components/hsTables/useAttrTable.ts +218 -0
- package/src/components/business/bcPageConfig/components/hsTables/useTableConfigList.ts +77 -0
- package/src/components/business/bcPageConfig/components/hsTables/useTableParse.ts +78 -0
- package/src/components/business/bcPageConfig/default/apis.json +24712 -0
- package/src/components/business/bcPageConfig/default/baseBtnConfig.ts +256 -0
- package/src/components/business/bcPageConfig/default/baseFormConfig.ts +380 -0
- package/src/components/business/bcPageConfig/default/baseTableConfig.ts +2399 -0
- package/src/components/business/bcPageConfig/usePageConfig.ts +469 -0
- package/src/components/business/bcSelect/bcSelect.vue +50 -0
- package/src/components/business/bcSwitchSystems/bcSwitchSystems.vue +36 -0
- package/src/components/business/bcSwitchSystems/useSwitchSystems.ts +74 -0
- package/src/components/business/bcTable/bcTable.vue +63 -0
- package/src/components/business/bcTable/components/sortColumn/index.ts +19 -0
- package/src/components/business/bcTable/components/sortColumn/sortColumn.vue +107 -0
- package/src/components/business/bcTable/useTable.ts +51 -0
- package/src/components/business/bcTable/useTableHeight.ts +24 -0
- package/src/components/business/bcTreeSelect/bcTreeSelect.vue +12 -0
- package/src/components/business/cardID/cardID.vue +24 -0
- package/src/components/business/cardID/type.ts +0 -0
- package/src/components/business/cardID/useCardID.ts +0 -0
- package/src/components/component.ts +188 -0
- package/src/components/config/autocompleteAttrConfig/autocompleteAttrConfig.vue +26 -0
- package/src/components/config/autocompleteAttrConfig/config.ts +170 -0
- package/src/components/config/baseForm.vue +175 -0
- package/src/components/config/buttonAttrConfig/buttonAttrConfig.vue +26 -0
- package/src/components/config/buttonAttrConfig/config.ts +261 -0
- package/src/components/config/cascaderAttrConfig/cascaderAttrConfig.vue +26 -0
- package/src/components/config/cascaderAttrConfig/config.ts +287 -0
- package/src/components/config/cascaderPanelAttrConfig/cascaderPanelAttrConfig.vue +26 -0
- package/src/components/config/cascaderPanelAttrConfig/config.ts +278 -0
- package/src/components/config/checkboxAttrConfig/checkboxAttrConfig.vue +26 -0
- package/src/components/config/checkboxAttrConfig/config.ts +301 -0
- package/src/components/config/datePickerAttrConfig/config.ts +256 -0
- package/src/components/config/datePickerAttrConfig/datePickerAttrConfig.vue +26 -0
- package/src/components/config/inputAttrConfig/config.ts +322 -0
- package/src/components/config/inputAttrConfig/inputAttrConfig.vue +33 -0
- package/src/components/config/inputAttrConfig/inputEventConfig.vue +35 -0
- package/src/components/config/inputNumberAttrConfig/config.ts +177 -0
- package/src/components/config/inputNumberAttrConfig/inputNumberAttrConfig.vue +26 -0
- package/src/components/config/radioAttrConfig/config.ts +212 -0
- package/src/components/config/radioAttrConfig/radioAttrConfig.vue +26 -0
- package/src/components/config/selectAttrConfig/config.ts +478 -0
- package/src/components/config/selectAttrConfig/selectAttrConfig.vue +26 -0
- package/src/components/config/switchAttrConfig/config.ts +195 -0
- package/src/components/config/switchAttrConfig/switchAttrConfig.vue +26 -0
- package/src/components/config/treeSelectAttrConfig/config.ts +625 -0
- package/src/components/config/treeSelectAttrConfig/treeSelectAttrConfig.vue +26 -0
- package/src/components/config/type/formType.ts +25 -0
- package/src/components/config/uploadAttrConfig/config.ts +250 -0
- package/src/components/config/uploadAttrConfig/uploadAttrConfig.vue +26 -0
- package/src/components/iconSelector/index.vue +247 -0
- package/src/components/iconSelector/list.vue +84 -0
- package/src/components/svgIcon/index.vue +61 -0
- package/src/directive/authDirective.ts +40 -0
- package/src/directive/customDirective.ts +178 -0
- package/src/directive/index.ts +18 -0
- package/src/hooks/useCrypto.ts +36 -0
- package/src/hooks/useExpose.ts +60 -0
- package/src/layout/component/aside.vue +160 -0
- package/src/layout/component/columnsAside.vue +299 -0
- package/src/layout/component/header.vue +18 -0
- package/src/layout/component/main.vue +65 -0
- package/src/layout/footer/index.vue +25 -0
- package/src/layout/index.vue +53 -0
- package/src/layout/lockScreen/index.vue +352 -0
- package/src/layout/logo/index.vue +75 -0
- package/src/layout/main/classic.vue +73 -0
- package/src/layout/main/columns.vue +73 -0
- package/src/layout/main/defaults.vue +73 -0
- package/src/layout/main/transverse.vue +60 -0
- package/src/layout/navBars/index.vue +35 -0
- package/src/layout/navBars/tagsView/contextmenu.vue +133 -0
- package/src/layout/navBars/tagsView/tagsView.vue +737 -0
- package/src/layout/navBars/topBar/breadcrumb.vue +146 -0
- package/src/layout/navBars/topBar/closeFull.vue +53 -0
- package/src/layout/navBars/topBar/index.vue +107 -0
- package/src/layout/navBars/topBar/search.vue +123 -0
- package/src/layout/navBars/topBar/setings.vue +789 -0
- package/src/layout/navBars/topBar/user.vue +222 -0
- package/src/layout/navBars/topBar/userNews.vue +107 -0
- package/src/layout/navMenu/horizontal.vue +138 -0
- package/src/layout/navMenu/subItem.vue +49 -0
- package/src/layout/navMenu/vertical.vue +100 -0
- package/src/layout/routerView/iframes.vue +101 -0
- package/src/layout/routerView/link.vue +93 -0
- package/src/layout/routerView/parent.vue +104 -0
- package/src/layout/upgrade/index.vue +147 -0
- package/src/main.ts +70 -0
- package/src/router/backEnd.ts +173 -0
- package/src/router/frontEnd.ts +155 -0
- package/src/router/index.ts +138 -0
- package/src/router/route.ts +94 -0
- package/src/stores/index.ts +8 -0
- package/src/stores/keepAliveNames.ts +38 -0
- package/src/stores/requestOldRoutes.ts +16 -0
- package/src/stores/routesList.ts +26 -0
- package/src/stores/tagsViewRoutes.ts +23 -0
- package/src/stores/themeConfig.ts +142 -0
- package/src/stores/userInfo.ts +65 -0
- package/src/style/index.scss +0 -0
- package/src/style/tailwind.css +29 -0
- package/src/theme/app.scss +333 -0
- package/src/theme/common/transition.scss +147 -0
- package/src/theme/dark.scss +255 -0
- package/src/theme/element.scss +321 -0
- package/src/theme/iconSelector.scss +31 -0
- package/src/theme/index.scss +8 -0
- package/src/theme/loading.scss +51 -0
- package/src/theme/media/chart.scss +94 -0
- package/src/theme/media/cityLinkage.scss +10 -0
- package/src/theme/media/date.scss +25 -0
- package/src/theme/media/dialog.scss +12 -0
- package/src/theme/media/error.scss +45 -0
- package/src/theme/media/form.scss +31 -0
- package/src/theme/media/home.scss +23 -0
- package/src/theme/media/index.scss +15 -0
- package/src/theme/media/layout.scss +63 -0
- package/src/theme/media/login.scss +74 -0
- package/src/theme/media/media.scss +13 -0
- package/src/theme/media/pagination.scss +15 -0
- package/src/theme/media/personal.scss +16 -0
- package/src/theme/media/scrollbar.scss +56 -0
- package/src/theme/media/tagsView.scss +11 -0
- package/src/theme/mixins/index.scss +56 -0
- package/src/theme/other.scss +36 -0
- package/src/theme/tableTool.scss +27 -0
- package/src/theme/waves.scss +101 -0
- package/src/types/auth.d.ts +44 -0
- package/src/types/axios.d.ts +13 -0
- package/src/types/components.d.ts +30 -0
- package/src/types/customData.d.ts +163 -0
- package/src/types/form.ts +68 -0
- package/src/types/formItem/autocomplete.ts +43 -0
- package/src/types/formItem/button.ts +39 -0
- package/src/types/formItem/input.ts +66 -0
- package/src/types/formItem/inputNumber.ts +42 -0
- package/src/types/formItem/selelct.ts +54 -0
- package/src/types/formItem/treeSelect.ts +37 -0
- package/src/types/formTable.d.ts +210 -0
- package/src/types/global.d.ts +118 -0
- package/src/types/layout.d.ts +59 -0
- package/src/types/mitt.d.ts +38 -0
- package/src/types/pinia.d.ts +92 -0
- package/src/types/views.d.ts +331 -0
- package/src/utils/arrayOperation.ts +65 -0
- package/src/utils/authFunction.ts +38 -0
- package/src/utils/build.ts +124 -0
- package/src/utils/commonFunction.ts +64 -0
- package/src/utils/formatTime.ts +137 -0
- package/src/utils/getDataType.ts +136 -0
- package/src/utils/getStyleSheets.ts +101 -0
- package/src/utils/loading.ts +44 -0
- package/src/utils/mitt.ts +8 -0
- package/src/utils/other.ts +214 -0
- package/src/utils/request.ts +82 -0
- package/src/utils/setIconfont.ts +48 -0
- package/src/utils/showMessage.ts +57 -0
- package/src/utils/showMessageBox.ts +39 -0
- package/src/utils/showNotification.ts +50 -0
- package/src/utils/showPopup.ts +81 -0
- package/src/utils/storage.ts +137 -0
- package/src/utils/theme.ts +65 -0
- package/src/utils/toolsValidate.ts +370 -0
- package/src/utils/watermark.ts +47 -0
- package/src/views/error/401.vue +88 -0
- package/src/views/error/404.vue +89 -0
- package/src/views/home/index.vue +62 -0
- package/src/views/login/component/account.vue +172 -0
- package/src/views/login/component/mobile.vue +72 -0
- package/src/views/login/component/scan.vue +63 -0
- package/src/views/login/index.vue +254 -0
- package/src/views/system/auth/index.vue +48 -0
- package/src/views/system/auth/list.ts +50 -0
- package/src/views/system/auth/useAuth.ts +34 -0
- package/src/views/system/dept/dialog.vue +167 -0
- package/src/views/system/dept/index.vue +135 -0
- package/src/views/system/dic/dialog.vue +150 -0
- package/src/views/system/dic/index.vue +132 -0
- package/src/views/system/form/data.json +360 -0
- package/src/views/system/form/index.vue +24 -0
- package/src/views/system/formSetting/components/hsBtn/src/hsAttrBtn.vue +58 -0
- package/src/views/system/formSetting/components/hsBtn/src/hsBtnConfigList.vue +45 -0
- package/src/views/system/formSetting/components/hsBtn/src/hsBtnPanel.vue +51 -0
- package/src/views/system/formSetting/components/hsBtn/useAttrBtn.ts +129 -0
- package/src/views/system/formSetting/components/hsBtn/useBtnConfigList.ts +73 -0
- package/src/views/system/formSetting/components/hsExpand/src/hsExpand.vue +27 -0
- package/src/views/system/formSetting/components/hsExpand/useExpand.ts +9 -0
- package/src/views/system/formSetting/components/hsForm/src/hsAttrForm.vue +124 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormConfig.vue +180 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormConfigList.vue +45 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormPanel.vue +152 -0
- package/src/views/system/formSetting/components/hsForm/src/hsFormParse.vue +33 -0
- package/src/views/system/formSetting/components/hsForm/useAttrForm.ts +109 -0
- package/src/views/system/formSetting/components/hsForm/useFormListConfig.ts +70 -0
- package/src/views/system/formSetting/components/hsPageTree/configData.ts +3700 -0
- package/src/views/system/formSetting/components/hsPageTree/src/hsPageTree.vue +30 -0
- package/src/views/system/formSetting/components/hsPageTree/usePageTree.ts +50 -0
- package/src/views/system/formSetting/components/hsSaveForm/saveFormConfig.ts +66 -0
- package/src/views/system/formSetting/components/hsSaveForm/src/saveForm.vue +47 -0
- package/src/views/system/formSetting/components/hsSaveForm/useSaveForm.ts +122 -0
- package/src/views/system/formSetting/components/hsTables/src/hsAttrTable.vue +91 -0
- package/src/views/system/formSetting/components/hsTables/src/hsRecursionConfig.vue +36 -0
- package/src/views/system/formSetting/components/hsTables/src/hsTableConfig.vue +39 -0
- package/src/views/system/formSetting/components/hsTables/src/hsTableConfigList.vue +45 -0
- package/src/views/system/formSetting/components/hsTables/src/hsTablePanel.vue +56 -0
- package/src/views/system/formSetting/components/hsTables/src/hsTableParse.vue +29 -0
- package/src/views/system/formSetting/components/hsTables/useAttrTable.ts +125 -0
- package/src/views/system/formSetting/components/hsTables/useTableConfigList.ts +77 -0
- package/src/views/system/formSetting/components/selectConfig/config.ts +476 -0
- package/src/views/system/formSetting/components/selectConfig/selectConfig.vue +30 -0
- package/src/views/system/formSetting/data.json +360 -0
- package/src/views/system/formSetting/default/baseBtnConfig.ts +216 -0
- package/src/views/system/formSetting/default/baseFormConfig.ts +567 -0
- package/src/views/system/formSetting/default/baseTableConfig.ts +2353 -0
- package/src/views/system/formSetting/formConfig.vue +108 -0
- package/src/views/system/formSetting/index.vue +35 -0
- package/src/views/system/formSetting/menuType.d.ts +12 -0
- package/src/views/system/formSetting/panelConfig.json +164 -0
- package/src/views/system/formSetting/useForm.ts +89 -0
- package/src/views/system/formSetting/useFormConfig.ts +192 -0
- package/src/views/system/menu/dialog.vue +285 -0
- package/src/views/system/menu/index.vue +180 -0
- package/src/views/system/page/components/hsPageTree/configData.ts +3700 -0
- package/src/views/system/page/components/hsPageTree/src/hsPageTree.vue +30 -0
- package/src/views/system/page/components/hsPageTree/usePageTree.ts +49 -0
- package/src/views/system/page/index.vue +32 -0
- package/src/views/system/page/menuType.d.ts +12 -0
- package/src/views/system/page/usePage.ts +125 -0
- package/src/views/system/role/dialog.vue +236 -0
- package/src/views/system/role/index.vue +146 -0
- package/src/views/system/table/data.json +747 -0
- package/src/views/system/table/formate.js +49 -0
- package/src/views/system/table/index.vue +53 -0
- package/src/views/system/user/dialog.vue +187 -0
- package/src/views/system/user/index.vue +161 -0
- package/src/views/test/test/components/hsBtn/src/hsAttrBtn.vue +58 -0
- package/src/views/test/test/components/hsBtn/src/hsBtnConfigList.vue +45 -0
- package/src/views/test/test/components/hsBtn/src/hsBtnPanel.vue +51 -0
- package/src/views/test/test/components/hsBtn/useAttrBtn.ts +129 -0
- package/src/views/test/test/components/hsBtn/useBtnConfigList.ts +73 -0
- package/src/views/test/test/components/hsExpand/src/hsExpand.vue +27 -0
- package/src/views/test/test/components/hsExpand/useExpand.ts +9 -0
- package/src/views/test/test/components/hsForm/src/hsAttrForm.vue +124 -0
- package/src/views/test/test/components/hsForm/src/hsFormConfig.vue +180 -0
- package/src/views/test/test/components/hsForm/src/hsFormConfigList.vue +45 -0
- package/src/views/test/test/components/hsForm/src/hsFormPanel.vue +152 -0
- package/src/views/test/test/components/hsForm/src/hsFormParse.vue +33 -0
- package/src/views/test/test/components/hsForm/useAttrForm.ts +109 -0
- package/src/views/test/test/components/hsForm/useFormListConfig.ts +70 -0
- package/src/views/test/test/components/hsSaveForm/saveFormConfig.ts +66 -0
- package/src/views/test/test/components/hsSaveForm/src/saveForm.vue +47 -0
- package/src/views/test/test/components/hsSaveForm/useSaveForm.ts +122 -0
- package/src/views/test/test/components/hsTables/src/hsAttrTable.vue +91 -0
- package/src/views/test/test/components/hsTables/src/hsRecursionConfig.vue +36 -0
- package/src/views/test/test/components/hsTables/src/hsTableConfig.vue +39 -0
- package/src/views/test/test/components/hsTables/src/hsTableConfigList.vue +45 -0
- package/src/views/test/test/components/hsTables/src/hsTablePanel.vue +56 -0
- package/src/views/test/test/components/hsTables/src/hsTableParse.vue +29 -0
- package/src/views/test/test/components/hsTables/useAttrTable.ts +125 -0
- package/src/views/test/test/components/hsTables/useTableConfigList.ts +77 -0
- package/src/views/test/test/components/selectConfig/config.ts +476 -0
- package/src/views/test/test/components/selectConfig/selectConfig.vue +30 -0
- package/src/views/test/test/data.json +360 -0
- package/src/views/test/test/default/baseBtnConfig.ts +216 -0
- package/src/views/test/test/default/baseFormConfig.ts +567 -0
- package/src/views/test/test/default/baseTableConfig.ts +2353 -0
- package/src/views/test/test/formConfig.vue +102 -0
- package/src/views/test/test/test.vue +28 -0
- package/src/views/test/test/test3.vue +24 -0
- package/src/views/test/test/test4.vue +107 -0
- package/src/views/test/test/test/345/211/257/346/234/254.vue +2424 -0
- package/src/views/test/test/useFormConfig.ts +192 -0
- package/src/views/test/test2/test2.vue +17 -0
- package/src/views/test/test3/test.vue +20 -0
- package/tailwind.config.js +12 -0
- package/tsconfig.json +75 -0
- package/vite.config.ts +123 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
desc: 配置表单面板
|
|
3
|
+
author: 吕玲
|
|
4
|
+
-->
|
|
5
|
+
<template>
|
|
6
|
+
<!-- flex flex-row -->
|
|
7
|
+
<div class="mx-auto flex flex-row h-full">
|
|
8
|
+
<!-- grid-cols-subgrid gap-5 -->
|
|
9
|
+
<div class="flex-1 grow overflow-y-auto">
|
|
10
|
+
<hsExpand v-model="formTitleConfig.code.visible" :expandConfig="formTitleConfig.code"></hsExpand>
|
|
11
|
+
<div v-if="formTitleConfig.code.visible">
|
|
12
|
+
{{ configModel }}
|
|
13
|
+
</div>
|
|
14
|
+
<hsFormParse :is="hsFormParse" v-model="configModel" />
|
|
15
|
+
<!-- 表单基础配置 -->
|
|
16
|
+
<component :is="hsExpand" v-model="formTitleConfig.baseForm.visible" :expandConfig="formTitleConfig.baseForm"></component>
|
|
17
|
+
<component :is="'bc-form-config'" v-if="formTitleConfig.baseForm.visible" :data="BaseFormModel" :config="parentBaseFormConfig" />
|
|
18
|
+
<!-- 基础配置 -->
|
|
19
|
+
<component :is="hsExpand" v-model="formTitleConfig.base.visible" :expandConfig="formTitleConfig.base"></component>
|
|
20
|
+
<component :is="'bc-form-config'" v-if="formTitleConfig.base.visible" :data="configModel?.base" :config="parentBaseConfig" />
|
|
21
|
+
<!-- 表单配置项 -->
|
|
22
|
+
<template v-if="configModel?.form">
|
|
23
|
+
<!-- 表单配置项 类型 -->
|
|
24
|
+
<el-radio-group v-model="configModel.formItemType">
|
|
25
|
+
<el-radio label="form">启用表单配置项</el-radio>
|
|
26
|
+
<el-radio label="component">启用组件</el-radio>
|
|
27
|
+
<el-radio label="slot">启用插槽</el-radio>
|
|
28
|
+
</el-radio-group>
|
|
29
|
+
<component
|
|
30
|
+
:is="hsExpand"
|
|
31
|
+
v-if="configModel.formItemType == 'form'"
|
|
32
|
+
v-model="formTitleConfig.form.visible"
|
|
33
|
+
:expandConfig="formTitleConfig.form"
|
|
34
|
+
></component>
|
|
35
|
+
<component
|
|
36
|
+
:is="'bc-form-config'"
|
|
37
|
+
v-if="formTitleConfig.form.visible && configModel.formItemType == 'form'"
|
|
38
|
+
:data="configModel.form.baseData"
|
|
39
|
+
:config="parentFormConfig"
|
|
40
|
+
/>
|
|
41
|
+
<!-- 启用组件 -->
|
|
42
|
+
<component
|
|
43
|
+
:is="hsExpand"
|
|
44
|
+
v-if="configModel.formItemType == 'component'"
|
|
45
|
+
v-model="formTitleConfig.component.visible"
|
|
46
|
+
:expandConfig="formTitleConfig.component"
|
|
47
|
+
></component>
|
|
48
|
+
<component
|
|
49
|
+
:is="'bc-form-config'"
|
|
50
|
+
v-if="formTitleConfig.component.visible && configModel.formItemType == 'component'"
|
|
51
|
+
:data="configModel.component?.baseData"
|
|
52
|
+
:config="parentComponentConfig"
|
|
53
|
+
/>
|
|
54
|
+
<!-- 启用插槽 -->
|
|
55
|
+
<component
|
|
56
|
+
:is="hsExpand"
|
|
57
|
+
v-if="configModel.formItemType == 'slot'"
|
|
58
|
+
v-model="formTitleConfig.slot.visible"
|
|
59
|
+
:expandConfig="formTitleConfig.slot"
|
|
60
|
+
></component>
|
|
61
|
+
<component
|
|
62
|
+
:is="'bc-form-config'"
|
|
63
|
+
v-if="formTitleConfig.slot.visible && configModel.formItemType == 'slot'"
|
|
64
|
+
:data="configModel.slot?.baseData"
|
|
65
|
+
:config="parentSlotConfig"
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
<component
|
|
69
|
+
:is="hsExpand"
|
|
70
|
+
v-if="configModel.formItemType == 'form'"
|
|
71
|
+
v-model="formTitleConfig.formItem.visible"
|
|
72
|
+
:expandConfig="formTitleConfig.formItem"
|
|
73
|
+
></component>
|
|
74
|
+
<component
|
|
75
|
+
:is="hsFormConfigList"
|
|
76
|
+
v-if="formTitleConfig.formItem.visible && configModel.formItemType == 'form'"
|
|
77
|
+
v-model="configModel"
|
|
78
|
+
:current="currentItem"
|
|
79
|
+
@chose="onChoseItem"
|
|
80
|
+
/>
|
|
81
|
+
<!-- =={{ configModel?.form?.formData }} -->
|
|
82
|
+
</template>
|
|
83
|
+
</div>
|
|
84
|
+
<!-- grid-cols-subgrid gap-4 -->
|
|
85
|
+
<div
|
|
86
|
+
v-if="
|
|
87
|
+
(configModel?.form?.formConfig || []).length > 0 && (currentItem?.baseConfig?.list || []).length > 0 && configModel?.formItemType == 'form'
|
|
88
|
+
"
|
|
89
|
+
class="flex-none basis-1/4 ml-4"
|
|
90
|
+
>
|
|
91
|
+
<component :is="hsAttrForm" :current="currentItem" :data="configModel?.form?.formData" />
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</template>
|
|
95
|
+
<script setup lang="ts" name="formPanel">
|
|
96
|
+
import { defineModel, watch, ref } from 'vue';
|
|
97
|
+
import hsFormParse from './hsFormParse.vue'; // 一键解析
|
|
98
|
+
import hsFormConfigList from './hsFormConfigList.vue'; // 表单元素配置项集合
|
|
99
|
+
import hsAttrForm from './hsAttrForm.vue'; // 元素配置配置详情
|
|
100
|
+
import {
|
|
101
|
+
parentFormConfig,
|
|
102
|
+
emptyFormItemData,
|
|
103
|
+
formTitleConfig,
|
|
104
|
+
parentComponentConfig,
|
|
105
|
+
parentSlotConfig,
|
|
106
|
+
parentBaseConfig,
|
|
107
|
+
parentBaseFormConfig,
|
|
108
|
+
} from '../../../default/baseFormConfig'; // 表单配置方法
|
|
109
|
+
import IFormTable from '/@/types/formTable';
|
|
110
|
+
|
|
111
|
+
import hsExpand from '../../hsExpand/src/hsExpand.vue';
|
|
112
|
+
import { useVModel } from '/@/hooks/useExpose';
|
|
113
|
+
|
|
114
|
+
import _ from 'lodash';
|
|
115
|
+
const props = defineProps({
|
|
116
|
+
BaseForm: {
|
|
117
|
+
type: Object,
|
|
118
|
+
default: () => {},
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const configModel = defineModel<IFormTable.FormConfig>();
|
|
123
|
+
// emit 事件
|
|
124
|
+
const emit = defineEmits(['update:BaseForm']);
|
|
125
|
+
const BaseFormModel = useVModel(props, 'BaseForm', emit);
|
|
126
|
+
|
|
127
|
+
// 当前选中项配置
|
|
128
|
+
let currentItem = _.cloneDeep(emptyFormItemData);
|
|
129
|
+
let oldId = ref<String>('');
|
|
130
|
+
watch(
|
|
131
|
+
() => configModel.value,
|
|
132
|
+
(value) => {
|
|
133
|
+
console.log('value===>>>', value);
|
|
134
|
+
if (oldId.value != value?.config_unique_id) {
|
|
135
|
+
currentItem.value = _.cloneDeep(emptyFormItemData);
|
|
136
|
+
oldId.value = value?.config_unique_id || '';
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
immediate: true,
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
/**
|
|
144
|
+
* 选择某配置回调
|
|
145
|
+
*/
|
|
146
|
+
const onChoseItem = (item: IFormTable.ConfigItemType) => {
|
|
147
|
+
currentItem.value = item;
|
|
148
|
+
};
|
|
149
|
+
const formItemType = ref('form');
|
|
150
|
+
</script>
|
|
151
|
+
|
|
152
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
desc: 通过查询类名解析表单配置
|
|
3
|
+
author: 吕玲
|
|
4
|
+
-->
|
|
5
|
+
<template>
|
|
6
|
+
<div class="flex flex-row">
|
|
7
|
+
<hs-input class="basis-1/4 mr-2" v-model="parseApi" placeholder="请输入解析接口" />
|
|
8
|
+
<hs-button @click="parseForm" type="primary">一键解析</hs-button>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { ref, defineModel } from 'vue';
|
|
14
|
+
import _ from 'lodash';
|
|
15
|
+
import { parentFormData } from '../../../default/baseFormConfig'; // 表单配置方法
|
|
16
|
+
|
|
17
|
+
let parseApi = ref('');
|
|
18
|
+
let configModel = defineModel();
|
|
19
|
+
/**
|
|
20
|
+
* 解析表单配置
|
|
21
|
+
*/
|
|
22
|
+
const parseForm = () => {
|
|
23
|
+
configModel.value = _.assign(configModel.value, {
|
|
24
|
+
form: {
|
|
25
|
+
baseData: _.cloneDeep(parentFormData.value),
|
|
26
|
+
formData: {},
|
|
27
|
+
formConfig: [],
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { ref, Ref, watch } from 'vue';
|
|
2
|
+
import ComponentAttr from '/@/types/components';
|
|
3
|
+
import hsAttrForm from './src/hsAttrForm.vue';
|
|
4
|
+
import { ElMessage } from 'element-plus';
|
|
5
|
+
import { compConfig, formItemChildConfig } from './../../default/baseFormConfig';
|
|
6
|
+
|
|
7
|
+
interface BaseConfigRef {
|
|
8
|
+
getSubmitData: () => boolean;
|
|
9
|
+
}
|
|
10
|
+
import _ from 'lodash';
|
|
11
|
+
export function useHsAttrForm(props: ComponentAttr.Props<typeof hsAttrForm>, baseConfigRef: any) {
|
|
12
|
+
console.log('baseConfigRef===>>>>', baseConfigRef);
|
|
13
|
+
// 原始数据
|
|
14
|
+
let oldItem = ref(props.current);
|
|
15
|
+
// 当前项绑定数据
|
|
16
|
+
let formItemConfig = ref(_.cloneDeep(props.current));
|
|
17
|
+
let formData = ref(props.data);
|
|
18
|
+
/**
|
|
19
|
+
* 监听当前项
|
|
20
|
+
*/
|
|
21
|
+
watch(
|
|
22
|
+
() => props.current,
|
|
23
|
+
(value) => {
|
|
24
|
+
// 解决切换不同表单项不及时更新数据问题
|
|
25
|
+
if (value.id != formItemConfig.value.id) {
|
|
26
|
+
// console.log('value.id=====>>>>>>>', value.id, formItemConfig.value.id);
|
|
27
|
+
value.elConfig.visible = false;
|
|
28
|
+
oldItem.value = value;
|
|
29
|
+
formItemConfig.value = _.cloneDeep(value);
|
|
30
|
+
formData.value = props.data;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{ deep: true }
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
// 表单配置项
|
|
37
|
+
const parentConfig = ref({
|
|
38
|
+
labelWidth: 150,
|
|
39
|
+
span: 24,
|
|
40
|
+
style: 'padding:5px 10px',
|
|
41
|
+
});
|
|
42
|
+
// 控制表单项属性的展开关闭
|
|
43
|
+
const visible = ref(false);
|
|
44
|
+
// 基本配置属性实例
|
|
45
|
+
/**
|
|
46
|
+
* 保存功能
|
|
47
|
+
*/
|
|
48
|
+
const saveData = async function (index: number) {
|
|
49
|
+
try {
|
|
50
|
+
// 校验表单项属性
|
|
51
|
+
let flag = await baseConfigRef.value[index].getSubmitData();
|
|
52
|
+
if (!flag) return;
|
|
53
|
+
// 将默认值根据key值赋值给data中
|
|
54
|
+
// let oldKey = oldItem.value.data.baseData.prop; // 表单项【old】key值
|
|
55
|
+
// let newKey = formItemConfig.value.data.baseData.prop; // 表单项【new】key值
|
|
56
|
+
// let value = formItemConfig.value.data.elData?.attrs?.defaultValue || ''; // 表单项【new】value值
|
|
57
|
+
// // 如果修改过key后,修改后的key不能formData中的key重复
|
|
58
|
+
// if (_.has(formData.value, newKey) && newKey != oldKey) {
|
|
59
|
+
// return ElMessage.warning(`查询参数重复,请修改`);
|
|
60
|
+
// }
|
|
61
|
+
// // 如果修改了表单中字段的key值
|
|
62
|
+
// if (_.has(formData.value, oldKey) && oldKey != newKey) {
|
|
63
|
+
// delete formData.value[oldKey]; // 删除原来的key值
|
|
64
|
+
// }
|
|
65
|
+
// // 更新formData数据
|
|
66
|
+
// formData.value = Object.assign(formData.value, {
|
|
67
|
+
// [newKey]: value,
|
|
68
|
+
// });
|
|
69
|
+
// // 保存表单配置
|
|
70
|
+
oldItem.value = Object.assign(oldItem.value, _.cloneDeep(formItemConfig.value));
|
|
71
|
+
// formData.value = Object.assign(formData.value, _.cloneDeep(formItemConfig.value.data.elementItem));
|
|
72
|
+
// console.log('oldItem.value====>>>>>>>>>>>>', oldItem.value);
|
|
73
|
+
} catch (err) {
|
|
74
|
+
console.log('er', err);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
let elComName = ref<string[]>([]);
|
|
78
|
+
/**
|
|
79
|
+
* 组件类型切换回调方法
|
|
80
|
+
* @param value
|
|
81
|
+
* @param prop
|
|
82
|
+
*/
|
|
83
|
+
const onChange = function (value: string | number, prop: string, index: number) {
|
|
84
|
+
console.log('value', value, prop, formItemConfig.value.data, index);
|
|
85
|
+
if (prop != 'el') return;
|
|
86
|
+
// 关闭元素项属性
|
|
87
|
+
formItemConfig.value.elConfig.visible = false;
|
|
88
|
+
// 清空元素项数据
|
|
89
|
+
formItemConfig.value.data.elementItem[index].elData = {};
|
|
90
|
+
// 组件名称赋值
|
|
91
|
+
let typeName: string = formItemConfig.value.data.baseData.el || value + '';
|
|
92
|
+
elComName.value[index] = compConfig[typeName];
|
|
93
|
+
// 展开元素项属性
|
|
94
|
+
formItemConfig.value.elConfig.visible = true;
|
|
95
|
+
};
|
|
96
|
+
const handleTabsEdit = (targetName: string, action: string) => {
|
|
97
|
+
console.log('targetName', targetName, action);
|
|
98
|
+
if (action === 'add') {
|
|
99
|
+
// 添加元素项
|
|
100
|
+
formItemConfig.value.data.elementItem.push(_.cloneDeep(formItemChildConfig));
|
|
101
|
+
}
|
|
102
|
+
if (action === 'remove') {
|
|
103
|
+
// 删除元素项
|
|
104
|
+
formItemConfig.value.data.elementItem.splice(targetName, 1);
|
|
105
|
+
elComName.value.splice(+targetName, 1);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return { parentConfig, visible, formItemConfig, elComName, onChange, saveData, handleTabsEdit };
|
|
109
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import IFormTable from '/@/types/formTable';
|
|
3
|
+
import { Ref } from 'vue';
|
|
4
|
+
import ComponentAttr from '/@/types/components';
|
|
5
|
+
import { ElMessageBox, ElMessage } from 'element-plus';
|
|
6
|
+
import { formItemConfig, emptyFormItemData } from '../../default/baseFormConfig'; // 表单配置方法
|
|
7
|
+
import hsFormConfigList from './src/hsFormConfigList.vue';
|
|
8
|
+
import _ from 'lodash';
|
|
9
|
+
|
|
10
|
+
export function useHsFormListConfig(
|
|
11
|
+
emit: (event: 'chose', ...args: any[]) => void,
|
|
12
|
+
prop: ComponentAttr.Props<typeof hsFormConfigList>,
|
|
13
|
+
configModel: Ref<IFormTable.FormTable | undefined>
|
|
14
|
+
) {
|
|
15
|
+
/**
|
|
16
|
+
* 选择配置项
|
|
17
|
+
* @param item
|
|
18
|
+
*/
|
|
19
|
+
const choseTagItem = (item: IFormTable.ConfigItemType) => {
|
|
20
|
+
// 获取操作项
|
|
21
|
+
let current = item.id == prop.current?.id ? _.cloneDeep(emptyFormItemData.value) : item;
|
|
22
|
+
emit('chose', current);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 添加字段
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
const appendField = () => {
|
|
30
|
+
// 用时间戳设置唯一id
|
|
31
|
+
let defaultItemConfig: IFormTable.ConfigItemType = _.cloneDeep(formItemConfig.value);
|
|
32
|
+
defaultItemConfig.id = new Date().getTime().toString();
|
|
33
|
+
// 追加字段配置项
|
|
34
|
+
configModel.value?.form?.formConfig.push(defaultItemConfig);
|
|
35
|
+
// 获取新增的配置对象
|
|
36
|
+
let obj = configModel.value?.form?.formConfig[configModel.value?.form.formConfig.length - 1] || _.cloneDeep(emptyFormItemData.value);
|
|
37
|
+
// 设置默认选中
|
|
38
|
+
choseTagItem(obj);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 删除配置
|
|
43
|
+
* @param item
|
|
44
|
+
*/
|
|
45
|
+
const deleteTagItem = (item: IFormTable.ConfigItemType) => {
|
|
46
|
+
ElMessageBox.confirm(`确定删除“${item['data'] && item['data']['baseData']['label']}”字段吗?`, '提示', {
|
|
47
|
+
confirmButtonText: '确认',
|
|
48
|
+
cancelButtonText: '取消',
|
|
49
|
+
type: 'warning',
|
|
50
|
+
})
|
|
51
|
+
.then(() => {
|
|
52
|
+
// 获取被删除的配置所在id
|
|
53
|
+
_.remove(configModel.value?.form?.formConfig || [], item);
|
|
54
|
+
// 更新当前选中配置
|
|
55
|
+
choseTagItem(item);
|
|
56
|
+
// 给出操作成功提示
|
|
57
|
+
ElMessage.success('删除成功');
|
|
58
|
+
})
|
|
59
|
+
.catch((err) => {
|
|
60
|
+
console.log('err', err);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
// configList,
|
|
66
|
+
choseTagItem,
|
|
67
|
+
appendField,
|
|
68
|
+
deleteTagItem,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
// ============================= 新配置 start ==============================
|
|
3
|
+
// 表单绑定值
|
|
4
|
+
let formData = {
|
|
5
|
+
config_name: '',
|
|
6
|
+
config_unique_id: '', // new Date().getTime().toString(),
|
|
7
|
+
};
|
|
8
|
+
// 表单校验规则
|
|
9
|
+
const formRule = {
|
|
10
|
+
config_name: [{ required: true, message: '请输入配置名称' }],
|
|
11
|
+
config_unique_id: [{ required: true, message: '请输入配置标识' }],
|
|
12
|
+
};
|
|
13
|
+
// 表单配置项
|
|
14
|
+
const formConfig = [
|
|
15
|
+
{
|
|
16
|
+
prop: 'config_name',
|
|
17
|
+
label: '配置名称',
|
|
18
|
+
el: 'hs-input',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
prop: 'config_unique_id',
|
|
23
|
+
label: '配置标识',
|
|
24
|
+
el: 'hs-input',
|
|
25
|
+
show: false,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
const newConfig = {
|
|
30
|
+
formData,
|
|
31
|
+
formRule,
|
|
32
|
+
formConfig,
|
|
33
|
+
};
|
|
34
|
+
// ============================= 新配置 end ==============================
|
|
35
|
+
// ============================= 选择配置 start ==============================
|
|
36
|
+
// 表单绑定值
|
|
37
|
+
let selectFormData = {
|
|
38
|
+
name: '',
|
|
39
|
+
config_name: '',
|
|
40
|
+
config_unique_id: '', // new Date().getTime().toString(),
|
|
41
|
+
};
|
|
42
|
+
// 表单配置项
|
|
43
|
+
const selectFormConfig = [
|
|
44
|
+
{
|
|
45
|
+
prop: 'name',
|
|
46
|
+
label: '配置',
|
|
47
|
+
el: 'hs-select',
|
|
48
|
+
cel: 'hs-option',
|
|
49
|
+
multiple: false,
|
|
50
|
+
clearable: false,
|
|
51
|
+
op: [
|
|
52
|
+
// { label: ' 配置1', value: 'left' },
|
|
53
|
+
// { label: '配置2', value: 'right' },
|
|
54
|
+
// { label: '配置3', value: 'top' },
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
const selectConfig = {
|
|
60
|
+
formData: selectFormData,
|
|
61
|
+
formRule: formRule,
|
|
62
|
+
formConfig: _.concat(selectFormConfig, formConfig),
|
|
63
|
+
};
|
|
64
|
+
// ============================= 选择配置 end ==============================
|
|
65
|
+
|
|
66
|
+
export { newConfig, selectConfig };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex justify-around items-center">
|
|
3
|
+
<component
|
|
4
|
+
class="basis-3/4"
|
|
5
|
+
ref="saveFormRef"
|
|
6
|
+
:parentConfig="parentConfig"
|
|
7
|
+
:is="'bc-form-config'"
|
|
8
|
+
:data="formConfig.formData"
|
|
9
|
+
:config="formConfig.formConfig"
|
|
10
|
+
:rules="formConfig.formRule"
|
|
11
|
+
:watchConfig="true"
|
|
12
|
+
@change="changeConfig"
|
|
13
|
+
></component>
|
|
14
|
+
|
|
15
|
+
<div class="basis-1/4 flex justify-end">
|
|
16
|
+
<hs-button v-if="!isEdit || (isEdit && formConfig.formData.config_name)" @click="saveConfig" type="primary">保存配置</hs-button>
|
|
17
|
+
<!-- <hs-button v-if="isEdit" @click="addConfig">新增配置</hs-button> -->
|
|
18
|
+
<hs-button v-if="!isEdit" @click="cancel">取消</hs-button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import { ref } from 'vue';
|
|
25
|
+
import IFormTable from '/@/types/formTable';
|
|
26
|
+
|
|
27
|
+
import { useSaveForm } from './../useSaveForm';
|
|
28
|
+
defineOptions({
|
|
29
|
+
inheritAttrs: false,
|
|
30
|
+
});
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
configs: {
|
|
33
|
+
type: Array<IFormTable.FormTable>,
|
|
34
|
+
default: [],
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const saveFormRef = ref();
|
|
39
|
+
|
|
40
|
+
const emits = defineEmits(['save', 'change']);
|
|
41
|
+
|
|
42
|
+
const { parentConfig, formConfig, isEdit, saveConfig, changeConfig, initConfig, addConfig, cancel } = useSaveForm(emits, saveFormRef, props);
|
|
43
|
+
// 暴露内部方法
|
|
44
|
+
defineExpose({
|
|
45
|
+
initConfig,
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Ref, ref } from 'vue';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
import ComponentAttr from '/@/types/components';
|
|
4
|
+
import IFormTable from '/@/types/formTable';
|
|
5
|
+
import { newConfig, selectConfig } from './saveFormConfig';
|
|
6
|
+
import saveForm from './src/saveForm.vue';
|
|
7
|
+
interface BcFormRef {
|
|
8
|
+
getSubmitData: () => boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function useSaveForm(
|
|
12
|
+
emits: (event: 'save' | 'change', ...args: any[]) => void,
|
|
13
|
+
saveFormRef: Ref<BcFormRef>,
|
|
14
|
+
props: ComponentAttr.Props<typeof saveForm>
|
|
15
|
+
) {
|
|
16
|
+
const parentConfig = ref({
|
|
17
|
+
showColon: true,
|
|
18
|
+
xs: 8,
|
|
19
|
+
sm: 8,
|
|
20
|
+
md: 8,
|
|
21
|
+
lg: 8,
|
|
22
|
+
xl: 8,
|
|
23
|
+
});
|
|
24
|
+
// 区分当前是新增还是修改
|
|
25
|
+
let isEdit = ref(true);
|
|
26
|
+
// 配置表单
|
|
27
|
+
let formConfig = ref(
|
|
28
|
+
_.assign(_.cloneDeep(selectConfig), {
|
|
29
|
+
formData: {
|
|
30
|
+
name: '',
|
|
31
|
+
config_name: '',
|
|
32
|
+
config_unique_id: new Date().getTime().toString(),
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
// formConfig.value.formData.config_unique_id = new Date().getTime().toString();
|
|
37
|
+
/**
|
|
38
|
+
* 切换配置方法
|
|
39
|
+
* @param value
|
|
40
|
+
* @param type
|
|
41
|
+
*/
|
|
42
|
+
const changeConfig = (value: string, type: string) => {
|
|
43
|
+
// 初始化表格表单配置
|
|
44
|
+
if (type == 'name') {
|
|
45
|
+
let config = _.cloneDeep(props.configs).find((item: IFormTable.FormTable) => item.config_unique_id == value);
|
|
46
|
+
formConfig.value.formData = _.assign(formConfig.value.formData, {
|
|
47
|
+
config_name: config.config_name,
|
|
48
|
+
config_unique_id: config.config_unique_id,
|
|
49
|
+
});
|
|
50
|
+
emits('change', config);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 初始化配置
|
|
55
|
+
* @param configList
|
|
56
|
+
*/
|
|
57
|
+
const initConfig = (configList: Array<IFormTable.FormTable>) => {
|
|
58
|
+
// 更新表单数据
|
|
59
|
+
let tempFormConfig = _.cloneDeep(selectConfig);
|
|
60
|
+
tempFormConfig.formData.name = (configList[0] && configList[0].config_name) || '';
|
|
61
|
+
tempFormConfig.formData.config_name = (configList[0] && configList[0].config_name) || '';
|
|
62
|
+
tempFormConfig.formData.config_unique_id = (configList[0] && configList[0].config_unique_id) || new Date().getTime().toString();
|
|
63
|
+
// 更新表单配置
|
|
64
|
+
if (configList.length > 0) {
|
|
65
|
+
let list = configList.map((item: IFormTable.FormTable) => {
|
|
66
|
+
return { label: item.config_name, value: item.config_unique_id };
|
|
67
|
+
});
|
|
68
|
+
let item = _.assign(tempFormConfig.formConfig[0], {
|
|
69
|
+
op: list,
|
|
70
|
+
});
|
|
71
|
+
tempFormConfig.formConfig.splice(0, 1, item);
|
|
72
|
+
}
|
|
73
|
+
formConfig.value = tempFormConfig;
|
|
74
|
+
// 编辑类型 改为true
|
|
75
|
+
isEdit.value = true;
|
|
76
|
+
// 初始化表格配置
|
|
77
|
+
let initConfig = {
|
|
78
|
+
tables: [{ id: 'table_' + new Date().getTime().toString(), baseData: { id: '', tableName: '表格配置名称' }, tableConfig: [] }],
|
|
79
|
+
btns: [],
|
|
80
|
+
};
|
|
81
|
+
// 初始化表格表单配置
|
|
82
|
+
emits('change', configList[0] || initConfig);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 保存配置
|
|
87
|
+
*/
|
|
88
|
+
const saveConfig = async () => {
|
|
89
|
+
let flag = await saveFormRef.value.getSubmitData();
|
|
90
|
+
if (flag) {
|
|
91
|
+
emits('save', formConfig.value.formData);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* 新增配置
|
|
96
|
+
*/
|
|
97
|
+
const addConfig = () => {
|
|
98
|
+
// 将编辑类型改为false
|
|
99
|
+
isEdit.value = false;
|
|
100
|
+
|
|
101
|
+
// 更新保存配置
|
|
102
|
+
formConfig.value = _.cloneDeep(newConfig);
|
|
103
|
+
formConfig.value.formData.config_unique_id = new Date().getTime().toString();
|
|
104
|
+
|
|
105
|
+
// 初始化表格配置
|
|
106
|
+
let initConfig = {
|
|
107
|
+
tables: [{ id: 'table_' + new Date().getTime().toString(), baseData: { id: '', tableName: '表格配置名称' }, tableConfig: [] }],
|
|
108
|
+
btns: [],
|
|
109
|
+
};
|
|
110
|
+
// 初始化表格表单配置
|
|
111
|
+
emits('change', initConfig);
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* 取消新增配置
|
|
115
|
+
*/
|
|
116
|
+
const cancel = () => {
|
|
117
|
+
// 初始化配置
|
|
118
|
+
initConfig(_.cloneDeep(props.configs));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return { parentConfig, formConfig, isEdit, saveConfig, changeConfig, initConfig, addConfig, cancel };
|
|
122
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="h-full">
|
|
3
|
+
<div style="height: 94%" class="overflow-y-auto">
|
|
4
|
+
<!-- {{ tableItemConfig?.data }} -->
|
|
5
|
+
<component v-model="visible" :is="hsExpand" :expandConfig="{ subTitle: '表格属性' }"></component>
|
|
6
|
+
<component
|
|
7
|
+
v-show="visible"
|
|
8
|
+
:parentConfig="parentConfig"
|
|
9
|
+
:is="'bc-form-config'"
|
|
10
|
+
:data="tableItemConfig?.data"
|
|
11
|
+
:config="tableItemConfig?.list"
|
|
12
|
+
ref="baseTableRef"
|
|
13
|
+
:rules="tableColumnRule"
|
|
14
|
+
>
|
|
15
|
+
<template #title>
|
|
16
|
+
<hs-autocomplete
|
|
17
|
+
v-model="tableItemConfig.data.title"
|
|
18
|
+
clearable
|
|
19
|
+
class="inline-input w-50"
|
|
20
|
+
placeholder="请输入"
|
|
21
|
+
ref="hsAutocompleteRef"
|
|
22
|
+
:fetch-suggestions="querySearchAsync"
|
|
23
|
+
@select="handleSelect"
|
|
24
|
+
></hs-autocomplete>
|
|
25
|
+
</template>
|
|
26
|
+
</component>
|
|
27
|
+
<div v-for="(item, index) in tableItemConfig?.second_config" :key="index">
|
|
28
|
+
<component v-model="item.visible" :is="hsExpand" :expandConfig="{ subTitle: item.title }"></component>
|
|
29
|
+
<component
|
|
30
|
+
v-if="item.visible"
|
|
31
|
+
:parentConfig="parentConfig"
|
|
32
|
+
:is="'bc-form-config'"
|
|
33
|
+
:config="item[item.key]"
|
|
34
|
+
:data="tableItemConfig?.data[item.key]"
|
|
35
|
+
></component>
|
|
36
|
+
</div>
|
|
37
|
+
<div>
|
|
38
|
+
<div v-for="(item, index) in tableItemConfig?.filterConfig" :key="index">
|
|
39
|
+
<!-- {{ tableItemConfig?.data.filters }} -->
|
|
40
|
+
<component v-model="item.visible" :is="hsExpand" :expandConfig="{ subTitle: item.title }"></component>
|
|
41
|
+
<!-- {{ tableItemConfig?.data.filters[index] }} -->
|
|
42
|
+
<component
|
|
43
|
+
v-if="item.visible"
|
|
44
|
+
:parentConfig="parentConfig"
|
|
45
|
+
:is="'bc-form-config'"
|
|
46
|
+
:config="item[item.key]"
|
|
47
|
+
:data="tableItemConfig?.data.filters[index]"
|
|
48
|
+
></component>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="flex align-center justify-center p-2" @click="addFilterItem">
|
|
51
|
+
<div class="bg-red-200 py-1 px-3 rounded">新增数据筛选配置</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="text-center" style="height: 40px">
|
|
56
|
+
<hs-button @click="saveData" type="primary">保存</hs-button>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import { ref } from 'vue';
|
|
63
|
+
// import _ from 'lodash';
|
|
64
|
+
import IFormTable from '/@/types/formTable';
|
|
65
|
+
import hsExpand from '../../hsExpand/src/hsExpand.vue';
|
|
66
|
+
import { useHsAttrTable } from './../useAttrTable';
|
|
67
|
+
import { tableColumnRule } from '../../../default/baseTableConfig';
|
|
68
|
+
|
|
69
|
+
// const tableItemConfig = defineModel<IFormTable.TableItem>();
|
|
70
|
+
|
|
71
|
+
const props = defineProps({
|
|
72
|
+
current: {
|
|
73
|
+
type: Object,
|
|
74
|
+
default: () => {},
|
|
75
|
+
},
|
|
76
|
+
configList: {
|
|
77
|
+
type: Array<IFormTable.TableItem>,
|
|
78
|
+
default: () => [],
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
let baseTableRef = ref();
|
|
82
|
+
// 权限
|
|
83
|
+
// 是否显示
|
|
84
|
+
// 插槽
|
|
85
|
+
// 列名称模糊查询
|
|
86
|
+
// 默认值
|
|
87
|
+
|
|
88
|
+
const { parentConfig, visible, tableItemConfig, querySearchAsync, handleSelect, addFilterItem, saveData } = useHsAttrTable(props, baseTableRef);
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<style lang="scss" scoped></style>
|