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