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,192 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import { Ref, ref } from 'vue';
|
|
3
|
+
import { ElMessageBox, ElMessage, TabPaneName } from 'element-plus';
|
|
4
|
+
import IFormTable from '/@/types/formTable';
|
|
5
|
+
import { find } from 'lodash';
|
|
6
|
+
|
|
7
|
+
export function useHsFormTable(panelConfig: Ref<IFormTable.FormConfig>, tabsActiveName: Ref<string>) {
|
|
8
|
+
/**
|
|
9
|
+
* 添加表格配置
|
|
10
|
+
*/
|
|
11
|
+
const addTabPanel = () => {
|
|
12
|
+
panelConfig.value.forms.push({
|
|
13
|
+
id: 'form_' + (panelConfig.value.forms.length + 1),
|
|
14
|
+
base: { label: '表单配置名称', fieldID: '', grid: 3 },
|
|
15
|
+
form: {
|
|
16
|
+
baseData: { rowGap: 0, columnGap: 0 },
|
|
17
|
+
formConfig: [],
|
|
18
|
+
formData: {},
|
|
19
|
+
},
|
|
20
|
+
component: {
|
|
21
|
+
baseData: {},
|
|
22
|
+
},
|
|
23
|
+
slot: {
|
|
24
|
+
baseData: {},
|
|
25
|
+
},
|
|
26
|
+
formItemType: 'form',
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 移除tabs项
|
|
31
|
+
* @param targetName
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
const removeTabPanel = (targetName: TabPaneName | undefined) => {
|
|
35
|
+
// 查询当前表单配置对象
|
|
36
|
+
let form = find(panelConfig.value.forms, (item: IFormTable.FormbaseData) => item['id'] == targetName);
|
|
37
|
+
console.log('form', form);
|
|
38
|
+
// 删除表单配置提示
|
|
39
|
+
ElMessageBox.confirm(`确定删除${form?.base['formName'] || '表单配置'}吗?`, '提示', {
|
|
40
|
+
confirmButtonText: '确认',
|
|
41
|
+
cancelButtonText: '取消',
|
|
42
|
+
type: 'warning',
|
|
43
|
+
})
|
|
44
|
+
.then(() => {
|
|
45
|
+
// 移除配置
|
|
46
|
+
_.remove(panelConfig.value.forms, (item: IFormTable.FormbaseData) => targetName && item.id == targetName);
|
|
47
|
+
// 给出操作成功提示
|
|
48
|
+
ElMessage.success('删除成功');
|
|
49
|
+
if (tabsActiveName.value == targetName) {
|
|
50
|
+
tabsActiveName.value = 'form_1';
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
.catch((err) => {
|
|
54
|
+
console.log('err', err);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* 编辑tabs
|
|
59
|
+
* @param targetName
|
|
60
|
+
* @param action
|
|
61
|
+
*/
|
|
62
|
+
const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | 'add') => {
|
|
63
|
+
switch (action) {
|
|
64
|
+
case 'remove':
|
|
65
|
+
// 删除配置
|
|
66
|
+
removeTabPanel(targetName);
|
|
67
|
+
break;
|
|
68
|
+
case 'add':
|
|
69
|
+
// 新增配置
|
|
70
|
+
addTabPanel();
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
let config = ref();
|
|
75
|
+
/**
|
|
76
|
+
* 保存表单表格配置
|
|
77
|
+
*/
|
|
78
|
+
const saveFormTableConfig = (form: any) => {
|
|
79
|
+
console.debug('form====>>>>>>', form, panelConfig.value);
|
|
80
|
+
let tempPanelConfig = _.cloneDeep(panelConfig.value);
|
|
81
|
+
let formData = {
|
|
82
|
+
config_name: form['config_name'],
|
|
83
|
+
config_unique_id: form['config_unique_id'],
|
|
84
|
+
attrs: setPropertyData(tempPanelConfig.BaseForm), // 删除属性值为空的属性,
|
|
85
|
+
data: transformData(tempPanelConfig.forms),
|
|
86
|
+
form: tempPanelConfig.forms.map((item: any) => {
|
|
87
|
+
let obj: any = {
|
|
88
|
+
label: item.base.label,
|
|
89
|
+
fieldID: item.base.fieldID,
|
|
90
|
+
grid: item.base.grid,
|
|
91
|
+
formItemType: item.formItemType,
|
|
92
|
+
config:
|
|
93
|
+
item.formItemType == 'form'
|
|
94
|
+
? getFormType(item.formItemType, item.form.formConfig)
|
|
95
|
+
: item.formItemType == 'component'
|
|
96
|
+
? getFormType(item.formItemType, item.component.baseData)
|
|
97
|
+
: getFormType(item.formItemType, item.slot.baseData),
|
|
98
|
+
};
|
|
99
|
+
if (item.formItemType == 'form') {
|
|
100
|
+
obj.attrs = setPropertyData(item.form.baseData); // 删除属性值为空的属性
|
|
101
|
+
}
|
|
102
|
+
return obj;
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
105
|
+
console.debug('tempPanelConfig====>>>>>>', JSON.stringify(formData));
|
|
106
|
+
ElMessage.success('保存配置成功, 可在控制台打印中查看配置数据');
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* 切换表单表格配置
|
|
110
|
+
* @param formItemType
|
|
111
|
+
* @param configData
|
|
112
|
+
* @returns 根据 formItemType 类型返回对应的配置项 form、component、slot
|
|
113
|
+
*/
|
|
114
|
+
const getFormType = (formItemType: string, configData: any) => {
|
|
115
|
+
switch (formItemType) {
|
|
116
|
+
case 'form':
|
|
117
|
+
const arr = configData.map((item: any) => {
|
|
118
|
+
return {
|
|
119
|
+
label: item.data.elementItem[0].baseData.label,
|
|
120
|
+
config: setPropertyData(item.data.elementItem), // 删除属性值为空的属性
|
|
121
|
+
layoutData: item.data.layoutData,
|
|
122
|
+
};
|
|
123
|
+
});
|
|
124
|
+
return arr;
|
|
125
|
+
case 'component':
|
|
126
|
+
return configData;
|
|
127
|
+
case 'slot':
|
|
128
|
+
return configData;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* @param originalData
|
|
133
|
+
* @returns 转换数据
|
|
134
|
+
* @description 将表单配置数据转换成对象
|
|
135
|
+
*/
|
|
136
|
+
function transformData(originalData: any[]) {
|
|
137
|
+
console.log('originalData', originalData);
|
|
138
|
+
|
|
139
|
+
const transformedData: any = {};
|
|
140
|
+
originalData.forEach((item: any) => {
|
|
141
|
+
const key = item.base.fieldID;
|
|
142
|
+
const value: any = {};
|
|
143
|
+
if (item.formItemType != 'form') return (transformedData[key] = {}); // 只处理表单配置
|
|
144
|
+
item.form.formConfig.forEach((config: any) => {
|
|
145
|
+
console.log('config)', config);
|
|
146
|
+
const prop = config.data.elementItem[0].baseData.prop;
|
|
147
|
+
value[prop] = '';
|
|
148
|
+
});
|
|
149
|
+
transformedData[key] = value;
|
|
150
|
+
});
|
|
151
|
+
return transformedData;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* @param params
|
|
155
|
+
* @returns 删除属性值为空的属性
|
|
156
|
+
*/
|
|
157
|
+
function setPropertyData(params: any) {
|
|
158
|
+
function setProperty(property: any) {
|
|
159
|
+
if (property.editRender?.enabled) {
|
|
160
|
+
delete property.cellRender;
|
|
161
|
+
} else if (property.editRender) {
|
|
162
|
+
delete property.editRender;
|
|
163
|
+
}
|
|
164
|
+
for (let i in property) {
|
|
165
|
+
if (_.isString(property[i]) && property[i].trim() === '') {
|
|
166
|
+
delete property[i];
|
|
167
|
+
}
|
|
168
|
+
if (_.isObject(property[i]) && !_.isEmpty(property[i])) {
|
|
169
|
+
setProperty(property[i]);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
setProperty(params);
|
|
174
|
+
|
|
175
|
+
return params;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* 切换表单表格配置
|
|
179
|
+
* @param config
|
|
180
|
+
*/
|
|
181
|
+
// value: string, type: string,
|
|
182
|
+
const changeConfig = (config: IFormTable.FormConfig) => {
|
|
183
|
+
panelConfig.value = config;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
return {
|
|
187
|
+
handleTabsEdit,
|
|
188
|
+
saveFormTableConfig,
|
|
189
|
+
changeConfig,
|
|
190
|
+
config,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="system-user-container layout-padding">
|
|
3
|
+
<el-card shadow="hover" class="layout-padding-auto">
|
|
4
|
+
<bc-page-config class="h-full"></bc-page-config>
|
|
5
|
+
<!-- <div class="bg-green-200" style="height: 100%">99</div> -->
|
|
6
|
+
</el-card>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts" name="systemUser"></script>
|
|
11
|
+
<style scoped lang="scss">
|
|
12
|
+
.layout-padding-auto {
|
|
13
|
+
:deep(.el-card__body) {
|
|
14
|
+
height: 100% !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-padding">
|
|
3
|
+
<el-card shadow="hover" class="layout-padding-auto">
|
|
4
|
+
<hsGetApis />
|
|
5
|
+
</el-card>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts" name="test3_1">
|
|
10
|
+
import hsGetApis from '/@/components/base/hsGetApi/src/hsGetApis.vue';
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<style scoped lang="scss">
|
|
14
|
+
:deep(.el-card__body) {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
flex: 1;
|
|
18
|
+
overflow: auto;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
|
|
4
|
+
theme: {
|
|
5
|
+
extend: {},
|
|
6
|
+
},
|
|
7
|
+
plugins: [],
|
|
8
|
+
corePlugins: {
|
|
9
|
+
// 防止打包冲掉 element-plus 的样式
|
|
10
|
+
preflight: false, // 禁用 Preflight
|
|
11
|
+
},
|
|
12
|
+
};
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Basic Options */
|
|
6
|
+
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
+
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
|
|
8
|
+
"module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
|
|
9
|
+
"lib": ["esnext", "dom", "dom.iterable", "scripthost"] /* Specify library files to be included in the compilation. */,
|
|
10
|
+
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
11
|
+
// "checkJs": true, /* Report errors in .js files. */
|
|
12
|
+
"jsx": "preserve" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
|
|
13
|
+
// "declaration": true /* Generates corresponding '.d.ts' file. */,
|
|
14
|
+
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
15
|
+
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
|
16
|
+
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
17
|
+
// "outDir": "./", /* Redirect output structure to the directory. */
|
|
18
|
+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
19
|
+
// "composite": true, /* Enable project compilation */
|
|
20
|
+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
21
|
+
// "removeComments": true, /* Do not emit comments to output. */
|
|
22
|
+
// "noEmit": true, /* Do not emit outputs. */
|
|
23
|
+
// "importHelpers": true /* Import emit helpers from 'tslib'. */,
|
|
24
|
+
// "downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */,
|
|
25
|
+
"isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,
|
|
26
|
+
|
|
27
|
+
/* Strict Type-Checking Options */
|
|
28
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
29
|
+
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
30
|
+
// "strictNullChecks": true, /* Enable strict null checks. */
|
|
31
|
+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
32
|
+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
|
33
|
+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
34
|
+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
35
|
+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
36
|
+
|
|
37
|
+
/* Additional Checks */
|
|
38
|
+
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
|
39
|
+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
40
|
+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
41
|
+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
42
|
+
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
43
|
+
|
|
44
|
+
/* Module Resolution Options */
|
|
45
|
+
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
|
|
46
|
+
"baseUrl": "." /* Base directory to resolve non-absolute module names. */,
|
|
47
|
+
"paths": {
|
|
48
|
+
"/@/*": ["src/*"],
|
|
49
|
+
"/@parseTable": ["src/components/business/bcFormTable/utils/parseTable"],
|
|
50
|
+
} /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
|
|
51
|
+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
52
|
+
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
53
|
+
"types": ["vite/client"] /* Type declaration files to be included in compilation. */,
|
|
54
|
+
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
|
|
55
|
+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
|
56
|
+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
57
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
58
|
+
|
|
59
|
+
/* Source Map Options */
|
|
60
|
+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
61
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
62
|
+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
63
|
+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
64
|
+
|
|
65
|
+
/* Experimental Options */
|
|
66
|
+
"experimentalDecorators": true /* Enables experimental support for ES7 decorators. */,
|
|
67
|
+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
68
|
+
|
|
69
|
+
/* Advanced Options */
|
|
70
|
+
"skipLibCheck": true /* Skip type checking of declaration files. */,
|
|
71
|
+
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
|
|
72
|
+
},
|
|
73
|
+
"include": ["src/**/*.ts", "src/**/*.vue", "src/**/*.tsx", "src/**/*.d.ts"], // **Represents any directory, and * represents any file. Indicates that all files in the src directory will be compiled
|
|
74
|
+
"exclude": ["node_modules", "dist"] // Indicates the file directory that does not need to be compiled
|
|
75
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import vue from '@vitejs/plugin-vue';
|
|
2
|
+
import { resolve } from 'path';
|
|
3
|
+
import { defineConfig, loadEnv, ConfigEnv } from 'vite';
|
|
4
|
+
import vueSetupExtend from 'vite-plugin-vue-setup-extend-plus';
|
|
5
|
+
import viteCompression from 'vite-plugin-compression';
|
|
6
|
+
import { buildConfig } from './src/utils/build';
|
|
7
|
+
const pathResolve = (dir: string) => {
|
|
8
|
+
return resolve(__dirname, '.', dir);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const alias: Record<string, string> = {
|
|
12
|
+
'/@': pathResolve('./src/'),
|
|
13
|
+
'/@parseTable': pathResolve('./src/components/business/bcFormTable/utils/parseTable'),
|
|
14
|
+
};
|
|
15
|
+
const viteConfig = defineConfig((mode: ConfigEnv) => {
|
|
16
|
+
const env = loadEnv(mode.mode, process.cwd());
|
|
17
|
+
return {
|
|
18
|
+
plugins: [vue(), vueSetupExtend(), viteCompression(), JSON.parse(env.VITE_OPEN_CDN) ? buildConfig.cdn() : null],
|
|
19
|
+
root: process.cwd(),
|
|
20
|
+
resolve: { alias },
|
|
21
|
+
base: mode.command === 'serve' ? './' : env.VITE_PUBLIC_PATH,
|
|
22
|
+
optimizeDeps: {
|
|
23
|
+
exclude: ['vue-demi'],
|
|
24
|
+
},
|
|
25
|
+
server: {
|
|
26
|
+
host: '0.0.0.0',
|
|
27
|
+
port: env.VITE_PORT as unknown as number,
|
|
28
|
+
open: JSON.parse(env.VITE_OPEN),
|
|
29
|
+
hmr: true,
|
|
30
|
+
proxy: {
|
|
31
|
+
'/json': {
|
|
32
|
+
target: 'http://www.hsfrp.top/',
|
|
33
|
+
changeOrigin: true,
|
|
34
|
+
pathRewrite: {
|
|
35
|
+
'^/json': '',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
'/demo': {
|
|
39
|
+
target: 'https://api.vxetable.cn/',
|
|
40
|
+
changeOrigin: true,
|
|
41
|
+
pathRewrite: {
|
|
42
|
+
'^/demo': '',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
'/cms-web': {
|
|
46
|
+
target: 'http://huasuerp.com:9092/',
|
|
47
|
+
changeOrigin: true,
|
|
48
|
+
pathRewrite: {
|
|
49
|
+
'^/cms-web': '',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
'/scmp-web': {
|
|
53
|
+
target: 'https://huasuerp.com:7077/',
|
|
54
|
+
changeOrigin: true,
|
|
55
|
+
pathRewrite: {
|
|
56
|
+
'^/scmp-web': '',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
'/xypms-web': {
|
|
60
|
+
target: 'https://xy.huasuerp.com:7082/',
|
|
61
|
+
changeOrigin: true,
|
|
62
|
+
pathRewrite: {
|
|
63
|
+
'^/xypms-web': '',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
'/qwp-web': {
|
|
67
|
+
target: 'https://huasuerp.com:7076/',
|
|
68
|
+
changeOrigin: true,
|
|
69
|
+
pathRewrite: {
|
|
70
|
+
'^/qwp-web': '',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
build: {
|
|
76
|
+
lib: {
|
|
77
|
+
entry: resolve(__dirname, 'src/main.ts'),
|
|
78
|
+
formats: ['umd'],
|
|
79
|
+
name: 'hsadmin',
|
|
80
|
+
fileName: (format) => `${format}/index.js`,
|
|
81
|
+
},
|
|
82
|
+
cssCodeSplit: true,
|
|
83
|
+
rollupOptions: {
|
|
84
|
+
external: ['@alicloud/console-fetcher', 'react'],
|
|
85
|
+
plugins: [],
|
|
86
|
+
},
|
|
87
|
+
emptyOutDir: false,
|
|
88
|
+
minify: false,
|
|
89
|
+
},
|
|
90
|
+
// build: {
|
|
91
|
+
// outDir: 'dist',
|
|
92
|
+
// chunkSizeWarningLimit: 1500,
|
|
93
|
+
// rollupOptions: {
|
|
94
|
+
// output: {
|
|
95
|
+
// chunkFileNames: 'assets/js/[name]-[hash].js',
|
|
96
|
+
// entryFileNames: 'assets/js/[name]-[hash].js',
|
|
97
|
+
// assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
|
|
98
|
+
// manualChunks(id) {
|
|
99
|
+
// if (id.includes('node_modules')) {
|
|
100
|
+
// return id.toString().match(/\/node_modules\/(?!.pnpm)(?<moduleName>[^\/]*)\//)?.groups!.moduleName ?? 'vender';
|
|
101
|
+
// }
|
|
102
|
+
// },
|
|
103
|
+
// },
|
|
104
|
+
// ...(JSON.parse(env.VITE_OPEN_CDN) ? { external: buildConfig.external } : {}),
|
|
105
|
+
// },
|
|
106
|
+
// },
|
|
107
|
+
css: {
|
|
108
|
+
preprocessorOptions: {
|
|
109
|
+
css: { charset: false },
|
|
110
|
+
},
|
|
111
|
+
postcss: {
|
|
112
|
+
plugins: [require('tailwindcss')],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
define: {
|
|
116
|
+
__NEXT_VERSION__: JSON.stringify(process.env.npm_package_version),
|
|
117
|
+
__NEXT_NAME__: JSON.stringify(process.env.npm_package_name),
|
|
118
|
+
__IS_DEV__: JSON.stringify(mode.command == 'serve'),
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export default viteConfig;
|