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,196 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
desc: 父类配置
|
|
3
|
+
author:lvling
|
|
4
|
+
-->
|
|
5
|
+
<template>
|
|
6
|
+
<div>
|
|
7
|
+
<hs-form
|
|
8
|
+
ref="formRef"
|
|
9
|
+
:label-width="parentConfig['labelWidth']"
|
|
10
|
+
:inline="false"
|
|
11
|
+
label-position="right"
|
|
12
|
+
label-suffix=":"
|
|
13
|
+
:hide-required-asterisk="false"
|
|
14
|
+
require-asterisk-position="right"
|
|
15
|
+
show-message
|
|
16
|
+
inline-message
|
|
17
|
+
status-icon
|
|
18
|
+
:disabled="false"
|
|
19
|
+
v-bind="$attrs"
|
|
20
|
+
scroll-to-error
|
|
21
|
+
:rules="rules"
|
|
22
|
+
:model="formData"
|
|
23
|
+
:style="`min-width: ${parentConfig['minWidth']}px`"
|
|
24
|
+
>
|
|
25
|
+
<hs-row :gutter="0" justify="start" align="middle" class="hs-row">
|
|
26
|
+
<template v-for="(item, index) in formConfig">
|
|
27
|
+
<hs-col
|
|
28
|
+
:key="index"
|
|
29
|
+
v-if="item['show'] !== false"
|
|
30
|
+
:span="item['span'] || parentConfig['span']"
|
|
31
|
+
:xs="item['xs'] || parentConfig['xs']"
|
|
32
|
+
:sm="item['sm'] || parentConfig['sm']"
|
|
33
|
+
:md="item['md'] || parentConfig['md']"
|
|
34
|
+
:lg="item['lg'] || parentConfig['lg']"
|
|
35
|
+
:xl="item['xl'] || parentConfig['xl']"
|
|
36
|
+
:style="parentConfig.style"
|
|
37
|
+
>
|
|
38
|
+
<template v-if="item.slot">
|
|
39
|
+
<slot :name="item.slot" v-bind="item"></slot>
|
|
40
|
+
</template>
|
|
41
|
+
<hs-form-item v-else :label="item['label']" :prop="item['prop']" :required="item['required']">
|
|
42
|
+
<template #label>
|
|
43
|
+
<span class="text-[#606266] truncate"> {{ item['label'] }} <span v-if="parentConfig.showColon">: </span></span>
|
|
44
|
+
<el-tooltip class="box-item" effect="dark" :content="item['tooltip'] || item['label']" placement="top">
|
|
45
|
+
<div>
|
|
46
|
+
<el-icon><ele-Warning /></el-icon>
|
|
47
|
+
</div>
|
|
48
|
+
</el-tooltip>
|
|
49
|
+
</template>
|
|
50
|
+
<template v-if="item.slotValue">
|
|
51
|
+
<slot :name="item.slotValue" v-bind="item"></slot>
|
|
52
|
+
</template>
|
|
53
|
+
<!-- placeholder="请输入" -->
|
|
54
|
+
|
|
55
|
+
<component
|
|
56
|
+
v-else
|
|
57
|
+
:is="item['el']"
|
|
58
|
+
v-model="formData[item.prop]"
|
|
59
|
+
:multiple="item['multiple']"
|
|
60
|
+
:size="item['size']"
|
|
61
|
+
:type="item['type']"
|
|
62
|
+
:disabled="item['disabled']"
|
|
63
|
+
border
|
|
64
|
+
:clearable="item.clearable != false"
|
|
65
|
+
@change="onChange($event, item)"
|
|
66
|
+
>
|
|
67
|
+
<component
|
|
68
|
+
:is="item['cel']"
|
|
69
|
+
v-for="(value, idx) in item['op'] || []"
|
|
70
|
+
:key="idx"
|
|
71
|
+
:label="value['label']"
|
|
72
|
+
:value="value['value']"
|
|
73
|
+
></component>
|
|
74
|
+
</component>
|
|
75
|
+
</hs-form-item>
|
|
76
|
+
</hs-col>
|
|
77
|
+
</template>
|
|
78
|
+
<div></div>
|
|
79
|
+
</hs-row>
|
|
80
|
+
</hs-form>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script setup lang="ts">
|
|
85
|
+
import { ref, watch } from 'vue';
|
|
86
|
+
import IFormTable from '/@/types/formTable';
|
|
87
|
+
|
|
88
|
+
const props = defineProps({
|
|
89
|
+
// 表单配置
|
|
90
|
+
parentConfig: {
|
|
91
|
+
type: Object,
|
|
92
|
+
default: () => {
|
|
93
|
+
return {
|
|
94
|
+
labelWidth: 150,
|
|
95
|
+
xs: 24,
|
|
96
|
+
sm: 24,
|
|
97
|
+
md: 12,
|
|
98
|
+
lg: 12,
|
|
99
|
+
xl: 8,
|
|
100
|
+
style: '',
|
|
101
|
+
minWidth: 350,
|
|
102
|
+
showColon: false, // 显示冒号
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
// 表单绑定数据
|
|
107
|
+
data: {
|
|
108
|
+
type: Object,
|
|
109
|
+
default: () => {},
|
|
110
|
+
},
|
|
111
|
+
// 表单配置项数组
|
|
112
|
+
config: {
|
|
113
|
+
type: Array<IFormTable.FormItem>,
|
|
114
|
+
default: () => [],
|
|
115
|
+
},
|
|
116
|
+
rules: {
|
|
117
|
+
type: Object,
|
|
118
|
+
default: () => {},
|
|
119
|
+
},
|
|
120
|
+
// 是否监听配置
|
|
121
|
+
watchConfig: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: true,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
let formData = ref(props.data);
|
|
127
|
+
|
|
128
|
+
let formConfig = ref(props.config);
|
|
129
|
+
|
|
130
|
+
watch(
|
|
131
|
+
() => props.data,
|
|
132
|
+
(value) => {
|
|
133
|
+
formData.value = value;
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
deep: true,
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
watch(
|
|
140
|
+
() => props.config,
|
|
141
|
+
(value) => {
|
|
142
|
+
if (props.watchConfig) {
|
|
143
|
+
formConfig.value = value;
|
|
144
|
+
// console.log('formConfig', formConfig.value);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
deep: true,
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
// 表单实例
|
|
152
|
+
const formRef = ref();
|
|
153
|
+
/**
|
|
154
|
+
* 校验formdata
|
|
155
|
+
*/
|
|
156
|
+
const getSubmitData = () => {
|
|
157
|
+
return new Promise((resolve) => {
|
|
158
|
+
if (!formRef.value) {
|
|
159
|
+
resolve(false);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
formRef.value.validate((valid: 'undefined' | boolean) => {
|
|
163
|
+
if (valid) {
|
|
164
|
+
resolve(true);
|
|
165
|
+
} else {
|
|
166
|
+
resolve(false);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
// 派生事件
|
|
172
|
+
let emits = defineEmits(['change']);
|
|
173
|
+
/**
|
|
174
|
+
*选择器切换事件
|
|
175
|
+
* @param e
|
|
176
|
+
*/
|
|
177
|
+
const onChange = (value: string, item: IFormTable.FormItem) => {
|
|
178
|
+
let prop = item.prop;
|
|
179
|
+
emits('change', value, prop, item);
|
|
180
|
+
};
|
|
181
|
+
defineExpose({ props, getSubmitData });
|
|
182
|
+
</script>
|
|
183
|
+
|
|
184
|
+
<style lang="scss" scoped>
|
|
185
|
+
.hs-row {
|
|
186
|
+
:deep(.el-form-item) {
|
|
187
|
+
border: 1px solid #e7eaf2;
|
|
188
|
+
background-color: #f2f5f9;
|
|
189
|
+
}
|
|
190
|
+
:deep(.el-form-item__content) {
|
|
191
|
+
border-left: 1px solid #e7eaf2;
|
|
192
|
+
background-color: #fff;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
//
|
|
196
|
+
</style>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="wrapRef" class="bc-form-table__wrapper h-full" :class="[isOverHide ? 'overflow-auto' : 'overflow-hide']">
|
|
3
|
+
<form-search-btn v-if="!hideBtn && btns.length" ref="btnRef" :btns="btns">
|
|
4
|
+
<template v-for="(value, name) in $slots" #[name]="scopeData" :key="name">
|
|
5
|
+
<slot :name="name" v-bind="scopeData || {}"></slot>
|
|
6
|
+
</template>
|
|
7
|
+
</form-search-btn>
|
|
8
|
+
<context-body :menu="menuForm" v-if="!hideSearch && data?.form">
|
|
9
|
+
<bc-form-search ref="formRef" v-bind="data!.form" v-if="!isShowDrag" @heightChange="onHeightChange">
|
|
10
|
+
<template v-for="(value, name) in $slots" #[name]="scopeData" :key="name">
|
|
11
|
+
<slot :name="name" v-bind="scopeData || {}"></slot>
|
|
12
|
+
</template>
|
|
13
|
+
</bc-form-search>
|
|
14
|
+
<bc-form-drag ref="formRef" v-model:formConfig="data.form!.formConfig" v-bind="_.omit(data!.form, 'formConfig')" v-else>
|
|
15
|
+
<template v-for="(value, name) in $slots" #[name]="scopeData" :key="name">
|
|
16
|
+
<slot :name="name" v-bind="scopeData || {}"></slot>
|
|
17
|
+
</template>
|
|
18
|
+
</bc-form-drag>
|
|
19
|
+
</context-body>
|
|
20
|
+
|
|
21
|
+
<!-- 多表格数据展示 -->
|
|
22
|
+
<context-body target=".vxe-table--body-wrapper" :menu="menuTable" v-if="data?.tables">
|
|
23
|
+
<bc-tabs :style="style" v-model:active="activeTabs" :tabs="data!.tables">
|
|
24
|
+
<bc-table
|
|
25
|
+
v-for="item in data!.tables"
|
|
26
|
+
v-show="activeTabs === item.id"
|
|
27
|
+
v-bind="item"
|
|
28
|
+
:key="item.id"
|
|
29
|
+
:unique-id="data.config_unique_id"
|
|
30
|
+
class="h-full"
|
|
31
|
+
@ready="onReady($event, item.id)"
|
|
32
|
+
@page-change="onPageChange"
|
|
33
|
+
>
|
|
34
|
+
<template v-for="(value, name) in $slots" #[name]="scopeData" :key="name">
|
|
35
|
+
<slot :name="name" v-bind="scopeData || {}"></slot>
|
|
36
|
+
</template>
|
|
37
|
+
</bc-table>
|
|
38
|
+
</bc-tabs>
|
|
39
|
+
</context-body>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<script lang="ts" setup name="bcFormTable">
|
|
43
|
+
import { ref, onMounted, PropType, computed } from 'vue';
|
|
44
|
+
import BcFormDrag from '../bcForm/bcFormDrag.vue';
|
|
45
|
+
import ContextBody from './components/contextBody/contextBody.vue';
|
|
46
|
+
import BcTabs from './components/bcTabs/bcTabs.vue';
|
|
47
|
+
import FormSearchBtn from './components/formSearchBtn/formSearchBtn.vue';
|
|
48
|
+
import ICustomData from '/@/types/customData';
|
|
49
|
+
import { useTableHeight } from './utils/useTableHeight';
|
|
50
|
+
import { useButon } from './utils/useButon';
|
|
51
|
+
import { onFormKey } from './utils/onFormKey';
|
|
52
|
+
import { onTableKey } from './utils/onTableKey';
|
|
53
|
+
import { TableParams } from './utils/parseTable';
|
|
54
|
+
import _ from 'lodash';
|
|
55
|
+
|
|
56
|
+
const props = defineProps({
|
|
57
|
+
hideBtn: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
hideSearch: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false,
|
|
64
|
+
},
|
|
65
|
+
data: {
|
|
66
|
+
type: Object as PropType<ICustomData.FormTable>,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const emit = defineEmits<{ ready: [params: TableParams] }>();
|
|
71
|
+
|
|
72
|
+
const tabIndex = ref('');
|
|
73
|
+
const activeTabs = computed({
|
|
74
|
+
get() {
|
|
75
|
+
return tabIndex.value === '' ? _.get(props, 'data.tables.0.id', '') : tabIndex.value;
|
|
76
|
+
},
|
|
77
|
+
set(val) {
|
|
78
|
+
tabIndex.value = val;
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
const { wrapRef, btnRef, formRef, tableApi, style, isOverHide, onReady, onHeightChange } = useTableHeight();
|
|
82
|
+
|
|
83
|
+
const { menuForm, isShowDrag } = onFormKey(formRef, tableApi, activeTabs, props);
|
|
84
|
+
const { menuTable, onPageChange } = onTableKey(formRef, tableApi, activeTabs, props);
|
|
85
|
+
const { btns } = useButon(formRef, tableApi, activeTabs, props);
|
|
86
|
+
|
|
87
|
+
onMounted(() => {
|
|
88
|
+
emit('ready', { tableApi, activeTabs, api: computed(() => tableApi.value[activeTabs.value]) });
|
|
89
|
+
});
|
|
90
|
+
</script>
|
|
91
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="wrapRef" class="tabs-wrapper flex flex-col bg-white px-2">
|
|
3
|
+
<div ref="headRef" class="flex items-center justify-between text-sm" :class="[tabs.length > 1 ? 'min-h-16' : 'min-h-2']">
|
|
4
|
+
<slot name="left"></slot>
|
|
5
|
+
<div class="flex items-center" v-if="tabs.length > 1">
|
|
6
|
+
<span
|
|
7
|
+
v-for="item in tabs"
|
|
8
|
+
class="cursor-pointer py-2.5 px-5 item rounded"
|
|
9
|
+
:key="item.id"
|
|
10
|
+
:class="[active === item.id ? 'active' : '']"
|
|
11
|
+
@click="active = item.id"
|
|
12
|
+
>{{ item.baseData['tableName'] }}</span
|
|
13
|
+
>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="tabs-content" :style="{ height: height }">
|
|
17
|
+
<slot></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
<script lang="ts" setup name="bcTabs">
|
|
22
|
+
import { computed, ref } from 'vue';
|
|
23
|
+
import { useElementSize } from '@vueuse/core';
|
|
24
|
+
import ICustomData from '/@/types/customData';
|
|
25
|
+
|
|
26
|
+
interface Props {
|
|
27
|
+
tabs: ICustomData.Table[];
|
|
28
|
+
}
|
|
29
|
+
defineProps<Props>();
|
|
30
|
+
const active = defineModel('active', { type: String });
|
|
31
|
+
|
|
32
|
+
const wrapRef = ref();
|
|
33
|
+
const headRef = ref();
|
|
34
|
+
const { height: wrapHeight } = useElementSize(wrapRef);
|
|
35
|
+
const { height: headHeight } = useElementSize(headRef);
|
|
36
|
+
|
|
37
|
+
const height = computed(() => `${wrapHeight.value - headHeight.value}px`);
|
|
38
|
+
</script>
|
|
39
|
+
<style scoped lang="scss">
|
|
40
|
+
.item {
|
|
41
|
+
background-color: #f0f0f0;
|
|
42
|
+
color: #333;
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
margin-right: 14px;
|
|
45
|
+
&:last-of-type {
|
|
46
|
+
margin-right: 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.active {
|
|
50
|
+
background-color: #e8f4ff;
|
|
51
|
+
color: #1081ff;
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="context-wrap" ref="contextRef">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
<Teleport to="body">
|
|
5
|
+
<Transition @before-enter="handleBeforeEnter" @enter="handleEnter" @after-enter="handelAfterEnter">
|
|
6
|
+
<div v-if="isshow" class="fixed z-10 bg-[#f8f8f8] rounded shadow p-2 overflow-hidden min-w-28" :style="{ left: `${x}px`, top: `${y}px` }">
|
|
7
|
+
<ul class="list-none">
|
|
8
|
+
<li
|
|
9
|
+
v-for="(item, key) in menuList"
|
|
10
|
+
:key="key"
|
|
11
|
+
@click.stop="handleClick(item)"
|
|
12
|
+
class="text-sm hover:text-blue-800 cursor-pointer py-1 hover:bg-blue-200 text-gray-600 pl-1"
|
|
13
|
+
>
|
|
14
|
+
{{ toValue(item.label) }}
|
|
15
|
+
</li>
|
|
16
|
+
</ul>
|
|
17
|
+
</div>
|
|
18
|
+
</Transition>
|
|
19
|
+
</Teleport>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
<script lang="ts" setup name="contextBody">
|
|
23
|
+
import { ref, toValue } from 'vue';
|
|
24
|
+
import { useContextMenu, Menu } from './useContextMenu';
|
|
25
|
+
|
|
26
|
+
interface Props {
|
|
27
|
+
menu: Array<Menu>;
|
|
28
|
+
target?: string;
|
|
29
|
+
getMenu?: () => Menu[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const props = defineProps<Props>();
|
|
33
|
+
const emit = defineEmits(['select']);
|
|
34
|
+
const contextRef = ref<HTMLElement>();
|
|
35
|
+
const { x, y, isshow, menuList } = useContextMenu(contextRef, props);
|
|
36
|
+
|
|
37
|
+
function handleClick(item: Menu) {
|
|
38
|
+
isshow.value = false;
|
|
39
|
+
if (typeof item.click === 'function') {
|
|
40
|
+
item.click();
|
|
41
|
+
} else {
|
|
42
|
+
emit('select', item);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function handleBeforeEnter(e: Element) {
|
|
47
|
+
const el = e as HTMLElement;
|
|
48
|
+
el.style.height = '0';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function handleEnter(e: Element) {
|
|
52
|
+
const el = e as HTMLElement;
|
|
53
|
+
el.style.height = 'auto';
|
|
54
|
+
const h = el.clientHeight;
|
|
55
|
+
el.style.height = '0';
|
|
56
|
+
requestAnimationFrame(() => {
|
|
57
|
+
el.style.height = h + 'px';
|
|
58
|
+
el.style.transition = 'all .5s';
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function handelAfterEnter(e: Element) {
|
|
63
|
+
const el = e as HTMLElement;
|
|
64
|
+
el.style.transition = 'none';
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ref, Ref, onMounted, onUnmounted, ComputedRef } from 'vue';
|
|
2
|
+
import ComponentAttr from '/@/types/components';
|
|
3
|
+
import contextBody from './contextBody.vue';
|
|
4
|
+
|
|
5
|
+
export interface Menu {
|
|
6
|
+
label: string | ComputedRef;
|
|
7
|
+
value: string;
|
|
8
|
+
click?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export function useContextMenu(container: Ref<HTMLElement | undefined>, props: ComponentAttr.Props<typeof contextBody>) {
|
|
11
|
+
const x = ref(0);
|
|
12
|
+
const y = ref(0);
|
|
13
|
+
const isshow = ref(false);
|
|
14
|
+
const menuList = ref<Menu[]>(props.menu);
|
|
15
|
+
|
|
16
|
+
function openMenu(e: MouseEvent) {
|
|
17
|
+
if (props.target && !(e.target as any)?.closest(props.target)) return;
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
|
|
21
|
+
if (typeof props.getMenu === 'function') {
|
|
22
|
+
menuList.value = props.getMenu();
|
|
23
|
+
} else {
|
|
24
|
+
menuList.value = props.menu;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
isshow.value = true;
|
|
28
|
+
x.value = e.clientX;
|
|
29
|
+
y.value = e.clientY;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function closeMenu() {
|
|
33
|
+
isshow.value = false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
onMounted(() => {
|
|
37
|
+
container.value?.addEventListener('contextmenu', openMenu);
|
|
38
|
+
window.addEventListener('click', closeMenu, true);
|
|
39
|
+
window.addEventListener('contextmenu', closeMenu, true);
|
|
40
|
+
});
|
|
41
|
+
onUnmounted(() => {
|
|
42
|
+
container.value?.removeEventListener('contextmenu', openMenu);
|
|
43
|
+
window.removeEventListener('click', closeMenu, true);
|
|
44
|
+
window.removeEventListener('contextmenu', closeMenu, true);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
x,
|
|
49
|
+
y,
|
|
50
|
+
isshow,
|
|
51
|
+
menuList,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bg-white" v-if="btns.length">
|
|
3
|
+
<div class="px-4 pt-4 flex item-center">
|
|
4
|
+
<template v-for="btn in btns" :key="btn.id">
|
|
5
|
+
<slot v-if="btn.data.isSlot" :name="'btn_' + btn.data.key"></slot>
|
|
6
|
+
<bc-btn :data="btn.data" />
|
|
7
|
+
</template>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<script lang="ts" setup name="formSearchBtn">
|
|
12
|
+
import ICustomData from '/@/types/customData';
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
btns: ICustomData.Btns[];
|
|
16
|
+
}
|
|
17
|
+
withDefaults(defineProps<Props>(), {
|
|
18
|
+
btns: () => [],
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VxeTablePropTypes } from 'vxe-table';
|
|
2
|
+
import IFormTable from '/@/types/formTable';
|
|
3
|
+
|
|
4
|
+
const sumNum = (list: IFormTable.Data[], field: string) => {
|
|
5
|
+
return list.reduce(function (total, next) {
|
|
6
|
+
total += Number(next[field]);
|
|
7
|
+
return total;
|
|
8
|
+
}, 0);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const footerMethod: VxeTablePropTypes.FooterMethod = ({ columns, data }) => {
|
|
12
|
+
return [
|
|
13
|
+
columns.map((column, columnIndex) => {
|
|
14
|
+
if (columnIndex === 0) {
|
|
15
|
+
return '和值';
|
|
16
|
+
}
|
|
17
|
+
if (['field1'].includes(column.field)) {
|
|
18
|
+
return `${sumNum(data, column.field)}`;
|
|
19
|
+
}
|
|
20
|
+
return '-';
|
|
21
|
+
}),
|
|
22
|
+
];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default footerMethod;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import IFormTable from '/@/types/formTable';
|
|
2
|
+
import filterAgeMethod from './filterAgeMethod';
|
|
3
|
+
import footerMethod from './footerMethod';
|
|
4
|
+
import cellDetailMethod from './cellDetailMethod';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
filterAgeMethod,
|
|
8
|
+
footerMethod,
|
|
9
|
+
cellDetailMethod,
|
|
10
|
+
} as IFormTable.Data;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { onKeyStroke, watchOnce } from '@vueuse/core';
|
|
2
|
+
import { Ref, ref, computed, toValue } from 'vue';
|
|
3
|
+
import { VxeTableInstance } from 'vxe-table';
|
|
4
|
+
import ICustomData from '/@/types/customData';
|
|
5
|
+
import ComponentAttr from '/@/types/components';
|
|
6
|
+
import { getSearchForm } from '/@parseTable';
|
|
7
|
+
import BcFormTable from '../bcFormTable.vue';
|
|
8
|
+
import { formStore } from '/@/utils/storage';
|
|
9
|
+
import { tableIndex } from './onTableKey';
|
|
10
|
+
import { setSortPopup } from '../../bcForm/components/sortForm';
|
|
11
|
+
import _ from 'lodash';
|
|
12
|
+
|
|
13
|
+
export function onFormKey(
|
|
14
|
+
formRef: Ref<ICustomData.ANY>,
|
|
15
|
+
tablesRef: Ref<Record<string, VxeTableInstance>>,
|
|
16
|
+
activeTabs: Ref<string>,
|
|
17
|
+
props: ComponentAttr.Props<typeof BcFormTable>
|
|
18
|
+
) {
|
|
19
|
+
const tableRef = computed(() => tablesRef.value[activeTabs.value]);
|
|
20
|
+
const isShowDrag = ref(false);
|
|
21
|
+
const showDrag = async () => {
|
|
22
|
+
// 保存数据为本地缓存
|
|
23
|
+
if (isShowDrag.value) {
|
|
24
|
+
await formStore.get<ICustomData.FormTable>(props.data!.config_unique_id).then(async (res) => {
|
|
25
|
+
res.form!.formConfig = JSON.parse(JSON.stringify(props.data!.form!.formConfig));
|
|
26
|
+
await formStore.set(props.data!.config_unique_id, res);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
isShowDrag.value = !isShowDrag.value;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** 表单查询高级设置 */
|
|
33
|
+
const onFormConfig = () => {
|
|
34
|
+
setSortPopup<ICustomData.FormTable>(props.data!.config_unique_id).then(async (res) => {
|
|
35
|
+
const { formConfig } = await getSearchForm(res);
|
|
36
|
+
props.data!.form!.formConfig = formConfig;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
/** 重置表单设置 */
|
|
40
|
+
const onRestConfig = async () => {
|
|
41
|
+
const originData = await formStore.get<ICustomData.FormTable>(`${props.data!.config_unique_id}_origin`);
|
|
42
|
+
const current = await formStore.get<ICustomData.FormTable>(`${props.data!.config_unique_id}`);
|
|
43
|
+
current.form = originData.form;
|
|
44
|
+
formStore.set(originData.config_unique_id, current).then(async () => {
|
|
45
|
+
const { formConfig } = await getSearchForm(originData);
|
|
46
|
+
props.data!.form!.formConfig = formConfig;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const menuForm = [
|
|
50
|
+
{ label: '高级设置', value: '222', click: onFormConfig },
|
|
51
|
+
{ label: computed(() => (isShowDrag.value ? '完成排序' : '排序设置')), value: '111', click: showDrag },
|
|
52
|
+
{ label: '重置设置', value: '333', click: onRestConfig },
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
watchOnce(formRef, () => {
|
|
56
|
+
// 解决页面刷新弹跳问题
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
_.get(toValue(formRef), 'componentRef.0')?.focus();
|
|
59
|
+
}, 1000);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// 左切换
|
|
63
|
+
onKeyStroke('ArrowLeft', (e) => {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
const activeElement = document.activeElement as Element;
|
|
66
|
+
if (!activeElement.closest('.bc-form__wrapper')) return;
|
|
67
|
+
|
|
68
|
+
const components = toValue(formRef)?.getComponents();
|
|
69
|
+
let index = components.findIndex((item: ICustomData.ANY) => {
|
|
70
|
+
if (item?.activeElement) {
|
|
71
|
+
item = item.activeElement();
|
|
72
|
+
}
|
|
73
|
+
return item == activeElement;
|
|
74
|
+
});
|
|
75
|
+
let activeIndex = index < 0 ? -1 : index;
|
|
76
|
+
activeIndex--;
|
|
77
|
+
activeIndex < 0 && (activeIndex = components.length - 1);
|
|
78
|
+
_.get(components, activeIndex)?.focus();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// 右切换
|
|
82
|
+
onKeyStroke('ArrowRight', (e) => {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
const activeElement = document.activeElement as Element;
|
|
85
|
+
if (!activeElement.closest('.bc-form__wrapper')) return;
|
|
86
|
+
|
|
87
|
+
const components = toValue(formRef)?.getComponents();
|
|
88
|
+
const lastIndex = components.length - 1;
|
|
89
|
+
let index = components.findIndex((item: any) => {
|
|
90
|
+
if (item?.activeElement) {
|
|
91
|
+
item = item.activeElement();
|
|
92
|
+
}
|
|
93
|
+
return item == activeElement;
|
|
94
|
+
});
|
|
95
|
+
let activeIndex = index < 0 ? -1 : index;
|
|
96
|
+
activeIndex++;
|
|
97
|
+
activeIndex > lastIndex && (activeIndex = 0);
|
|
98
|
+
_.get(components, activeIndex)?.focus();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// 键盘下移动
|
|
102
|
+
onKeyStroke('ArrowDown', (e) => {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
const activeElement = document.activeElement as Element;
|
|
105
|
+
if (!activeElement.closest('.bc-form__wrapper')) return;
|
|
106
|
+
|
|
107
|
+
tableIndex.rowIndex = 0;
|
|
108
|
+
const row = tableRef.value?.getData(tableIndex.rowIndex);
|
|
109
|
+
// 获取可视列数据
|
|
110
|
+
const { visibleColumn } = tableRef.value!.getTableColumn();
|
|
111
|
+
tableIndex.columnIndex = visibleColumn.filter((i) => i.type).length;
|
|
112
|
+
const columnField = visibleColumn[tableIndex.columnIndex].field;
|
|
113
|
+
tableRef.value?.setCurrentRow(row); // 设置当前行
|
|
114
|
+
tableRef.value?.setEditRow(row, columnField);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
isShowDrag,
|
|
119
|
+
menuForm,
|
|
120
|
+
};
|
|
121
|
+
}
|