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,231 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<hs-button @click="getDocApi">获取API信息</hs-button>
|
|
3
|
+
<hs-input
|
|
4
|
+
placeholder="搜索API"
|
|
5
|
+
v-model="state.search"
|
|
6
|
+
style="border: 1rpx solid rgb(171, 178, 191); height: 3.5vh; padding-left: 12rpx; border-radius: 12rpx"
|
|
7
|
+
@keyup.enter="onSearch"
|
|
8
|
+
/>
|
|
9
|
+
<hs-input ref="textareaRef" type="textarea" autosize v-model="state.result" placeholder="请输入返回接口参数获取类型声明" @keyup.enter="onResult" />
|
|
10
|
+
<el-scrollbar height="70vh" class="hs-api__body" v-if="state.searchApi.length > 0">
|
|
11
|
+
<!-- 引用 请求地址 -->
|
|
12
|
+
<div class="hs-api__body-quote">
|
|
13
|
+
<el-text>import</el-text> <el-text>request</el-text> <el-text>from</el-text> <el-text>'/@/utils/request';</el-text><br />
|
|
14
|
+
</div>
|
|
15
|
+
<div class="hs-api__body-explain">
|
|
16
|
+
<el-text>/**</el-text><br />
|
|
17
|
+
<el-text> * 追加标题到参数对象中</el-text><br />
|
|
18
|
+
<el-text> */</el-text>
|
|
19
|
+
</div>
|
|
20
|
+
<div>
|
|
21
|
+
<el-text class="const">const </el-text>
|
|
22
|
+
<el-text class="variable">assign </el-text>
|
|
23
|
+
<el-text class="equal-sign">= </el-text>
|
|
24
|
+
<el-text class="parentheses">(</el-text>
|
|
25
|
+
<el-text class="parameter">params</el-text>
|
|
26
|
+
<el-text class="equal-sign">: </el-text>
|
|
27
|
+
<el-text class="type">object</el-text>
|
|
28
|
+
<el-text class="equal-sign">, </el-text>
|
|
29
|
+
<el-text class="parameter">title</el-text>
|
|
30
|
+
<el-text class="equal-sign">: </el-text>
|
|
31
|
+
<el-text class="type">string</el-text>
|
|
32
|
+
<el-text class="parentheses">)</el-text>
|
|
33
|
+
<el-text class="const"> => </el-text>
|
|
34
|
+
<el-text class="parentheses">{</el-text><br />
|
|
35
|
+
<el-text class="return"> return</el-text>
|
|
36
|
+
<el-text class="object"> Object</el-text>
|
|
37
|
+
<el-text class="equal-sign">.</el-text>
|
|
38
|
+
<el-text class="variable">assign</el-text>
|
|
39
|
+
<el-text class="return">(</el-text>
|
|
40
|
+
<el-text class="parameter">params</el-text>
|
|
41
|
+
<el-text class="equal-sign">, </el-text>
|
|
42
|
+
<el-text class="const">{</el-text>
|
|
43
|
+
<el-text class="parameter"> other_log_info: </el-text>
|
|
44
|
+
<el-text class="const">{</el-text>
|
|
45
|
+
<el-text class="parameter"> title </el-text>
|
|
46
|
+
<el-text class="const">} </el-text>
|
|
47
|
+
<el-text class="const">} </el-text>
|
|
48
|
+
<el-text class="return">)</el-text>
|
|
49
|
+
<el-text class="equal-sign">;</el-text><br />
|
|
50
|
+
<el-text class="parentheses">};</el-text><br />
|
|
51
|
+
</div>
|
|
52
|
+
<div v-for="(api, index) in state.searchApi" :key="index">
|
|
53
|
+
<!-- 描述说明 -->
|
|
54
|
+
<el-text class="explain">/**</el-text><br />
|
|
55
|
+
<el-text class="explain">* 接口分类: {{ api.description }} - {{ api.tags }}</el-text
|
|
56
|
+
><br />
|
|
57
|
+
<el-text class="explain">* 接口名称: {{ api.title }} - 接口地址: {{ api.url }}</el-text
|
|
58
|
+
><br />
|
|
59
|
+
<el-text class="explain">* 请求方式: {{ api.method }}</el-text
|
|
60
|
+
><br />
|
|
61
|
+
<el-text class="explain" v-for="(parame, idx) in api.parameters" :key="idx">
|
|
62
|
+
* <el-text class="const">@param </el-text>
|
|
63
|
+
<el-text class="parentheses">
|
|
64
|
+
{<el-text class="return"
|
|
65
|
+
>[<el-text class="object">{{ parame.type }}</el-text
|
|
66
|
+
>]</el-text
|
|
67
|
+
>}
|
|
68
|
+
</el-text>
|
|
69
|
+
<el-text class="parameter">{{ parame.name }} </el-text>
|
|
70
|
+
<el-text class="explain"
|
|
71
|
+
>[{{ parame.description }}]
|
|
72
|
+
<el-text class="explain"> 是否必填:{{ parame.required ? '是' : '否' }} </el-text>
|
|
73
|
+
</el-text>
|
|
74
|
+
<br />
|
|
75
|
+
</el-text>
|
|
76
|
+
<el-text class="explain"
|
|
77
|
+
>* <el-text class="const">@return </el-text>
|
|
78
|
+
<el-text class="parentheses"
|
|
79
|
+
>{<el-text class="return">[<el-text class="object">type</el-text>]</el-text>} </el-text
|
|
80
|
+
>[description]</el-text
|
|
81
|
+
><br />
|
|
82
|
+
<el-text class="explain">*/</el-text><br />
|
|
83
|
+
<!-- 方法体 -->
|
|
84
|
+
<div>
|
|
85
|
+
<!-- 第一行方法体定义开始 -->
|
|
86
|
+
<el-text class="const">const </el-text>
|
|
87
|
+
<el-text class="variable">{{ api.className }}</el-text>
|
|
88
|
+
<el-text class="equal-sign">=</el-text>
|
|
89
|
+
<el-text class="parentheses"><</el-text>
|
|
90
|
+
<el-text class="parentheses">T</el-text>
|
|
91
|
+
<el-text class="parentheses">></el-text>
|
|
92
|
+
<el-text class="parentheses">(</el-text>
|
|
93
|
+
<el-text class="parameter">{{ api.method == 'get' ? 'params' : 'data' }}</el-text>
|
|
94
|
+
<el-text class="equal-sign">: </el-text>
|
|
95
|
+
<el-text class="type">object</el-text>
|
|
96
|
+
<el-text class="equal-sign"> = </el-text>
|
|
97
|
+
<el-text class="return">{</el-text>
|
|
98
|
+
<el-text class="return">} </el-text>
|
|
99
|
+
<el-text class="parentheses">)</el-text>
|
|
100
|
+
<el-text class="parentheses">:</el-text>
|
|
101
|
+
<el-text class="parentheses">Promise<T></el-text>
|
|
102
|
+
<el-text class="const"> => </el-text>
|
|
103
|
+
<el-text class="parentheses">{</el-text><br />
|
|
104
|
+
<!-- 第一行方法体定义结束 -->
|
|
105
|
+
|
|
106
|
+
<!-- 参数自定义开始 -->
|
|
107
|
+
<!-- params = assign(params, '后台api获取接口'); -->
|
|
108
|
+
<el-text class="parameter">
|
|
109
|
+
{{ api.method == 'get' ? 'params' : 'data' }}
|
|
110
|
+
<el-text class="equal-sign"> = </el-text>
|
|
111
|
+
<el-text class="variable">assign</el-text>
|
|
112
|
+
<el-text class="parentheses">(</el-text>
|
|
113
|
+
<el-text class="parameter">{{ api.method == 'get' ? 'params' : 'data' }}</el-text>
|
|
114
|
+
<el-text class="equal-sign">, </el-text>
|
|
115
|
+
<el-text class="str">'{{ api.title }}'</el-text>
|
|
116
|
+
<el-text class="parentheses">)</el-text>
|
|
117
|
+
<el-text class="equal-sign">;</el-text> </el-text
|
|
118
|
+
><br />
|
|
119
|
+
<!-- 参数自定义结束 -->
|
|
120
|
+
<el-text class="return"> return</el-text>
|
|
121
|
+
<el-text class="object"> request</el-text>
|
|
122
|
+
<el-text class="return">(</el-text>
|
|
123
|
+
<el-text class="const">{</el-text><br />
|
|
124
|
+
<el-text>
|
|
125
|
+
|
|
126
|
+
<el-text class="parameter"> url: </el-text>
|
|
127
|
+
<el-text class="str">'{{ api.url }}'</el-text>
|
|
128
|
+
<el-text class="equal-sign">,</el-text> </el-text
|
|
129
|
+
><br />
|
|
130
|
+
<el-text>
|
|
131
|
+
|
|
132
|
+
<el-text class="parameter"> method: </el-text>
|
|
133
|
+
<el-text class="str">'{{ api.method }}'</el-text>
|
|
134
|
+
<el-text class="equal-sign">,</el-text> </el-text
|
|
135
|
+
><br />
|
|
136
|
+
<el-text>
|
|
137
|
+
|
|
138
|
+
<el-text class="parameter"> {{ api.method == 'get' ? 'params' : 'data' }}</el-text>
|
|
139
|
+
<el-text class="equal-sign">,</el-text> </el-text
|
|
140
|
+
><br />
|
|
141
|
+
<el-text class="const"> }</el-text>
|
|
142
|
+
<el-text class="return">)</el-text>
|
|
143
|
+
<el-text class="equal-sign">;</el-text><br />
|
|
144
|
+
<el-text class="parentheses">};</el-text><br />
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
<!-- 暴露方法 -->
|
|
148
|
+
<div>
|
|
149
|
+
<el-text>
|
|
150
|
+
<el-text class="return"
|
|
151
|
+
>export
|
|
152
|
+
<el-text class="const">function </el-text>
|
|
153
|
+
<el-text class="variable">use{{ state.searchApi[0].tags }}</el-text>
|
|
154
|
+
<el-text class="parentheses">() {</el-text> </el-text
|
|
155
|
+
><br />
|
|
156
|
+
<el-text class="return"> return {</el-text><br />
|
|
157
|
+
<el-text class="variable" v-for="(fun, index) in state.returnFun" :key="index"> {{ fun }},<br /></el-text>
|
|
158
|
+
<el-text class="return"> }</el-text>
|
|
159
|
+
<el-text class="equal-sign">;</el-text>
|
|
160
|
+
<br />
|
|
161
|
+
<el-text class="parentheses">}</el-text><br />
|
|
162
|
+
</el-text>
|
|
163
|
+
</div>
|
|
164
|
+
</el-scrollbar>
|
|
165
|
+
</template>
|
|
166
|
+
<script setup lang="ts" name="hsGetApis">
|
|
167
|
+
import { getDocApi, onSearch, onResult, state, textareaRef } from '../useGetApis';
|
|
168
|
+
</script>
|
|
169
|
+
<style scoped lang="scss">
|
|
170
|
+
.hs-api__body {
|
|
171
|
+
background-color: rgb(30, 30, 30);
|
|
172
|
+
padding: 12px;
|
|
173
|
+
// 导入
|
|
174
|
+
&-quote {
|
|
175
|
+
.el-text {
|
|
176
|
+
// margin-right: 8px;
|
|
177
|
+
}
|
|
178
|
+
.el-text:nth-child(2) {
|
|
179
|
+
color: rgb(156, 220, 254);
|
|
180
|
+
}
|
|
181
|
+
.el-text:nth-child(odd) {
|
|
182
|
+
color: rgb(197, 106, 119);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// 类的说明
|
|
186
|
+
&-explain {
|
|
187
|
+
.el-text {
|
|
188
|
+
color: rgb(106, 153, 85);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// 定义声明
|
|
192
|
+
.const {
|
|
193
|
+
color: rgb(86, 156, 214);
|
|
194
|
+
}
|
|
195
|
+
// 变量
|
|
196
|
+
.variable {
|
|
197
|
+
color: rgb(220, 220, 170);
|
|
198
|
+
}
|
|
199
|
+
// 等号
|
|
200
|
+
.equal-sign {
|
|
201
|
+
color: rgb(255, 255, 255);
|
|
202
|
+
}
|
|
203
|
+
// 括号
|
|
204
|
+
.parentheses {
|
|
205
|
+
color: rgb(255, 255, 0);
|
|
206
|
+
}
|
|
207
|
+
// 参数
|
|
208
|
+
.parameter {
|
|
209
|
+
color: rgb(156, 220, 254);
|
|
210
|
+
}
|
|
211
|
+
// 返回
|
|
212
|
+
.return {
|
|
213
|
+
color: rgb(187, 134, 192);
|
|
214
|
+
}
|
|
215
|
+
// Object
|
|
216
|
+
.object {
|
|
217
|
+
color: rgb(78, 201, 176);
|
|
218
|
+
}
|
|
219
|
+
.type {
|
|
220
|
+
color: rgb(78, 201, 176);
|
|
221
|
+
}
|
|
222
|
+
// 说明
|
|
223
|
+
.explain {
|
|
224
|
+
color: rgb(106, 153, 85);
|
|
225
|
+
}
|
|
226
|
+
// 名称 url 请求方式
|
|
227
|
+
.str {
|
|
228
|
+
color: rgb(206, 145, 120);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
</style>
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { reactive, ref } from 'vue';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
import { usePostMan } from '/@/api/test/index';
|
|
4
|
+
import { ElMessage } from 'element-plus';
|
|
5
|
+
import { getDataType } from '/@/utils/getDataType';
|
|
6
|
+
|
|
7
|
+
const postMan = usePostMan();
|
|
8
|
+
interface apisType {
|
|
9
|
+
description: string;
|
|
10
|
+
tags: string;
|
|
11
|
+
title: string;
|
|
12
|
+
url: string;
|
|
13
|
+
method: string;
|
|
14
|
+
parameters: string;
|
|
15
|
+
proxy: string;
|
|
16
|
+
className: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface stateType {
|
|
20
|
+
show: boolean;
|
|
21
|
+
index: number;
|
|
22
|
+
result: string;
|
|
23
|
+
searchApi: Array<T>;
|
|
24
|
+
search: string;
|
|
25
|
+
ids: Array<number>;
|
|
26
|
+
apis: Array<apisType>;
|
|
27
|
+
returnFun: Array<String>;
|
|
28
|
+
}
|
|
29
|
+
let textareaRef = ref();
|
|
30
|
+
let state = reactive<stateType>({
|
|
31
|
+
show: false,
|
|
32
|
+
index: 0,
|
|
33
|
+
result: '',
|
|
34
|
+
searchApi: [],
|
|
35
|
+
search: '',
|
|
36
|
+
ids: [],
|
|
37
|
+
apis: [],
|
|
38
|
+
returnFun: [],
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 获取类名
|
|
43
|
+
*/
|
|
44
|
+
const getClassName = (method: string, path: string) => {
|
|
45
|
+
// 获取路径地址的最后一级
|
|
46
|
+
let _path = path.split('/').pop();
|
|
47
|
+
// 以下划线分割地址
|
|
48
|
+
let list = (_path as string).split('_');
|
|
49
|
+
let majuscule = '';
|
|
50
|
+
list.map((item, index) => {
|
|
51
|
+
if (index == 0) {
|
|
52
|
+
majuscule = item;
|
|
53
|
+
} else {
|
|
54
|
+
majuscule += item.charAt(0).toUpperCase() + item.slice(1);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
if (majuscule.substring(0, 3) === 'get' || majuscule.substring(0, 3) === 'post' || majuscule.substring(0, 3) === 'Put') {
|
|
58
|
+
return majuscule;
|
|
59
|
+
} else {
|
|
60
|
+
return method + majuscule.charAt(0).toUpperCase() + majuscule.slice(1);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* 获取API信息
|
|
65
|
+
*/
|
|
66
|
+
const getDocApi = () => {
|
|
67
|
+
postMan
|
|
68
|
+
.getApiDocs()
|
|
69
|
+
.then((res) => {
|
|
70
|
+
_.forEach(res.paths, function (value, key) {
|
|
71
|
+
let val;
|
|
72
|
+
let method = '';
|
|
73
|
+
if (value.get) {
|
|
74
|
+
val = value.get;
|
|
75
|
+
method = 'get';
|
|
76
|
+
} else if (value.post) {
|
|
77
|
+
val = value.post;
|
|
78
|
+
method = 'post';
|
|
79
|
+
} else if (value.put) {
|
|
80
|
+
val = value.put;
|
|
81
|
+
method = 'put';
|
|
82
|
+
}
|
|
83
|
+
let tag = _.filter(res.tags, {
|
|
84
|
+
name: val.tags[0],
|
|
85
|
+
});
|
|
86
|
+
if (val) {
|
|
87
|
+
state.apis.push({
|
|
88
|
+
description: tag[0]['description'],
|
|
89
|
+
tags: val.tags[0],
|
|
90
|
+
title: val.summary,
|
|
91
|
+
url: '/' + res.basePath.split('/')[1] + key,
|
|
92
|
+
method: method,
|
|
93
|
+
parameters: val.parameters,
|
|
94
|
+
proxy: res.basePath.split('/')[1],
|
|
95
|
+
className: getClassName(method, key),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
})
|
|
100
|
+
.catch((err) => {
|
|
101
|
+
console.debug('获取API信息错误', err);
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* 模糊查询
|
|
106
|
+
* @param {Object} list
|
|
107
|
+
* @param {Object} keyWord
|
|
108
|
+
*/
|
|
109
|
+
const onFuzzyQuery = function (list: Array<apisType>, keyWord: string) {
|
|
110
|
+
let api = [];
|
|
111
|
+
for (let i = 0; i < list.length; i++) {
|
|
112
|
+
if (list[i].title.split(keyWord).length > 1) {
|
|
113
|
+
api.push(list[i]);
|
|
114
|
+
}
|
|
115
|
+
if (list[i].description.split(keyWord).length > 1 && _.indexOf(_.map(api, 'url'), list[i].url) === -1) {
|
|
116
|
+
api.push(list[i]);
|
|
117
|
+
}
|
|
118
|
+
if (list[i].tags.split(keyWord).length > 1 && _.indexOf(_.map(api, 'url'), list[i].url) === -1) {
|
|
119
|
+
api.push(list[i]);
|
|
120
|
+
}
|
|
121
|
+
if (list[i].url.split(keyWord).length > 1 && _.indexOf(_.map(api, 'url'), list[i].url) === -1) {
|
|
122
|
+
api.push(list[i]);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return api;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* 搜索
|
|
129
|
+
*/
|
|
130
|
+
const onSearch = function () {
|
|
131
|
+
state.searchApi = [];
|
|
132
|
+
if (state.search.trim()) {
|
|
133
|
+
state.searchApi = onFuzzyQuery(state.apis, state.search.trim());
|
|
134
|
+
state.returnFun = _.map(state.searchApi, 'className');
|
|
135
|
+
console.debug('returnFun:', state.returnFun);
|
|
136
|
+
if (state.searchApi.length === 0) {
|
|
137
|
+
ElMessage({
|
|
138
|
+
message: '未搜索到接口数据',
|
|
139
|
+
type: 'success',
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
ElMessage({
|
|
144
|
+
message: '搜索的数据不能为空',
|
|
145
|
+
type: 'error',
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
function onResult() {
|
|
151
|
+
const fun = new Function('return ' + state.result);
|
|
152
|
+
state.result = getDataType(fun());
|
|
153
|
+
setTimeout(() => {
|
|
154
|
+
textareaRef.value?.select();
|
|
155
|
+
}, 1000);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export { getDocApi, onSearch, onResult, state, textareaRef };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-input v-model="innerValue" ref="inputRef">
|
|
3
|
+
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
|
4
|
+
<slot :name="item" v-bind="data || {}"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
</el-input>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts" name="hsInput">
|
|
10
|
+
import { ref, onMounted, Ref, getCurrentInstance } from 'vue';
|
|
11
|
+
import { useExposeProperties } from '/@/hooks/useExpose';
|
|
12
|
+
// props 属性
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
value: {
|
|
15
|
+
type: [String, Number],
|
|
16
|
+
default: '',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
// emit 事件
|
|
20
|
+
const emit = defineEmits(['update:value']);
|
|
21
|
+
|
|
22
|
+
const innerValue = defineModel<string | number>(
|
|
23
|
+
() => props.value,
|
|
24
|
+
(val: string | number) => emit('update:value', val)
|
|
25
|
+
);
|
|
26
|
+
// 获取ref
|
|
27
|
+
const inputRef: Ref<HTMLInputElement | null> = ref(null);
|
|
28
|
+
// 获取实例方法
|
|
29
|
+
const instance = getCurrentInstance();
|
|
30
|
+
|
|
31
|
+
onMounted(() => {
|
|
32
|
+
useExposeProperties(inputRef, instance);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
function activeElement() {
|
|
36
|
+
return inputRef.value?.ref;
|
|
37
|
+
}
|
|
38
|
+
// 暴露给外部的 ref
|
|
39
|
+
defineExpose({ ...instance!.exposed, activeElement });
|
|
40
|
+
</script>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param emit
|
|
4
|
+
* @returns
|
|
5
|
+
* 1. 向外暴露一个函数(useInputEvents),函数接收一个emit函数
|
|
6
|
+
*/
|
|
7
|
+
export function useInputEvents(emit: (event: "input" | "update:value" | "blur" | "focus" | "change" | "clear", data?: unknown) => void) {
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param event
|
|
11
|
+
* 1. Define the event blur
|
|
12
|
+
*/
|
|
13
|
+
const handleBlur = (event: Event) => {
|
|
14
|
+
emit('blur', event);
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param event
|
|
19
|
+
* 2. Define the event focus
|
|
20
|
+
*/
|
|
21
|
+
const handleFocus = (event: Event) => {
|
|
22
|
+
emit('focus', event);
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* 3. Define the event change
|
|
27
|
+
*/
|
|
28
|
+
const handleChange = (value: string | number) => {
|
|
29
|
+
emit('change', value);
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* 4. Define the event input
|
|
34
|
+
*/
|
|
35
|
+
const handleInput = (value: string | number) => {
|
|
36
|
+
emit('input', value);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* 5. Define the event clear
|
|
41
|
+
*/
|
|
42
|
+
const handleClear = () => {
|
|
43
|
+
emit('clear');
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
handleBlur,
|
|
47
|
+
handleFocus,
|
|
48
|
+
handleChange,
|
|
49
|
+
handleInput,
|
|
50
|
+
handleClear,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-input-number v-model="innerValue" ref="inputNumberRef"> </el-input-number>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts" name="hsInputNumber">
|
|
6
|
+
import { ref, onMounted, getCurrentInstance } from 'vue';
|
|
7
|
+
import { useExposeProperties } from '/@/hooks/useExpose';
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
value: {
|
|
11
|
+
type: [Number],
|
|
12
|
+
default: 0,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const emit = defineEmits(['update:value']);
|
|
17
|
+
|
|
18
|
+
const innerValue = defineModel<number>(
|
|
19
|
+
() => props.value,
|
|
20
|
+
(val: number) => emit('update:value', val)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const inputNumberRef = ref<HTMLInputElement | null>(null);
|
|
24
|
+
const instance = getCurrentInstance();
|
|
25
|
+
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
useExposeProperties(inputNumberRef, instance);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
defineExpose({ ...instance!.exposed });
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-popconfirm ref="popconfirmRef">
|
|
3
|
+
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
|
4
|
+
<slot :name="item" v-bind="data || {}"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
</el-popconfirm>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts" name="hsPopconfirm">
|
|
10
|
+
import { ref } from 'vue';
|
|
11
|
+
// 获取ref
|
|
12
|
+
const popconfirmRef = ref(null);
|
|
13
|
+
// 暴露给外部的 ref
|
|
14
|
+
defineExpose({ popconfirmRef });
|
|
15
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-popover ref="popoverRef">
|
|
3
|
+
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
|
4
|
+
<slot :name="item" v-bind="data || {}"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
</el-popover>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts" name="hsPopover">
|
|
10
|
+
import { ref, onMounted, getCurrentInstance } from 'vue';
|
|
11
|
+
import { useExposeProperties } from '/@/hooks/useExpose';
|
|
12
|
+
// 获取ref
|
|
13
|
+
const popoverRef = ref(null);
|
|
14
|
+
// 获取实例方法
|
|
15
|
+
const instance = getCurrentInstance();
|
|
16
|
+
|
|
17
|
+
onMounted(() => {
|
|
18
|
+
useExposeProperties(popoverRef, instance);
|
|
19
|
+
});
|
|
20
|
+
// 暴露给外部的 ref
|
|
21
|
+
defineExpose({ ...instance!.exposed });
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-progress ref="progressRef">
|
|
3
|
+
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
|
4
|
+
<slot :name="item" v-bind="data || {}"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
</el-progress>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts" name="hsProgress">
|
|
10
|
+
import { ref } from 'vue';
|
|
11
|
+
// 获取ref
|
|
12
|
+
const progressRef = ref(null);
|
|
13
|
+
// 暴露给外部的 ref
|
|
14
|
+
defineExpose({ progressRef });
|
|
15
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-radio v-model="innerValue" ref="radioRef">
|
|
3
|
+
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
|
4
|
+
<slot :name="item" v-bind="data || {}"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
</el-radio>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts" name="hsRadio">
|
|
10
|
+
import { ref } from 'vue';
|
|
11
|
+
// props 属性
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
value: {
|
|
14
|
+
type: [String, Number, Boolean],
|
|
15
|
+
default: '',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
// emit 事件
|
|
19
|
+
const emit = defineEmits(['update:value']);
|
|
20
|
+
|
|
21
|
+
const innerValue = defineModel<string | number | boolean>(
|
|
22
|
+
() => props.value,
|
|
23
|
+
(val: string | number | boolean) => emit('update:value', val)
|
|
24
|
+
);
|
|
25
|
+
// 获取ref
|
|
26
|
+
const radioRef = ref<HTMLElement | null>(null);
|
|
27
|
+
// 获取实例方法
|
|
28
|
+
// const instance = getCurrentInstance();
|
|
29
|
+
|
|
30
|
+
// 暴露给外部的 ref
|
|
31
|
+
defineExpose({ radioRef });
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-radio-button ref="radioButtonRef">
|
|
3
|
+
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
|
4
|
+
<slot :name="item" v-bind="data || {}"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
</el-radio-button>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts" name="hsRadioButton">
|
|
10
|
+
import { ref } from 'vue';
|
|
11
|
+
// 获取ref
|
|
12
|
+
const radioButtonRef = ref<HTMLElement | null>(null);
|
|
13
|
+
// 获取实例方法
|
|
14
|
+
// const instance = getCurrentInstance();
|
|
15
|
+
|
|
16
|
+
// 暴露给外部的 ref
|
|
17
|
+
defineExpose({ radioButtonRef });
|
|
18
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-radio-group v-model="innerValue" ref="radioGroupRef">
|
|
3
|
+
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
|
4
|
+
<slot :name="item" v-bind="data || {}"></slot>
|
|
5
|
+
</template>
|
|
6
|
+
</el-radio-group>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts" name="hsRadioGroup">
|
|
10
|
+
import { ref } from 'vue';
|
|
11
|
+
// props 属性
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
value: {
|
|
14
|
+
type: [String, Number, Boolean],
|
|
15
|
+
default: '',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
// emit 事件
|
|
19
|
+
const emit = defineEmits(['update:value']);
|
|
20
|
+
|
|
21
|
+
const innerValue = defineModel<string | number | boolean>(
|
|
22
|
+
() => props.value,
|
|
23
|
+
(val: string | number | boolean) => emit('update:value', val)
|
|
24
|
+
);
|
|
25
|
+
// 获取ref
|
|
26
|
+
const radioGroupRef = ref<HTMLElement | null>(null);
|
|
27
|
+
// 获取实例方法
|
|
28
|
+
// const instance = getCurrentInstance();
|
|
29
|
+
|
|
30
|
+
// 暴露给外部的 ref
|
|
31
|
+
defineExpose({ radioGroupRef });
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-rate v-model="innerValue" ref="rateRef">
|
|
3
|
+
</el-rate>
|
|
4
|
+
</template>
|
|
5
|
+
|
|
6
|
+
<script setup lang="ts" name="hsRate">
|
|
7
|
+
import { ref, onMounted, Ref, getCurrentInstance } from 'vue';
|
|
8
|
+
import { useExposeProperties } from '/@/hooks/useExpose';
|
|
9
|
+
// props 属性
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
value: {
|
|
12
|
+
type: [Number],
|
|
13
|
+
default: 0,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
// emit 事件
|
|
17
|
+
const emit = defineEmits(['update:value']);
|
|
18
|
+
|
|
19
|
+
const innerValue = defineModel<number>(
|
|
20
|
+
() => props.value,
|
|
21
|
+
(val: number) => emit('update:value', val)
|
|
22
|
+
);
|
|
23
|
+
// 获取ref
|
|
24
|
+
const rateRef: Ref<HTMLInputElement | null> = ref(null);
|
|
25
|
+
// 获取实例方法
|
|
26
|
+
const instance = getCurrentInstance();
|
|
27
|
+
|
|
28
|
+
onMounted(() => {
|
|
29
|
+
useExposeProperties(rateRef, instance);
|
|
30
|
+
});
|
|
31
|
+
// 暴露给外部的 ref
|
|
32
|
+
defineExpose({ ...instance!.exposed });
|
|
33
|
+
</script>
|