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,119 @@
|
|
|
1
|
+
import { onKeyStroke } from '@vueuse/core';
|
|
2
|
+
import ComponentAttr from '/@/types/components';
|
|
3
|
+
import ICustomData from '/@/types/customData';
|
|
4
|
+
import { fetchTableData } from '/@parseTable';
|
|
5
|
+
import BcFormTable from '../bcFormTable.vue';
|
|
6
|
+
import { VxeTableInstance, VxePagerDefines } from 'vxe-table';
|
|
7
|
+
import { Ref, reactive, computed, toValue } from 'vue';
|
|
8
|
+
import _ from 'lodash';
|
|
9
|
+
|
|
10
|
+
export const tableIndex = reactive({
|
|
11
|
+
rowIndex: 0,
|
|
12
|
+
columnIndex: 0,
|
|
13
|
+
});
|
|
14
|
+
export function onTableKey(
|
|
15
|
+
formRef: Ref<ICustomData.ANY>,
|
|
16
|
+
tablesRef: Ref<Record<string, VxeTableInstance>>,
|
|
17
|
+
activeTabs: Ref<string>,
|
|
18
|
+
props: ComponentAttr.Props<typeof BcFormTable>
|
|
19
|
+
) {
|
|
20
|
+
const tableRef = computed(() => tablesRef.value[activeTabs.value]);
|
|
21
|
+
const cursor = ['checkbox', 'expand', 'radio', 'seq'];
|
|
22
|
+
const menuTable = [
|
|
23
|
+
{ label: '右键1', value: '111' },
|
|
24
|
+
{ label: '右键2', value: '222' },
|
|
25
|
+
{ label: '右键3', value: '333' },
|
|
26
|
+
{ label: '右键4', value: '444' },
|
|
27
|
+
{ label: '右键5', value: '555' },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
function setFocus() {
|
|
31
|
+
const row = tableRef.value?.getData(tableIndex.rowIndex);
|
|
32
|
+
// 获取可视列数据
|
|
33
|
+
const { visibleColumn } = tableRef.value!.getTableColumn();
|
|
34
|
+
const columnField = visibleColumn[tableIndex.columnIndex].field;
|
|
35
|
+
tableRef.value?.setCurrentRow(row); // 设置当前行
|
|
36
|
+
tableRef.value?.setEditRow(row, columnField).then(() => {
|
|
37
|
+
const { rowIndex, columnIndex } = tableRef.value!.getEditRecord()!;
|
|
38
|
+
tableIndex.rowIndex = rowIndex ?? 0;
|
|
39
|
+
tableIndex.columnIndex = columnIndex ?? 0;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 分页加载
|
|
44
|
+
async function onPageChange(params: VxePagerDefines.PageChangeEventParams) {
|
|
45
|
+
const table = props.data!.tables.find((i) => i.id === activeTabs.value)!;
|
|
46
|
+
const pager = table.baseData.table_page_data;
|
|
47
|
+
pager!.currentPage = params.currentPage;
|
|
48
|
+
table.tableData = await fetchTableData(pager!, props.data!.form!.formData);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 键盘右移动
|
|
52
|
+
onKeyStroke('ArrowRight', (e) => {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
const activeElement = document.activeElement as Element;
|
|
55
|
+
if (!activeElement.closest('.bc-table__content')) return;
|
|
56
|
+
const { visibleColumn } = tableRef.value!.getTableColumn();
|
|
57
|
+
tableIndex.columnIndex++;
|
|
58
|
+
if (tableIndex.columnIndex > visibleColumn.length - 1) {
|
|
59
|
+
tableIndex.columnIndex = 0;
|
|
60
|
+
}
|
|
61
|
+
if (cursor.includes(visibleColumn[tableIndex.columnIndex]?.type as string)) {
|
|
62
|
+
const num = visibleColumn.filter((i) => i.type).length;
|
|
63
|
+
tableIndex.columnIndex = tableIndex.columnIndex + num;
|
|
64
|
+
}
|
|
65
|
+
setFocus();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// 键盘左移动
|
|
69
|
+
onKeyStroke('ArrowLeft', (e) => {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
const activeElement = document.activeElement as Element;
|
|
72
|
+
if (!activeElement.closest('.bc-table__content')) return;
|
|
73
|
+
const { visibleColumn } = tableRef.value!.getTableColumn();
|
|
74
|
+
tableIndex.columnIndex--;
|
|
75
|
+
if (cursor.includes(visibleColumn[tableIndex.columnIndex]?.type as string)) {
|
|
76
|
+
const num = visibleColumn.filter((i) => i.type).length;
|
|
77
|
+
tableIndex.columnIndex = tableIndex.columnIndex - num;
|
|
78
|
+
}
|
|
79
|
+
if (tableIndex.columnIndex < 0) {
|
|
80
|
+
tableIndex.columnIndex = visibleColumn.length - 1;
|
|
81
|
+
}
|
|
82
|
+
setFocus();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// 键盘上移动
|
|
86
|
+
onKeyStroke('ArrowUp', (e) => {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
const activeElement = document.activeElement as Element;
|
|
89
|
+
if (!activeElement.closest('.bc-table__content')) return;
|
|
90
|
+
const tableData = tableRef.value!.getData();
|
|
91
|
+
tableIndex.rowIndex--;
|
|
92
|
+
if (tableIndex.rowIndex < 0) {
|
|
93
|
+
// 1. 表格循环上下切换
|
|
94
|
+
tableIndex.rowIndex = tableData.length - 1;
|
|
95
|
+
// 2. 切换表单查询
|
|
96
|
+
// tableIndex.rowIndex = 0
|
|
97
|
+
// _.get(toValue(formRef), 'componentRef.0')?.focus();
|
|
98
|
+
}
|
|
99
|
+
setFocus();
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// 键盘下移动
|
|
103
|
+
onKeyStroke('ArrowDown', (e) => {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
const activeElement = document.activeElement as Element;
|
|
106
|
+
if (!activeElement.closest('.bc-table__content')) return;
|
|
107
|
+
const tableData = tableRef.value!.getData();
|
|
108
|
+
tableIndex.rowIndex++;
|
|
109
|
+
if (tableIndex.rowIndex > tableData.length - 1) {
|
|
110
|
+
tableIndex.rowIndex = 0;
|
|
111
|
+
}
|
|
112
|
+
setFocus();
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
menuTable,
|
|
117
|
+
onPageChange,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import { Ref, ComputedRef } from 'vue';
|
|
3
|
+
import { VxeTableInstance, VxePagerProps } from 'vxe-table';
|
|
4
|
+
import { Component } from '/@/components/component';
|
|
5
|
+
import IFormTable from '/@/types/formTable';
|
|
6
|
+
import IFormData from '/@/types/form';
|
|
7
|
+
import ICustomData from '/@/types/customData';
|
|
8
|
+
import { formStore } from '/@/utils/storage';
|
|
9
|
+
import { getFormDataType } from '/@/utils/getDataType';
|
|
10
|
+
import { getTableDataType } from '/@/utils/getDataType';
|
|
11
|
+
import CustomeMethods from '../methods';
|
|
12
|
+
|
|
13
|
+
/** 对外导出表格参数实例 */
|
|
14
|
+
export interface TableParams {
|
|
15
|
+
tableApi: Ref<Record<string, VxeTableInstance>>;
|
|
16
|
+
activeTabs: Ref<string>;
|
|
17
|
+
api: ComputedRef<VxeTableInstance>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** 递归遍历属性,设置更新值 */
|
|
21
|
+
export function setPropertyData<T extends IFormTable.Data>(params: T) {
|
|
22
|
+
const method = /method=/;
|
|
23
|
+
const string = /string=/;
|
|
24
|
+
|
|
25
|
+
function setProperty(property: T) {
|
|
26
|
+
for (let i in property) {
|
|
27
|
+
// 1.解析自定义方法
|
|
28
|
+
if (method.test(property[`${i}_2`])) {
|
|
29
|
+
property[i] = CustomeMethods[property[`${i}_2`].split('=')[1]];
|
|
30
|
+
} else if (method.test(property[i]) && property[i].split('=')[1]) {
|
|
31
|
+
(property as ICustomData.ANY)[`${i}_2`] = property[i];
|
|
32
|
+
property[i] = CustomeMethods[property[i].split('=')[1]];
|
|
33
|
+
}
|
|
34
|
+
// 2.解析自定义数据
|
|
35
|
+
if (string.test(property[i])) {
|
|
36
|
+
if (property[i].split('=')[1]) {
|
|
37
|
+
property[i] = new Function('return ' + property[i].split('=')[1])();
|
|
38
|
+
} else {
|
|
39
|
+
(property as ICustomData.ANY)[i] = [];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (_.isObject(property[i]) && !_.isEmpty(property[i])) {
|
|
43
|
+
setProperty(property[i]);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
setProperty(params);
|
|
48
|
+
|
|
49
|
+
return params;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** 根据权限获取是否显示 */
|
|
53
|
+
function getAuth(config: ICustomData.FormItemConfigData['baseData']) {
|
|
54
|
+
if (!config.isShow) return false;
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function getRender(el: Component) {
|
|
59
|
+
// 解析下拉框
|
|
60
|
+
if (el === 'hs-select') return 'bc-select';
|
|
61
|
+
// 解析下拉树组件
|
|
62
|
+
if (el === 'hs-tree-select') return 'bc-tree-select';
|
|
63
|
+
return el;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** 格式化搜索区域表单数据 */
|
|
67
|
+
export async function getSearchForm<T = ICustomData.Form>(data: ICustomData.FormTable): Promise<T> {
|
|
68
|
+
if (!data.form) return Promise.resolve({} as T);
|
|
69
|
+
// 获取缓存类配置项信息
|
|
70
|
+
const { form } = await formStore.get<ICustomData.FormTable>(data.config_unique_id);
|
|
71
|
+
const formConfig = form?.formConfig.filter((i) => {
|
|
72
|
+
const isShow = getAuth(i.data.baseData);
|
|
73
|
+
if (isShow) {
|
|
74
|
+
// 解构属性数据
|
|
75
|
+
const elData = setPropertyData(i.data.elData);
|
|
76
|
+
i.data.elData = {
|
|
77
|
+
...elData.attrs,
|
|
78
|
+
..._.omit(elData, 'attrs'),
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
i.data.baseData.el = getRender(i.data.baseData.el);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return isShow;
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const baseData = _.omit(setPropertyData(data.form.baseData), ['inline', 'gutter', 'justify', 'align']);
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
baseData,
|
|
91
|
+
formConfig,
|
|
92
|
+
formData: data.form.formData,
|
|
93
|
+
} as T;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function getTableDatas<T = ICustomData.Table[]>(params: ICustomData.FormTable) {
|
|
97
|
+
const tables = params.tables.map((i) => getTableCache(i, params));
|
|
98
|
+
return Promise.all(tables) as Promise<T>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** 获取表格缓存本地列配置信息 */
|
|
102
|
+
async function getTableCache(data: ICustomData.Table, config: ICustomData.FormTable) {
|
|
103
|
+
const result = await formStore.get<ICustomData.FormTable>(config.config_unique_id);
|
|
104
|
+
const cache = result?.tables?.find((i) => i.id === data.id);
|
|
105
|
+
if (!cache) {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const table = await getTableData(cache, config.form!.formData);
|
|
110
|
+
return table;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** 格式化表数据 */
|
|
114
|
+
export async function getTableData(data: ICustomData.Table, formData: ICustomData.Form['formData']) {
|
|
115
|
+
const params = _.cloneDeep(data) as ICustomData.Table;
|
|
116
|
+
params.baseData = setPropertyData(_.omit(params.baseData, 'data'));
|
|
117
|
+
params.tableConfig = params.tableConfig.filter((i) => {
|
|
118
|
+
const isShow = getAuth(i.data as ICustomData.ANY);
|
|
119
|
+
|
|
120
|
+
if (isShow) {
|
|
121
|
+
i.data = setPropertyData(i.data);
|
|
122
|
+
i.btnData = i.btnData?.map((i) => setPropertyData(i)) || [];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return isShow;
|
|
126
|
+
});
|
|
127
|
+
const tableData = await fetchTableData(params.baseData.table_page_data!, formData);
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
id: params.id,
|
|
131
|
+
baseData: params.baseData,
|
|
132
|
+
tableConfig: params.tableConfig,
|
|
133
|
+
tableData,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** 调用接口获取表格数据 */
|
|
138
|
+
export async function fetchTableData(pager: VxePagerProps, formData: ICustomData.Form['formData']) {
|
|
139
|
+
pager.pagerCount = 2;
|
|
140
|
+
pager.total = 18;
|
|
141
|
+
const item = (i: number) => {
|
|
142
|
+
return {
|
|
143
|
+
order_no: i,
|
|
144
|
+
order_type: i,
|
|
145
|
+
pay_state: i,
|
|
146
|
+
commodity_no: i,
|
|
147
|
+
common_name: i,
|
|
148
|
+
btns: i,
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
if (pager.currentPage === 2) {
|
|
152
|
+
return Array.from({ length: 8 }, (_, i) => item(i));
|
|
153
|
+
}
|
|
154
|
+
return Array.from({ length: 10 }, (_, i) => item(i));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** 接口数据
|
|
158
|
+
* 1. 获取配置项目
|
|
159
|
+
* 2. 加载权限数据
|
|
160
|
+
* 3. 整合配置数据信息
|
|
161
|
+
* 4. 根据配置项获取数据
|
|
162
|
+
*/
|
|
163
|
+
export async function getLoadData(data: ICustomData.FormTable) {
|
|
164
|
+
const config = _.cloneDeep(data) as ICustomData.FormTable;
|
|
165
|
+
// 1.更新原始缓存
|
|
166
|
+
await formStore.set(`${config.config_unique_id}_origin`, config);
|
|
167
|
+
// 2.获取当前缓存
|
|
168
|
+
const cache = await formStore.get<ICustomData.FormTable>(config.config_unique_id);
|
|
169
|
+
if (!cache) {
|
|
170
|
+
await formStore.set(config.config_unique_id, config);
|
|
171
|
+
}
|
|
172
|
+
const form = await getSearchForm(config);
|
|
173
|
+
const tables = await getTableDatas(config);
|
|
174
|
+
|
|
175
|
+
if (__IS_DEV__) {
|
|
176
|
+
getTableDataType(tables);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
...config,
|
|
181
|
+
form,
|
|
182
|
+
tables,
|
|
183
|
+
} as ICustomData.FormTable;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export function getFormData(data: IFormData.Form) {
|
|
187
|
+
const result = _.cloneDeep(data) as IFormData.Form;
|
|
188
|
+
const form = result.form.map((i) => {
|
|
189
|
+
i.config = setPropertyData(i.config);
|
|
190
|
+
return i;
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
if (__IS_DEV__) {
|
|
194
|
+
console.debug(getFormDataType(result));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return {
|
|
198
|
+
...result,
|
|
199
|
+
form,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import ICustomData from '/@/types/customData';
|
|
2
|
+
import ComponentAttr from '/@/types/components';
|
|
3
|
+
import { Ref, ComputedRef, computed } from 'vue';
|
|
4
|
+
import { VxeTableInstance } from 'vxe-table';
|
|
5
|
+
import BcFormTable from '../bcFormTable.vue';
|
|
6
|
+
|
|
7
|
+
export function useButon(
|
|
8
|
+
formRef: Ref<ICustomData.ANY>,
|
|
9
|
+
tablesRef: Ref<Record<string, VxeTableInstance>>,
|
|
10
|
+
activeTabs: Ref<string>,
|
|
11
|
+
props: ComponentAttr.Props<typeof BcFormTable>
|
|
12
|
+
) {
|
|
13
|
+
const btns: ComputedRef<ICustomData.Btns[]> = computed(() => {
|
|
14
|
+
return props.data?.btns || [];
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
btns,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { computed, ref, nextTick } from 'vue';
|
|
2
|
+
import { VxeTableInstance } from 'vxe-table';
|
|
3
|
+
import { useElementSize } from '@vueuse/core';
|
|
4
|
+
|
|
5
|
+
export function useTableHeight() {
|
|
6
|
+
const isOverHide = ref(false); // 解决切换查询条件时,出现滚动条造成弹屏问题
|
|
7
|
+
const wrapRef = ref<HTMLElement>();
|
|
8
|
+
const btnRef = ref<HTMLElement>();
|
|
9
|
+
const formRef = ref<HTMLElement>();
|
|
10
|
+
const tableApi = ref<Record<string, VxeTableInstance>>({});
|
|
11
|
+
|
|
12
|
+
const { height: wrapHeight } = useElementSize(wrapRef);
|
|
13
|
+
const { height: btnHeight } = useElementSize(btnRef, { height: 0, width: 0 });
|
|
14
|
+
const { height: formHeight } = useElementSize(formRef, { height: 0, width: 0 });
|
|
15
|
+
|
|
16
|
+
const style = computed(() => {
|
|
17
|
+
const height = wrapHeight.value > 0 ? `${wrapHeight.value - btnHeight.value - formHeight.value}px` : '0px';
|
|
18
|
+
return {
|
|
19
|
+
height,
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function onReady(api: VxeTableInstance, id: string) {
|
|
24
|
+
tableApi.value[id] = api;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function onHeightChange() {
|
|
28
|
+
isOverHide.value = true;
|
|
29
|
+
nextTick(() => {
|
|
30
|
+
isOverHide.value = false;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
wrapRef,
|
|
36
|
+
btnRef,
|
|
37
|
+
formRef,
|
|
38
|
+
tableApi,
|
|
39
|
+
style,
|
|
40
|
+
isOverHide,
|
|
41
|
+
onReady,
|
|
42
|
+
onHeightChange,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col h-full">
|
|
3
|
+
<div class="flex-1 system-user-container" style="height: 300px">
|
|
4
|
+
<hs-tabs ref="tabsRef" v-model="tabsActiveName" class="h-full tabs" type="border-card" addable @edit="handleTabsEdit">
|
|
5
|
+
<hs-tab-pane class="tab-pane" label="按钮配置" name="btn">
|
|
6
|
+
<component :is="hsBtnPanel" v-model="panelConfig.btns" />
|
|
7
|
+
</hs-tab-pane>
|
|
8
|
+
<hs-tab-pane class="tab-pane" label="查询条件配置" name="form">
|
|
9
|
+
<component :is="hsFormPanel" v-model="panelConfig" />
|
|
10
|
+
</hs-tab-pane>
|
|
11
|
+
<hs-tab-pane
|
|
12
|
+
v-for="(item, index) in panelConfig.tables"
|
|
13
|
+
:key="index"
|
|
14
|
+
class="tab-pane"
|
|
15
|
+
:label="item.baseData['tableName'] || '表格配置名称'"
|
|
16
|
+
:name="item.id"
|
|
17
|
+
closable
|
|
18
|
+
>
|
|
19
|
+
<component :is="hsTablePanels" closable v-model="panelConfig.tables[index]" />
|
|
20
|
+
</hs-tab-pane>
|
|
21
|
+
</hs-tabs>
|
|
22
|
+
</div>
|
|
23
|
+
<component :configs="configs" ref="saveFormRef" :is="saveForm" @change="changeConfig" @save="saveFormTableConfig"></component>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { ref } from 'vue';
|
|
29
|
+
import hsFormPanel from './components/hsForm/src/hsFormPanel.vue';
|
|
30
|
+
// import hsTablePanel from './components/hsTable/src/hsTablePanel.vue';
|
|
31
|
+
import IFormTable from '/@/types/formTable';
|
|
32
|
+
import hsTablePanels from './components/hsTables/src/hsTablePanel.vue';
|
|
33
|
+
import hsBtnPanel from './components/hsBtn/src/hsBtnPanel.vue';
|
|
34
|
+
import saveForm from './components/hsSaveForm/src/saveForm.vue';
|
|
35
|
+
import { useHsPageConfig } from './usePageConfig'; //'./usePageConfig';
|
|
36
|
+
|
|
37
|
+
let panelConfig = ref<IFormTable.FormTable>({
|
|
38
|
+
id: '', // 配置id
|
|
39
|
+
config_type: '1', // 配置类型
|
|
40
|
+
config_unique_id: '', // 配置唯一标识
|
|
41
|
+
config_name: '', // 配置名称
|
|
42
|
+
btns: [], // 按钮配置
|
|
43
|
+
tables: [
|
|
44
|
+
{
|
|
45
|
+
id: 'table_' + new Date().getTime().toString(),
|
|
46
|
+
baseData: { id: '', tableName: '表格配置名称' },
|
|
47
|
+
tableConfig: [],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
});
|
|
51
|
+
// 页面所在的所有配置
|
|
52
|
+
let configs = ref<Array<IFormTable.FormTable>>([]);
|
|
53
|
+
let saveFormRef = ref();
|
|
54
|
+
const emits = defineEmits(['refresh']);
|
|
55
|
+
|
|
56
|
+
// 将方法暴露
|
|
57
|
+
const { handleTabsEdit, saveFormTableConfig, changeConfig, initData, tabsActiveName } = useHsPageConfig(panelConfig, configs, saveFormRef, emits);
|
|
58
|
+
defineExpose({ initData });
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style scoped lang="scss">
|
|
62
|
+
.system-user-container {
|
|
63
|
+
:deep(.el-card__body) {
|
|
64
|
+
height: 100% !important;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:deep(.el-tabs__content) {
|
|
68
|
+
height: calc(100% - 39px);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
.tabs {
|
|
72
|
+
:deep(.el-tabs__new-tab) {
|
|
73
|
+
margin: 10px 10px 10px 0px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
.tab-pane {
|
|
77
|
+
height: 100% !important;
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bg-blue-200 h-full flex flex-col">
|
|
3
|
+
<div style="height: calc(100% -50px)" class="overflow-y-auto flex-1">
|
|
4
|
+
<component :is="hsExpand" v-model="visible" :expandConfig="{ subTitle: '按钮项代码' }"></component>
|
|
5
|
+
<div v-if="visible">
|
|
6
|
+
{{ btnItemConfig }}
|
|
7
|
+
</div>
|
|
8
|
+
<component :is="hsExpand" v-model="btnConfig.visible" :expandConfig="btnConfig.title"></component>
|
|
9
|
+
<component :is="hsBtnItemConfig" v-show="btnConfig.visible" ref="btnItemRef" v-model="btnItemConfig.data" :config="btnConfig"></component>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<div class="text-center grow-0" style="height: 50rpx">
|
|
13
|
+
<hs-button @click="saveData" type="primary">保存</hs-button>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { ref } from 'vue';
|
|
20
|
+
import hsExpand from '../../hsExpand/src/hsExpand.vue';
|
|
21
|
+
import hsBtnItemConfig from './hsBtnItemConfig.vue';
|
|
22
|
+
import { useHsAttrBtn } from './../useAttrBtn';
|
|
23
|
+
import IFormTable from '/@/types/formTable';
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
current: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: () => {},
|
|
28
|
+
},
|
|
29
|
+
btnList: {
|
|
30
|
+
type: Array<IFormTable.BtnItem>,
|
|
31
|
+
default: () => [],
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
const btnItemRef = ref();
|
|
35
|
+
const { visible, btnItemConfig, btnConfig, saveData } = useHsAttrBtn(props, btnItemRef);
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style lang="scss" scoped></style>
|
|
39
|
+
<!-- -->
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
desc: 表单配置项集合
|
|
3
|
+
author: lvling
|
|
4
|
+
-->
|
|
5
|
+
<template>
|
|
6
|
+
<div>
|
|
7
|
+
<div class="flex flex-wrap">
|
|
8
|
+
<div class="p-2 relative" v-for="(item, index) in btnsModel" :key="index" @click="choseTagItem(item)">
|
|
9
|
+
<div class="border border-solid border-zinc-300 hover:bg-blue-200 p-2 rounded" :class="current['id'] == item['id'] ? 'bg-blue-200' : ''">
|
|
10
|
+
{{ item['data'] && item['data']['name'] }}
|
|
11
|
+
</div>
|
|
12
|
+
<div
|
|
13
|
+
v-if="current['id'] == item['id']"
|
|
14
|
+
@click.stop.prevent="deleteTagItem(item)"
|
|
15
|
+
style="position: absolute; top: 0px; right: 5px; cursor: pointer"
|
|
16
|
+
>
|
|
17
|
+
✖️
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="p-2">
|
|
21
|
+
<div @click="appendField" class="p-2 bg-pink-200 w-10 h-10 flex justify-center align-center rounded-full">+</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { PropType, defineModel } from 'vue';
|
|
29
|
+
import { useHsBtnListConfig } from './../useBtnConfigList';
|
|
30
|
+
import IFormTable from '/@/types/formTable';
|
|
31
|
+
|
|
32
|
+
const emit = defineEmits(['chose']);
|
|
33
|
+
|
|
34
|
+
const btnsModel = defineModel<Array<IFormTable.BtnItem>>([]);
|
|
35
|
+
const props = defineProps({
|
|
36
|
+
current: {
|
|
37
|
+
type: Object as PropType<Record<'id', string>>,
|
|
38
|
+
default: () => {},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const { appendField, deleteTagItem, choseTagItem } = useHsBtnListConfig(emit, props, btnsModel);
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component ref="baseConfigRef" :parentConfig="parentConfig" :is="'bc-form-config'" :data="data" :config="config.list" :rules="config.rules">
|
|
3
|
+
<template #name>
|
|
4
|
+
<bc-auto-complete type="btn" v-model="data.name" @change="onChangeItem"></bc-auto-complete>
|
|
5
|
+
</template>
|
|
6
|
+
<template #btnIcon>
|
|
7
|
+
<IconSelector placeholder="请选择图标" clearable :isShowPrepend="false" v-model="data.btnIcon" title="" />
|
|
8
|
+
</template>
|
|
9
|
+
</component>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
import IconSelector from '/@/components/iconSelector/index.vue';
|
|
15
|
+
import { useHsBtnItemConfig } from './../useBtnItemConfig';
|
|
16
|
+
// const props =
|
|
17
|
+
defineProps({
|
|
18
|
+
config: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => {},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const data: Record<string, any> = defineModel();
|
|
25
|
+
const baseConfigRef = ref();
|
|
26
|
+
|
|
27
|
+
const { parentConfig, onChangeItem, getSubmitData } = useHsBtnItemConfig(data, baseConfigRef);
|
|
28
|
+
|
|
29
|
+
defineExpose({ getSubmitData });
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
desc: 配置按钮面板
|
|
3
|
+
author: 吕玲
|
|
4
|
+
-->
|
|
5
|
+
<template>
|
|
6
|
+
<div class="mx-auto flex flex-row h-full">
|
|
7
|
+
<div class="flex-1 grow overflow-y-auto">
|
|
8
|
+
<!-- 按钮配置 -->
|
|
9
|
+
<hsExpand v-model="btnTitleConfig.visible" :expandConfig="btnTitleConfig"></hsExpand>
|
|
10
|
+
<component v-if="btnTitleConfig.visible" :is="hsBtnConfigList" v-model="btnsConfig" :current="currentItem" @chose="onChoseItem"></component>
|
|
11
|
+
</div>
|
|
12
|
+
<div v-if="(btnsConfig || []).length > 0 && !!currentItem.id" class="flex-none basis-1/4 ml-4">
|
|
13
|
+
<component :is="hsAttrBtn" :btnList="btnsConfig" :current="currentItem"></component>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<script setup lang="ts" name="formPanel">
|
|
18
|
+
import { defineModel, ref } from 'vue';
|
|
19
|
+
import hsBtnConfigList from './hsBtnConfigList.vue';
|
|
20
|
+
import hsAttrBtn from './hsAttrBtn.vue';
|
|
21
|
+
import hsExpand from '../../hsExpand/src/hsExpand.vue';
|
|
22
|
+
import IFormTable from '/@/types/formTable';
|
|
23
|
+
import { emptyBtnItemData } from './../../../default/baseBtnConfig';
|
|
24
|
+
|
|
25
|
+
import _ from 'lodash';
|
|
26
|
+
|
|
27
|
+
const btnsConfig = defineModel<Array<IFormTable.BtnItem>>();
|
|
28
|
+
const btnTitleConfig = ref({
|
|
29
|
+
visible: true,
|
|
30
|
+
subTitle: '按钮配置',
|
|
31
|
+
class: 'font-bold my-3',
|
|
32
|
+
iconSize: 20,
|
|
33
|
+
});
|
|
34
|
+
// 当前选中项配置
|
|
35
|
+
let currentItem = ref(_.cloneDeep(emptyBtnItemData));
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 选择某配置回调
|
|
39
|
+
*/
|
|
40
|
+
const onChoseItem = (item: IFormTable.BtnItem) => {
|
|
41
|
+
currentItem.value = item;
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ref, Ref, watch } from 'vue';
|
|
2
|
+
import ComponentAttr from '/@/types/components';
|
|
3
|
+
import hsAttrBtn from './src/hsAttrBtn.vue';
|
|
4
|
+
import IFormTable from '/@/types/formTable';
|
|
5
|
+
import { config } from '../../default/baseBtnConfig';
|
|
6
|
+
import { ElMessage } from 'element-plus';
|
|
7
|
+
import _ from 'lodash';
|
|
8
|
+
interface BtnRef {
|
|
9
|
+
getSubmitData: () => boolean;
|
|
10
|
+
}
|
|
11
|
+
export function useHsAttrBtn(props: ComponentAttr.Props<typeof hsAttrBtn>, btnItemRef: Ref<BtnRef>) {
|
|
12
|
+
// 原始数据
|
|
13
|
+
let oldItem = ref(props.current);
|
|
14
|
+
// 当前项绑定数据
|
|
15
|
+
let btnItemConfig = ref(_.cloneDeep(props.current));
|
|
16
|
+
/**
|
|
17
|
+
* 监听当前项
|
|
18
|
+
*/
|
|
19
|
+
watch(
|
|
20
|
+
() => props.current,
|
|
21
|
+
(value) => {
|
|
22
|
+
// 解决切换不同表单项不及时更新数据问题
|
|
23
|
+
if (value.id != btnItemConfig.value.id) {
|
|
24
|
+
console.log('value', value);
|
|
25
|
+
// value.elConfig.visible = false;
|
|
26
|
+
oldItem.value = value;
|
|
27
|
+
btnItemConfig.value = _.cloneDeep(value);
|
|
28
|
+
// formData.value = props.data;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{ deep: true }
|
|
32
|
+
);
|
|
33
|
+
const btnConfig = ref(_.cloneDeep(config));
|
|
34
|
+
// 控制表单项属性的展开关闭
|
|
35
|
+
const visible = ref(false);
|
|
36
|
+
// 基本配置属性实例
|
|
37
|
+
/**
|
|
38
|
+
* 保存功能
|
|
39
|
+
*/
|
|
40
|
+
const saveData = async function () {
|
|
41
|
+
try {
|
|
42
|
+
// 校验表单项属性
|
|
43
|
+
let flag = await btnItemRef.value.getSubmitData();
|
|
44
|
+
if (!flag) return;
|
|
45
|
+
// 增加按钮重复校验
|
|
46
|
+
let keys = _.map(props.btnList, (item: Record<string, IFormTable.Data>) => item.data.key);
|
|
47
|
+
if (_.includes(keys, btnItemConfig.value.data.key)) {
|
|
48
|
+
return ElMessage.warning('按钮key值重复');
|
|
49
|
+
}
|
|
50
|
+
// 保存表单配置
|
|
51
|
+
oldItem.value = Object.assign(oldItem.value, _.cloneDeep(btnItemConfig.value));
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.log('er', err);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return { visible, btnItemConfig, btnConfig, saveData };
|
|
58
|
+
}
|