v-nuxt-ui 0.1.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/README.md +153 -0
- package/dist/module.d.mts +13 -0
- package/dist/module.json +15 -0
- package/dist/module.mjs +45 -0
- package/dist/runtime/assets/css/main.css +1 -0
- package/dist/runtime/assets/css/transition.css +1 -0
- package/dist/runtime/components/CircleProgress.d.vue.ts +17 -0
- package/dist/runtime/components/CircleProgress.vue +75 -0
- package/dist/runtime/components/CircleProgress.vue.d.ts +17 -0
- package/dist/runtime/components/DeleteModal.d.vue.ts +14 -0
- package/dist/runtime/components/DeleteModal.vue +57 -0
- package/dist/runtime/components/DeleteModal.vue.d.ts +14 -0
- package/dist/runtime/components/Dnd.client.d.vue.ts +25 -0
- package/dist/runtime/components/Dnd.client.vue +47 -0
- package/dist/runtime/components/Dnd.client.vue.d.ts +25 -0
- package/dist/runtime/components/EChart.client.d.vue.ts +19 -0
- package/dist/runtime/components/EChart.client.vue +72 -0
- package/dist/runtime/components/EChart.client.vue.d.ts +19 -0
- package/dist/runtime/components/Empty.d.vue.ts +12 -0
- package/dist/runtime/components/Empty.vue +26 -0
- package/dist/runtime/components/Empty.vue.d.ts +12 -0
- package/dist/runtime/components/PermissionWrapper.d.vue.ts +23 -0
- package/dist/runtime/components/PermissionWrapper.vue +51 -0
- package/dist/runtime/components/PermissionWrapper.vue.d.ts +23 -0
- package/dist/runtime/components/ScrollArea.d.vue.ts +26 -0
- package/dist/runtime/components/ScrollArea.vue +201 -0
- package/dist/runtime/components/ScrollArea.vue.d.ts +26 -0
- package/dist/runtime/components/Spin.d.vue.ts +16 -0
- package/dist/runtime/components/Spin.vue +22 -0
- package/dist/runtime/components/Spin.vue.d.ts +16 -0
- package/dist/runtime/components/SqlEditor.d.vue.ts +23 -0
- package/dist/runtime/components/SqlEditor.vue +255 -0
- package/dist/runtime/components/SqlEditor.vue.d.ts +23 -0
- package/dist/runtime/components/Watermark.d.vue.ts +44 -0
- package/dist/runtime/components/Watermark.vue +162 -0
- package/dist/runtime/components/Watermark.vue.d.ts +44 -0
- package/dist/runtime/components/badge/CodeModal.client.d.vue.ts +11 -0
- package/dist/runtime/components/badge/CodeModal.client.vue +77 -0
- package/dist/runtime/components/badge/CodeModal.client.vue.d.ts +11 -0
- package/dist/runtime/components/badge/CodeTooltip.client.d.vue.ts +9 -0
- package/dist/runtime/components/badge/CodeTooltip.client.vue +57 -0
- package/dist/runtime/components/badge/CodeTooltip.client.vue.d.ts +9 -0
- package/dist/runtime/components/button/Dropdown.d.vue.ts +31 -0
- package/dist/runtime/components/button/Dropdown.vue +123 -0
- package/dist/runtime/components/button/Dropdown.vue.d.ts +31 -0
- package/dist/runtime/components/button/Theme.d.vue.ts +19 -0
- package/dist/runtime/components/button/Theme.vue +45 -0
- package/dist/runtime/components/button/Theme.vue.d.ts +19 -0
- package/dist/runtime/components/date-picker/Input.d.vue.ts +18 -0
- package/dist/runtime/components/date-picker/Input.vue +39 -0
- package/dist/runtime/components/date-picker/Input.vue.d.ts +18 -0
- package/dist/runtime/components/date-picker/index.d.vue.ts +26 -0
- package/dist/runtime/components/date-picker/index.vue +223 -0
- package/dist/runtime/components/date-picker/index.vue.d.ts +26 -0
- package/dist/runtime/components/flow/FlowEdge.client.d.vue.ts +5 -0
- package/dist/runtime/components/flow/FlowEdge.client.vue +110 -0
- package/dist/runtime/components/flow/FlowEdge.client.vue.d.ts +5 -0
- package/dist/runtime/components/flow/FlowNode.client.d.vue.ts +8 -0
- package/dist/runtime/components/flow/FlowNode.client.vue +79 -0
- package/dist/runtime/components/flow/FlowNode.client.vue.d.ts +8 -0
- package/dist/runtime/components/flow/FlowStats.d.vue.ts +7 -0
- package/dist/runtime/components/flow/FlowStats.vue +17 -0
- package/dist/runtime/components/flow/FlowStats.vue.d.ts +7 -0
- package/dist/runtime/components/flow/FlowToolbar.d.vue.ts +14 -0
- package/dist/runtime/components/flow/FlowToolbar.vue +113 -0
- package/dist/runtime/components/flow/FlowToolbar.vue.d.ts +14 -0
- package/dist/runtime/components/form/create-modal-template/WithApi.d.vue.ts +19 -0
- package/dist/runtime/components/form/create-modal-template/WithApi.vue +36 -0
- package/dist/runtime/components/form/create-modal-template/WithApi.vue.d.ts +19 -0
- package/dist/runtime/components/form/create-modal-template/index.d.vue.ts +19 -0
- package/dist/runtime/components/form/create-modal-template/index.vue +75 -0
- package/dist/runtime/components/form/create-modal-template/index.vue.d.ts +19 -0
- package/dist/runtime/components/form/field/AsyncObjectSelect.d.vue.ts +23 -0
- package/dist/runtime/components/form/field/AsyncObjectSelect.vue +46 -0
- package/dist/runtime/components/form/field/AsyncObjectSelect.vue.d.ts +23 -0
- package/dist/runtime/components/form/field/AsyncSelect.d.vue.ts +26 -0
- package/dist/runtime/components/form/field/AsyncSelect.vue +140 -0
- package/dist/runtime/components/form/field/AsyncSelect.vue.d.ts +26 -0
- package/dist/runtime/components/form/field/AsyncTreeSelect.d.vue.ts +27 -0
- package/dist/runtime/components/form/field/AsyncTreeSelect.vue +130 -0
- package/dist/runtime/components/form/field/AsyncTreeSelect.vue.d.ts +27 -0
- package/dist/runtime/components/form/field/ButtonSwitch.d.vue.ts +19 -0
- package/dist/runtime/components/form/field/ButtonSwitch.vue +29 -0
- package/dist/runtime/components/form/field/ButtonSwitch.vue.d.ts +19 -0
- package/dist/runtime/components/form/field/DatePicker.d.vue.ts +26 -0
- package/dist/runtime/components/form/field/DatePicker.vue +89 -0
- package/dist/runtime/components/form/field/DatePicker.vue.d.ts +26 -0
- package/dist/runtime/components/form/field/DynamicInput.d.vue.ts +14 -0
- package/dist/runtime/components/form/field/DynamicInput.vue +52 -0
- package/dist/runtime/components/form/field/DynamicInput.vue.d.ts +14 -0
- package/dist/runtime/components/form/field/DynamicObjectInput.d.vue.ts +20 -0
- package/dist/runtime/components/form/field/DynamicObjectInput.vue +82 -0
- package/dist/runtime/components/form/field/DynamicObjectInput.vue.d.ts +20 -0
- package/dist/runtime/components/form/field/Input.d.vue.ts +17 -0
- package/dist/runtime/components/form/field/Input.vue +41 -0
- package/dist/runtime/components/form/field/Input.vue.d.ts +17 -0
- package/dist/runtime/components/form/field/InputPassword.d.vue.ts +17 -0
- package/dist/runtime/components/form/field/InputPassword.vue +40 -0
- package/dist/runtime/components/form/field/InputPassword.vue.d.ts +17 -0
- package/dist/runtime/components/form/field/InputStringNumber.d.vue.ts +16 -0
- package/dist/runtime/components/form/field/InputStringNumber.vue +56 -0
- package/dist/runtime/components/form/field/InputStringNumber.vue.d.ts +16 -0
- package/dist/runtime/components/form/field/Select.d.vue.ts +16 -0
- package/dist/runtime/components/form/field/Select.vue +29 -0
- package/dist/runtime/components/form/field/Select.vue.d.ts +16 -0
- package/dist/runtime/components/form/field/SqlEditor.d.vue.ts +10 -0
- package/dist/runtime/components/form/field/SqlEditor.vue +28 -0
- package/dist/runtime/components/form/field/SqlEditor.vue.d.ts +10 -0
- package/dist/runtime/components/form/field/TreeSelectTransfer.d.vue.ts +4 -0
- package/dist/runtime/components/form/field/TreeSelectTransfer.vue +89 -0
- package/dist/runtime/components/form/field/TreeSelectTransfer.vue.d.ts +4 -0
- package/dist/runtime/components/form/field/index.d.vue.ts +26 -0
- package/dist/runtime/components/form/field/index.vue +212 -0
- package/dist/runtime/components/form/field/index.vue.d.ts +26 -0
- package/dist/runtime/components/form/index.d.vue.ts +21 -0
- package/dist/runtime/components/form/index.vue +77 -0
- package/dist/runtime/components/form/index.vue.d.ts +21 -0
- package/dist/runtime/components/layout/ModuleMenu.d.vue.ts +6 -0
- package/dist/runtime/components/layout/ModuleMenu.vue +48 -0
- package/dist/runtime/components/layout/ModuleMenu.vue.d.ts +6 -0
- package/dist/runtime/components/layout/ThemePicker.d.vue.ts +3 -0
- package/dist/runtime/components/layout/ThemePicker.vue +100 -0
- package/dist/runtime/components/layout/ThemePicker.vue.d.ts +3 -0
- package/dist/runtime/components/layout/UserMenu.d.vue.ts +7 -0
- package/dist/runtime/components/layout/UserMenu.vue +77 -0
- package/dist/runtime/components/layout/UserMenu.vue.d.ts +7 -0
- package/dist/runtime/components/layout/default.d.vue.ts +13 -0
- package/dist/runtime/components/layout/default.vue +82 -0
- package/dist/runtime/components/layout/default.vue.d.ts +13 -0
- package/dist/runtime/components/placeholder/Svg.d.vue.ts +3 -0
- package/dist/runtime/components/placeholder/Svg.vue +22 -0
- package/dist/runtime/components/placeholder/Svg.vue.d.ts +3 -0
- package/dist/runtime/components/simple-table/index.d.vue.ts +21 -0
- package/dist/runtime/components/simple-table/index.vue +159 -0
- package/dist/runtime/components/simple-table/index.vue.d.ts +21 -0
- package/dist/runtime/components/table/ExcelExportModal.d.vue.ts +28 -0
- package/dist/runtime/components/table/ExcelExportModal.vue +82 -0
- package/dist/runtime/components/table/ExcelExportModal.vue.d.ts +28 -0
- package/dist/runtime/components/table/Page.d.vue.ts +26 -0
- package/dist/runtime/components/table/Page.vue +130 -0
- package/dist/runtime/components/table/Page.vue.d.ts +26 -0
- package/dist/runtime/components/table/Pagination.d.vue.ts +19 -0
- package/dist/runtime/components/table/Pagination.vue +51 -0
- package/dist/runtime/components/table/Pagination.vue.d.ts +19 -0
- package/dist/runtime/components/table/TooltipCell.d.vue.ts +7 -0
- package/dist/runtime/components/table/TooltipCell.vue +23 -0
- package/dist/runtime/components/table/TooltipCell.vue.d.ts +7 -0
- package/dist/runtime/components/table/column/ActionHeader.d.vue.ts +21 -0
- package/dist/runtime/components/table/column/ActionHeader.vue +155 -0
- package/dist/runtime/components/table/column/ActionHeader.vue.d.ts +21 -0
- package/dist/runtime/components/table/expansion/Field.d.vue.ts +18 -0
- package/dist/runtime/components/table/expansion/Field.vue +33 -0
- package/dist/runtime/components/table/expansion/Field.vue.d.ts +18 -0
- package/dist/runtime/components/table/expansion/Layout.d.vue.ts +13 -0
- package/dist/runtime/components/table/expansion/Layout.vue +8 -0
- package/dist/runtime/components/table/expansion/Layout.vue.d.ts +13 -0
- package/dist/runtime/components/table/header/index.d.vue.ts +19 -0
- package/dist/runtime/components/table/header/index.vue +221 -0
- package/dist/runtime/components/table/header/index.vue.d.ts +19 -0
- package/dist/runtime/components/table/header/settings/columns/DndList.d.vue.ts +32 -0
- package/dist/runtime/components/table/header/settings/columns/DndList.vue +46 -0
- package/dist/runtime/components/table/header/settings/columns/DndList.vue.d.ts +32 -0
- package/dist/runtime/components/table/header/settings/columns/Item.d.vue.ts +18 -0
- package/dist/runtime/components/table/header/settings/columns/Item.vue +59 -0
- package/dist/runtime/components/table/header/settings/columns/Item.vue.d.ts +18 -0
- package/dist/runtime/components/table/header/settings/columns/index.d.vue.ts +24 -0
- package/dist/runtime/components/table/header/settings/columns/index.vue +143 -0
- package/dist/runtime/components/table/header/settings/columns/index.vue.d.ts +24 -0
- package/dist/runtime/components/table/header/settings/index.d.vue.ts +25 -0
- package/dist/runtime/components/table/header/settings/index.vue +35 -0
- package/dist/runtime/components/table/header/settings/index.vue.d.ts +25 -0
- package/dist/runtime/components/table/index.d.vue.ts +26 -0
- package/dist/runtime/components/table/index.vue +121 -0
- package/dist/runtime/components/table/index.vue.d.ts +26 -0
- package/dist/runtime/components/table/query/order/Item.d.vue.ts +28 -0
- package/dist/runtime/components/table/query/order/Item.vue +85 -0
- package/dist/runtime/components/table/query/order/Item.vue.d.ts +28 -0
- package/dist/runtime/components/table/query/order/Newer.d.vue.ts +25 -0
- package/dist/runtime/components/table/query/order/Newer.vue +50 -0
- package/dist/runtime/components/table/query/order/Newer.vue.d.ts +25 -0
- package/dist/runtime/components/table/query/order/index.d.vue.ts +19 -0
- package/dist/runtime/components/table/query/order/index.vue +108 -0
- package/dist/runtime/components/table/query/order/index.vue.d.ts +19 -0
- package/dist/runtime/components/table/query/where/Newer.d.vue.ts +14 -0
- package/dist/runtime/components/table/query/where/Newer.vue +44 -0
- package/dist/runtime/components/table/query/where/Newer.vue.d.ts +14 -0
- package/dist/runtime/components/table/query/where/index.d.vue.ts +21 -0
- package/dist/runtime/components/table/query/where/index.vue +108 -0
- package/dist/runtime/components/table/query/where/index.vue.d.ts +21 -0
- package/dist/runtime/components/table/query/where/simple/index.d.vue.ts +7 -0
- package/dist/runtime/components/table/query/where/simple/index.vue +47 -0
- package/dist/runtime/components/table/query/where/simple/index.vue.d.ts +7 -0
- package/dist/runtime/components/table/query/where/simple/item/ColumnPicker.d.vue.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/ColumnPicker.vue +65 -0
- package/dist/runtime/components/table/query/where/simple/item/ColumnPicker.vue.d.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/OprPicker.d.vue.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/OprPicker.vue +68 -0
- package/dist/runtime/components/table/query/where/simple/item/OprPicker.vue.d.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/index.d.vue.ts +20 -0
- package/dist/runtime/components/table/query/where/simple/item/index.vue +56 -0
- package/dist/runtime/components/table/query/where/simple/item/index.vue.d.ts +20 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.d.vue.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue +152 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/AsyncSelect.vue.d.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.d.vue.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.vue +232 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/DatePicker.vue.d.ts +27 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Input.d.vue.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Input.vue +57 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Input.vue.d.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/InputNumber.d.vue.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/InputNumber.vue +45 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/InputNumber.vue.d.ts +29 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Select.d.vue.ts +28 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Select.vue +62 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/Select.vue.d.ts +28 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/index.d.vue.ts +19 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/index.vue +72 -0
- package/dist/runtime/components/table/query/where/simple/item/opr/index.vue.d.ts +19 -0
- package/dist/runtime/composables/api/flow/index.d.ts +3 -0
- package/dist/runtime/composables/api/flow/index.js +3 -0
- package/dist/runtime/composables/api/flow/useFlowApi.d.ts +1 -0
- package/dist/runtime/composables/api/flow/useFlowApi.js +1 -0
- package/dist/runtime/composables/api/flow/useFlowNodeApi.d.ts +1 -0
- package/dist/runtime/composables/api/flow/useFlowNodeApi.js +1 -0
- package/dist/runtime/composables/api/flow/useFlowNodeLinkApi.d.ts +1 -0
- package/dist/runtime/composables/api/flow/useFlowNodeLinkApi.js +1 -0
- package/dist/runtime/composables/api/index.d.ts +4 -0
- package/dist/runtime/composables/api/index.js +4 -0
- package/dist/runtime/composables/api/sys/index.d.ts +9 -0
- package/dist/runtime/composables/api/sys/index.js +9 -0
- package/dist/runtime/composables/api/sys/useAuthApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useAuthApi.js +13 -0
- package/dist/runtime/composables/api/sys/useCompanyApi.d.ts +1 -0
- package/dist/runtime/composables/api/sys/useCompanyApi.js +3 -0
- package/dist/runtime/composables/api/sys/useDepartmentApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useDepartmentApi.js +30 -0
- package/dist/runtime/composables/api/sys/useJobTitleApi.d.ts +1 -0
- package/dist/runtime/composables/api/sys/useJobTitleApi.js +3 -0
- package/dist/runtime/composables/api/sys/useLoginApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useLoginApi.js +13 -0
- package/dist/runtime/composables/api/sys/useMenuApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useMenuApi.js +32 -0
- package/dist/runtime/composables/api/sys/useRoleApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useRoleApi.js +20 -0
- package/dist/runtime/composables/api/sys/useRowRecord.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useRowRecord.js +8 -0
- package/dist/runtime/composables/api/sys/useUserApi.d.ts +0 -0
- package/dist/runtime/composables/api/sys/useUserApi.js +39 -0
- package/dist/runtime/composables/api/useApi.d.ts +0 -0
- package/dist/runtime/composables/api/useApi.js +103 -0
- package/dist/runtime/composables/api/useModel.d.ts +3 -0
- package/dist/runtime/composables/api/useModel.js +4 -0
- package/dist/runtime/composables/flow/index.d.ts +3 -0
- package/dist/runtime/composables/flow/index.js +3 -0
- package/dist/runtime/composables/flow/useFlow.d.ts +0 -0
- package/dist/runtime/composables/flow/useFlow.js +162 -0
- package/dist/runtime/composables/flow/useFlowResize.d.ts +56 -0
- package/dist/runtime/composables/flow/useFlowResize.js +148 -0
- package/dist/runtime/composables/flow/useFlowStyles.d.ts +14 -0
- package/dist/runtime/composables/flow/useFlowStyles.js +32 -0
- package/dist/runtime/composables/index.d.ts +13 -0
- package/dist/runtime/composables/index.js +13 -0
- package/dist/runtime/composables/table/index.d.ts +9 -0
- package/dist/runtime/composables/table/index.js +9 -0
- package/dist/runtime/composables/table/useTable.d.ts +0 -0
- package/dist/runtime/composables/table/useTable.js +340 -0
- package/dist/runtime/composables/table/useTableColumns.d.ts +30 -0
- package/dist/runtime/composables/table/useTableColumns.js +214 -0
- package/dist/runtime/composables/table/useTableData.d.ts +29 -0
- package/dist/runtime/composables/table/useTableData.js +92 -0
- package/dist/runtime/composables/table/useTableOpr.d.ts +8 -0
- package/dist/runtime/composables/table/useTableOpr.js +91 -0
- package/dist/runtime/composables/table/useTablePagination.d.ts +7 -0
- package/dist/runtime/composables/table/useTablePagination.js +29 -0
- package/dist/runtime/composables/table/useTableQuery.d.ts +23 -0
- package/dist/runtime/composables/table/useTableQuery.js +131 -0
- package/dist/runtime/composables/table/useTableRowActions.d.ts +18 -0
- package/dist/runtime/composables/table/useTableRowActions.js +154 -0
- package/dist/runtime/composables/table/useTableRowSelection.d.ts +6 -0
- package/dist/runtime/composables/table/useTableRowSelection.js +26 -0
- package/dist/runtime/composables/table/useTableView.d.ts +0 -0
- package/dist/runtime/composables/table/useTableView.js +150 -0
- package/dist/runtime/composables/useApp.d.ts +22 -0
- package/dist/runtime/composables/useApp.js +83 -0
- package/dist/runtime/composables/useAuth.d.ts +14 -0
- package/dist/runtime/composables/useAuth.js +92 -0
- package/dist/runtime/composables/useBoolean.d.ts +58 -0
- package/dist/runtime/composables/useBoolean.js +71 -0
- package/dist/runtime/composables/useDate.d.ts +25 -0
- package/dist/runtime/composables/useDate.js +157 -0
- package/dist/runtime/composables/useEChart.d.ts +103 -0
- package/dist/runtime/composables/useEChart.js +120 -0
- package/dist/runtime/composables/useForm.d.ts +0 -0
- package/dist/runtime/composables/useForm.js +60 -0
- package/dist/runtime/composables/usePermission.d.ts +10 -0
- package/dist/runtime/composables/usePermission.js +53 -0
- package/dist/runtime/composables/useRouterPush.d.ts +8 -0
- package/dist/runtime/composables/useRouterPush.js +37 -0
- package/dist/runtime/composables/useSidebarMenu.d.ts +36 -0
- package/dist/runtime/composables/useSidebarMenu.js +131 -0
- package/dist/runtime/composables/useTheme.d.ts +20 -0
- package/dist/runtime/composables/useTheme.js +94 -0
- package/dist/runtime/constants/columns.d.ts +3 -0
- package/dist/runtime/constants/columns.js +52 -0
- package/dist/runtime/constants/flow.d.ts +12 -0
- package/dist/runtime/constants/flow.js +24 -0
- package/dist/runtime/constants/index.d.ts +6 -0
- package/dist/runtime/constants/index.js +6 -0
- package/dist/runtime/constants/menu.d.ts +9 -0
- package/dist/runtime/constants/menu.js +11 -0
- package/dist/runtime/constants/options.d.ts +8 -0
- package/dist/runtime/constants/options.js +15 -0
- package/dist/runtime/constants/time.d.ts +7 -0
- package/dist/runtime/constants/time.js +12 -0
- package/dist/runtime/constants/user.d.ts +7 -0
- package/dist/runtime/constants/user.js +7 -0
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/plugins/01.nuxtUIEnhancement.d.ts +18 -0
- package/dist/runtime/plugins/01.nuxtUIEnhancement.js +52 -0
- package/dist/runtime/plugins/02.dayjs.d.ts +13 -0
- package/dist/runtime/plugins/02.dayjs.js +9 -0
- package/dist/runtime/plugins/03.theme.d.ts +2 -0
- package/dist/runtime/plugins/03.theme.js +33 -0
- package/dist/runtime/plugins/04.head.d.ts +2 -0
- package/dist/runtime/plugins/04.head.js +29 -0
- package/dist/runtime/types/app.d.ts +42 -0
- package/dist/runtime/types/app.js +0 -0
- package/dist/runtime/types/cmds/login.d.ts +23 -0
- package/dist/runtime/types/cmds/sys.d.ts +10 -0
- package/dist/runtime/types/cmds/user.d.ts +8 -0
- package/dist/runtime/types/components/date.d.ts +5 -0
- package/dist/runtime/types/components/date.js +0 -0
- package/dist/runtime/types/components/dnd.d.ts +14 -0
- package/dist/runtime/types/components/dnd.js +0 -0
- package/dist/runtime/types/components/form/field.d.ts +102 -0
- package/dist/runtime/types/components/form/field.js +0 -0
- package/dist/runtime/types/components/form/index.d.ts +27 -0
- package/dist/runtime/types/components/form/index.js +1 -0
- package/dist/runtime/types/components/index.d.ts +4 -0
- package/dist/runtime/types/components/index.js +4 -0
- package/dist/runtime/types/components/table/column.d.ts +35 -0
- package/dist/runtime/types/components/table/column.js +0 -0
- package/dist/runtime/types/components/table/header.d.ts +33 -0
- package/dist/runtime/types/components/table/header.js +0 -0
- package/dist/runtime/types/components/table/index.d.ts +103 -0
- package/dist/runtime/types/components/table/index.js +4 -0
- package/dist/runtime/types/components/table/pagination.d.ts +14 -0
- package/dist/runtime/types/components/table/pagination.js +0 -0
- package/dist/runtime/types/components/table/query/index.d.ts +2 -0
- package/dist/runtime/types/components/table/query/index.js +2 -0
- package/dist/runtime/types/components/table/query/order.d.ts +16 -0
- package/dist/runtime/types/components/table/query/order.js +0 -0
- package/dist/runtime/types/components/table/query/where.d.ts +26 -0
- package/dist/runtime/types/components/table/query/where.js +0 -0
- package/dist/runtime/types/constants/time.d.ts +5 -0
- package/dist/runtime/types/index.d.ts +14 -0
- package/dist/runtime/types/index.js +6 -0
- package/dist/runtime/types/localStorage.d.ts +15 -0
- package/dist/runtime/types/locale.d.ts +81 -0
- package/dist/runtime/types/locale.js +0 -0
- package/dist/runtime/types/models/base.d.ts +16 -0
- package/dist/runtime/types/models/flow.d.ts +31 -0
- package/dist/runtime/types/models/sys.d.ts +107 -0
- package/dist/runtime/types/query.d.ts +45 -0
- package/dist/runtime/types/query.js +1 -0
- package/dist/runtime/types/request.d.ts +55 -0
- package/dist/runtime/types/request.js +22 -0
- package/dist/runtime/types/storage.d.ts +10 -0
- package/dist/runtime/types/storage.js +11 -0
- package/dist/runtime/utils/array.d.ts +1 -0
- package/dist/runtime/utils/array.js +3 -0
- package/dist/runtime/utils/diff.d.ts +2 -0
- package/dist/runtime/utils/diff.js +81 -0
- package/dist/runtime/utils/download/index.d.ts +1 -0
- package/dist/runtime/utils/download/index.js +1 -0
- package/dist/runtime/utils/download/tagA.d.ts +2 -0
- package/dist/runtime/utils/download/tagA.js +14 -0
- package/dist/runtime/utils/emoji.d.ts +1 -0
- package/dist/runtime/utils/emoji.js +57 -0
- package/dist/runtime/utils/excel.d.ts +3 -0
- package/dist/runtime/utils/excel.js +63 -0
- package/dist/runtime/utils/form.d.ts +2 -0
- package/dist/runtime/utils/form.js +142 -0
- package/dist/runtime/utils/index.d.ts +11 -0
- package/dist/runtime/utils/index.js +11 -0
- package/dist/runtime/utils/request.d.ts +3 -0
- package/dist/runtime/utils/request.js +3 -0
- package/dist/runtime/utils/string.d.ts +6 -0
- package/dist/runtime/utils/string.js +18 -0
- package/dist/runtime/utils/tree.d.ts +8 -0
- package/dist/runtime/utils/tree.js +54 -0
- package/dist/runtime/utils/type.d.ts +1 -0
- package/dist/runtime/utils/type.js +3 -0
- package/dist/runtime/utils/vueuse.d.ts +1 -0
- package/dist/runtime/utils/vueuse.js +20 -0
- package/dist/types.d.mts +3 -0
- package/package.json +108 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
2
|
+
import { defu } from "defu";
|
|
3
|
+
import { useApp } from "./useApp.js";
|
|
4
|
+
import { useTheme } from "./useTheme.js";
|
|
5
|
+
import { triggerFileDownloadFromUrl } from "#v/utils";
|
|
6
|
+
const _useEChart = () => {
|
|
7
|
+
const app = useApp();
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
const parseCSSVariableColor = (colorStr) => {
|
|
10
|
+
if (!colorStr?.startsWith("var(")) return colorStr;
|
|
11
|
+
const varName = colorStr.match(/var\((--[^,)]+)/)?.[1];
|
|
12
|
+
if (!varName) return colorStr;
|
|
13
|
+
const value = getComputedStyle(document.documentElement).getPropertyValue(varName).trim();
|
|
14
|
+
return value || colorStr;
|
|
15
|
+
};
|
|
16
|
+
const getNormedUiTextColor = () => parseCSSVariableColor("var(--ui-text-muted)");
|
|
17
|
+
const getNormedUiBorderColor = () => parseCSSVariableColor("var(--ui-border)");
|
|
18
|
+
const getNormedRadius = () => Math.round((app.appConfig.value.radius ?? 0.25) * 16);
|
|
19
|
+
const getNormedChartColors = () => theme.chartColorVars.value.map((colorVar) => parseCSSVariableColor(colorVar));
|
|
20
|
+
const getCommonGridOption = () => ({
|
|
21
|
+
grid: { left: "0", right: "0", bottom: "32", top: "20", containLabel: true }
|
|
22
|
+
});
|
|
23
|
+
const getCommonLegendOption = () => ({
|
|
24
|
+
legend: {
|
|
25
|
+
show: true,
|
|
26
|
+
bottom: "0",
|
|
27
|
+
itemGap: 12,
|
|
28
|
+
itemWidth: 12,
|
|
29
|
+
itemHeight: 12,
|
|
30
|
+
textStyle: { color: getNormedUiTextColor() },
|
|
31
|
+
icon: "circle"
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const getCommonXAxisOption = () => ({
|
|
35
|
+
color: getNormedChartColors(),
|
|
36
|
+
xAxis: {
|
|
37
|
+
nameTextStyle: { color: getNormedUiTextColor() },
|
|
38
|
+
axisLine: { show: true, lineStyle: { color: getNormedUiBorderColor() } },
|
|
39
|
+
axisLabel: { color: getNormedUiTextColor(), interval: () => true, hideOverlap: true },
|
|
40
|
+
axisTick: { show: true, interval: () => true, lineStyle: { color: getNormedUiBorderColor() } }
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const getCommonYAxisOption = () => ({
|
|
44
|
+
yAxis: {
|
|
45
|
+
nameTextStyle: { color: getNormedUiTextColor() },
|
|
46
|
+
axisLine: { show: true, lineStyle: { color: getNormedUiBorderColor() } },
|
|
47
|
+
axisLabel: { color: getNormedUiTextColor() },
|
|
48
|
+
splitLine: { show: false, lineStyle: { color: getNormedUiBorderColor(), type: "dashed" } }
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const getCommonBarOption = () => ({
|
|
52
|
+
itemStyle: { borderRadius: [getNormedRadius(), getNormedRadius(), 0, 0] },
|
|
53
|
+
emphasis: { focus: "series" },
|
|
54
|
+
label: { color: getNormedUiTextColor(), distance: 2 }
|
|
55
|
+
});
|
|
56
|
+
const getCommonBarOptionWithColor = (idx) => {
|
|
57
|
+
const colors = getNormedChartColors();
|
|
58
|
+
return defu(getCommonBarOption(), { emphasis: { itemStyle: { color: colors[idx] } } });
|
|
59
|
+
};
|
|
60
|
+
const getCommonLineOption = () => ({
|
|
61
|
+
emphasis: { focus: "series" },
|
|
62
|
+
label: { color: getNormedUiTextColor(), distance: 2 }
|
|
63
|
+
});
|
|
64
|
+
const getCommonLineOptionWithColor = (idx) => {
|
|
65
|
+
const colors = getNormedChartColors();
|
|
66
|
+
return defu(getCommonLineOption(), {
|
|
67
|
+
emphasis: { lineStyle: { color: colors[idx] } },
|
|
68
|
+
lineStyle: { color: colors[idx] }
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const getChartDataURL = (chart, options = {}) => {
|
|
72
|
+
if (!chart || typeof chart.getDataURL !== "function") return null;
|
|
73
|
+
const { type = "png", backgroundColor = "", pixelRatio = Math.max(1, window.devicePixelRatio || 1) } = options;
|
|
74
|
+
const echartsType = type === "jpg" ? "jpeg" : type;
|
|
75
|
+
try {
|
|
76
|
+
return chart.getDataURL({ type: echartsType, backgroundColor, pixelRatio });
|
|
77
|
+
} catch (e) {
|
|
78
|
+
console.error("Failed to get EChart dataURL:", e);
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const exportChartAsImage = (chart, options = {}) => {
|
|
83
|
+
const { type = "png", backgroundColor = "", pixelRatio = Math.max(1, window.devicePixelRatio || 1), filename = "chart" } = options;
|
|
84
|
+
const dataURL = getChartDataURL(chart, { type, backgroundColor, pixelRatio });
|
|
85
|
+
if (!dataURL) return;
|
|
86
|
+
triggerFileDownloadFromUrl(dataURL, `${filename}.${type}`);
|
|
87
|
+
};
|
|
88
|
+
const mergeSeries = (series) => {
|
|
89
|
+
return series.map((s, seriesIndex) => {
|
|
90
|
+
if (s?.type === "bar") return defu(s, getCommonBarOptionWithColor(seriesIndex));
|
|
91
|
+
if (s?.type === "line") return defu(s, getCommonLineOptionWithColor(seriesIndex));
|
|
92
|
+
return s;
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const mergeOption = (option) => {
|
|
96
|
+
const commonOption = defu(getCommonGridOption(), getCommonLegendOption(), getCommonXAxisOption(), getCommonYAxisOption());
|
|
97
|
+
const merged = defu(option, commonOption);
|
|
98
|
+
if (merged.yAxis && Array.isArray(merged.yAxis) && merged.yAxis.length > 1) {
|
|
99
|
+
const yAxisDefaults = getCommonYAxisOption().yAxis;
|
|
100
|
+
merged.yAxis = merged.yAxis.map((axis) => defu(axis, yAxisDefaults));
|
|
101
|
+
}
|
|
102
|
+
if (merged.series && Array.isArray(merged.series)) {
|
|
103
|
+
merged.series = mergeSeries(merged.series);
|
|
104
|
+
}
|
|
105
|
+
return merged;
|
|
106
|
+
};
|
|
107
|
+
return {
|
|
108
|
+
getCommonGridOption,
|
|
109
|
+
getCommonLegendOption,
|
|
110
|
+
getCommonXAxisOption,
|
|
111
|
+
getCommonYAxisOption,
|
|
112
|
+
getCommonBarOption,
|
|
113
|
+
getCommonLineOption,
|
|
114
|
+
mergeSeries,
|
|
115
|
+
mergeOption,
|
|
116
|
+
parseCSSVariableColor,
|
|
117
|
+
exportChartAsImage
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
export const useEChart = createSharedComposable(_useEChart);
|
|
File without changes
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ref, watch } from "vue";
|
|
2
|
+
import { defu } from "defu";
|
|
3
|
+
import { getObjWithModifiedFields } from "#v/utils";
|
|
4
|
+
import { useToast } from "@nuxt/ui/runtime/composables/useToast.js";
|
|
5
|
+
export const useFormValues = (raw, defaultValues) => {
|
|
6
|
+
const oldValues = ref({});
|
|
7
|
+
const newValues = ref({});
|
|
8
|
+
watch(
|
|
9
|
+
raw,
|
|
10
|
+
(newRaw) => {
|
|
11
|
+
oldValues.value = { ...newRaw };
|
|
12
|
+
if (defaultValues) {
|
|
13
|
+
oldValues.value = defu(oldValues.value, defaultValues);
|
|
14
|
+
}
|
|
15
|
+
newValues.value = JSON.parse(JSON.stringify(oldValues.value));
|
|
16
|
+
},
|
|
17
|
+
{ immediate: true }
|
|
18
|
+
);
|
|
19
|
+
return { oldValues, newValues };
|
|
20
|
+
};
|
|
21
|
+
export const useFormSubmission = (oldValues, newValues, close, save, apiGroup, arrayTypeFieldKeys = [], rowKey = "id", versionKey = "version") => {
|
|
22
|
+
const apiFns = apiGroup();
|
|
23
|
+
async function onSubmit() {
|
|
24
|
+
if (oldValues.value[rowKey] === 0) {
|
|
25
|
+
await onCreate();
|
|
26
|
+
} else {
|
|
27
|
+
await onUpdate();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function onCreate() {
|
|
31
|
+
const { data } = await apiFns.create(apiFns.prune(newValues.value));
|
|
32
|
+
if (!data.value.error) {
|
|
33
|
+
save(data.value.data);
|
|
34
|
+
close(true);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function onUpdate() {
|
|
38
|
+
const [objWithModifiedFields, modified] = getObjWithModifiedFields(
|
|
39
|
+
{ id: oldValues.value[rowKey], version: oldValues.value[versionKey] },
|
|
40
|
+
oldValues.value,
|
|
41
|
+
newValues.value,
|
|
42
|
+
arrayTypeFieldKeys
|
|
43
|
+
);
|
|
44
|
+
if (!modified) {
|
|
45
|
+
useToast().add({
|
|
46
|
+
title: "Nothing changed",
|
|
47
|
+
description: "Please modify content before submitting",
|
|
48
|
+
color: "warning",
|
|
49
|
+
icon: "i-lucide-triangle-alert"
|
|
50
|
+
});
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const { data } = await apiFns.update(apiFns.prune(objWithModifiedFields));
|
|
54
|
+
if (!data.value.error) {
|
|
55
|
+
save(data.value.data);
|
|
56
|
+
close(true);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return { onSubmit };
|
|
60
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const _usePermission: () => {
|
|
2
|
+
setUserDynamicPermissions: (userRoles?: Model.Role[], userMenus?: Model.Menu[]) => void;
|
|
3
|
+
hasPermissions: (perms: string[] | string) => boolean;
|
|
4
|
+
hasAnyPermission: (perms: string[]) => boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const usePermission: () => {
|
|
7
|
+
setUserDynamicPermissions: (userRoles?: Model.Role[], userMenus?: Model.Menu[]) => void;
|
|
8
|
+
hasPermissions: (perms: string[] | string) => boolean;
|
|
9
|
+
hasAnyPermission: (perms: string[]) => boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
2
|
+
import { useAuth } from "./useAuth.js";
|
|
3
|
+
export const _usePermission = () => {
|
|
4
|
+
const { loginUserRoles, loginUserMenus } = useAuth();
|
|
5
|
+
const permissions = ref(/* @__PURE__ */ new Set());
|
|
6
|
+
const setUserDynamicPermissions = (userRoles = [], userMenus = []) => {
|
|
7
|
+
const allMenus = [];
|
|
8
|
+
userRoles.forEach((role) => {
|
|
9
|
+
if (role.menus?.length) {
|
|
10
|
+
allMenus.push(...role.menus);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
if (userMenus.length) {
|
|
14
|
+
allMenus.push(...userMenus);
|
|
15
|
+
}
|
|
16
|
+
const permSet = /* @__PURE__ */ new Set();
|
|
17
|
+
const processedMenus = /* @__PURE__ */ new Set();
|
|
18
|
+
allMenus.forEach((menu) => {
|
|
19
|
+
if (!processedMenus.has(menu.id)) {
|
|
20
|
+
processedMenus.add(menu.id);
|
|
21
|
+
if (menu.permission?.trim()) {
|
|
22
|
+
permSet.add(menu.permission.trim());
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
permissions.value = permSet;
|
|
27
|
+
};
|
|
28
|
+
watch([loginUserRoles, loginUserMenus], ([newRoles, newMenus]) => {
|
|
29
|
+
setUserDynamicPermissions(newRoles, newMenus);
|
|
30
|
+
}, { immediate: true });
|
|
31
|
+
const hasPermissions = (perms) => {
|
|
32
|
+
if (!perms) return false;
|
|
33
|
+
if (typeof perms === "string") {
|
|
34
|
+
return permissions.value.has(perms.trim());
|
|
35
|
+
}
|
|
36
|
+
if (!Array.isArray(perms) || perms.length === 0) return false;
|
|
37
|
+
return perms.every(
|
|
38
|
+
(perm) => typeof perm === "string" && perm.trim() && permissions.value.has(perm.trim())
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
const hasAnyPermission = (perms) => {
|
|
42
|
+
if (!Array.isArray(perms) || perms.length === 0) return false;
|
|
43
|
+
return perms.some(
|
|
44
|
+
(perm) => typeof perm === "string" && perm.trim() && permissions.value.has(perm.trim())
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
setUserDynamicPermissions,
|
|
49
|
+
hasPermissions,
|
|
50
|
+
hasAnyPermission
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export const usePermission = createSharedComposable(_usePermission);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RouteLocationNormalizedLoadedGeneric } from 'vue-router';
|
|
2
|
+
export declare function _useRouterPush(): {
|
|
3
|
+
toLogin: (route: RouteLocationNormalizedLoadedGeneric, redirectUrl?: string) => Promise<void>;
|
|
4
|
+
toHome: () => Promise<string | false | void | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric | import("vue-router").NavigationFailure>;
|
|
5
|
+
toSecuritySettings: () => Promise<string | false | void | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric | import("vue-router").NavigationFailure>;
|
|
6
|
+
redirectFromLogin: (route: RouteLocationNormalizedLoadedGeneric) => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
export declare const useRouterPush: typeof _useRouterPush;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { LoginType } from "#v/constants";
|
|
2
|
+
import { StorageKey } from "#v/types";
|
|
3
|
+
import { createSharedComposable, useLocalStorage } from "@vueuse/core";
|
|
4
|
+
import { navigateTo } from "nuxt/app";
|
|
5
|
+
export function _useRouterPush() {
|
|
6
|
+
const toHome = async () => await navigateTo("/");
|
|
7
|
+
const toSecuritySettings = async () => await navigateTo("/settings/security");
|
|
8
|
+
const toLogin = async (route, redirectUrl) => {
|
|
9
|
+
useLocalStorage(StorageKey.ACCESS_TOKEN, "").value = void 0;
|
|
10
|
+
useLocalStorage(StorageKey.REFRESH_TOKEN, "").value = void 0;
|
|
11
|
+
let toLoginPage = "";
|
|
12
|
+
const localLoginType = useLocalStorage(StorageKey.LOGIN_TYPE, LoginType.USERNAME_PASSWORD);
|
|
13
|
+
switch (localLoginType.value) {
|
|
14
|
+
case LoginType.USERNAME_PASSWORD:
|
|
15
|
+
toLoginPage = "/login/pwd";
|
|
16
|
+
break;
|
|
17
|
+
default:
|
|
18
|
+
toLoginPage = "/login/pwd";
|
|
19
|
+
}
|
|
20
|
+
const redirect = redirectUrl || route.fullPath;
|
|
21
|
+
await navigateTo({ path: toLoginPage, query: { redirect } });
|
|
22
|
+
};
|
|
23
|
+
const redirectFromLogin = async (route) => {
|
|
24
|
+
const redirect = route.query?.redirect;
|
|
25
|
+
if (redirect)
|
|
26
|
+
await navigateTo(redirect);
|
|
27
|
+
else
|
|
28
|
+
toHome();
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
toLogin,
|
|
32
|
+
toHome,
|
|
33
|
+
toSecuritySettings,
|
|
34
|
+
redirectFromLogin
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export const useRouterPush = createSharedComposable(_useRouterPush);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BreadcrumbItem, NavigationMenuItem } from '@nuxt/ui';
|
|
2
|
+
export declare function setGlobalSidebarMenus(opts: {
|
|
3
|
+
constantMenus?: NavigationMenuItem[];
|
|
4
|
+
bizMenus?: NavigationMenuItem[];
|
|
5
|
+
menuMode?: 'static' | 'dynamic';
|
|
6
|
+
}): void;
|
|
7
|
+
export declare const _useSidebarMenus: () => {
|
|
8
|
+
constantMenus: any;
|
|
9
|
+
constantMenuPathSet: any;
|
|
10
|
+
bizMenus: any;
|
|
11
|
+
flattenBizMenus: any;
|
|
12
|
+
bizMenuPathSet: any;
|
|
13
|
+
menusFromUser: any;
|
|
14
|
+
sidebarMenus: any;
|
|
15
|
+
sidebarMenuPathSet: any;
|
|
16
|
+
expandSidebarMenu: (path: string) => void;
|
|
17
|
+
setUserDynamicMenus: (newRolesFromUser: Model.Role[], newMenusFromUser: Model.Menu[]) => void;
|
|
18
|
+
disabledMenuPathSet: any;
|
|
19
|
+
breadcrumbs: any;
|
|
20
|
+
getBreadcrumbs: (current: string, menus?: NavigationMenuItem[]) => BreadcrumbItem[];
|
|
21
|
+
};
|
|
22
|
+
export declare const useSidebarMenus: () => {
|
|
23
|
+
constantMenus: any;
|
|
24
|
+
constantMenuPathSet: any;
|
|
25
|
+
bizMenus: any;
|
|
26
|
+
flattenBizMenus: any;
|
|
27
|
+
bizMenuPathSet: any;
|
|
28
|
+
menusFromUser: any;
|
|
29
|
+
sidebarMenus: any;
|
|
30
|
+
sidebarMenuPathSet: any;
|
|
31
|
+
expandSidebarMenu: (path: string) => void;
|
|
32
|
+
setUserDynamicMenus: (newRolesFromUser: Model.Role[], newMenusFromUser: Model.Menu[]) => void;
|
|
33
|
+
disabledMenuPathSet: any;
|
|
34
|
+
breadcrumbs: any;
|
|
35
|
+
getBreadcrumbs: (current: string, menus?: NavigationMenuItem[]) => BreadcrumbItem[];
|
|
36
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { flattenTree } from "#v/utils";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
import { useAuth } from "./useAuth.js";
|
|
4
|
+
const constantMenus = ref([]);
|
|
5
|
+
const bizMenus = ref([]);
|
|
6
|
+
const menuMode = ref("static");
|
|
7
|
+
export function setGlobalSidebarMenus(opts) {
|
|
8
|
+
console.log("Setting global sidebar menus with options:", opts);
|
|
9
|
+
if (opts.constantMenus) constantMenus.value = opts.constantMenus;
|
|
10
|
+
if (opts.bizMenus) bizMenus.value = opts.bizMenus;
|
|
11
|
+
if (opts.menuMode) menuMode.value = opts.menuMode;
|
|
12
|
+
}
|
|
13
|
+
export const _useSidebarMenus = () => {
|
|
14
|
+
const { loginUserRoles, loginUserMenus } = useAuth();
|
|
15
|
+
const constantMenuPathSet = computed(() => {
|
|
16
|
+
const set = /* @__PURE__ */ new Set();
|
|
17
|
+
flattenTree(constantMenus.value).forEach((menu) => {
|
|
18
|
+
set.add(menu.to);
|
|
19
|
+
});
|
|
20
|
+
return set;
|
|
21
|
+
});
|
|
22
|
+
const flattenBizMenus = computed(() => flattenTree(bizMenus.value));
|
|
23
|
+
const bizMenuPathSet = computed(() => {
|
|
24
|
+
const set = /* @__PURE__ */ new Set();
|
|
25
|
+
flattenBizMenus.value.forEach((menu) => {
|
|
26
|
+
set.add(menu.to);
|
|
27
|
+
});
|
|
28
|
+
return set;
|
|
29
|
+
});
|
|
30
|
+
const menusFromUser = ref([]);
|
|
31
|
+
const sidebarMenus = ref([]);
|
|
32
|
+
const sidebarMenuPathSet = ref(/* @__PURE__ */ new Set());
|
|
33
|
+
const setUserDynamicMenus = (newRolesFromUser, newMenusFromUser) => {
|
|
34
|
+
sidebarMenuPathSet.value.clear();
|
|
35
|
+
menusFromUser.value = [...newMenusFromUser, ...newRolesFromUser.map((role) => role.menus ?? []).flat()];
|
|
36
|
+
menusFromUser.value.forEach((menu) => menu.staticRouteKeys?.forEach((key) => sidebarMenuPathSet.value.add(key)));
|
|
37
|
+
sidebarMenus.value = menuMode.value === "static" ? bizMenus.value : hideNoPermissionMenus(bizMenus.value, sidebarMenuPathSet.value);
|
|
38
|
+
};
|
|
39
|
+
watch([loginUserRoles, loginUserMenus, bizMenus], ([newRoles, newMenus]) => {
|
|
40
|
+
setUserDynamicMenus(newRoles, newMenus);
|
|
41
|
+
console.log(bizMenus.value.length, "123");
|
|
42
|
+
}, { immediate: true });
|
|
43
|
+
const expandSidebarMenu = (path) => {
|
|
44
|
+
const expandRecursively = (menus) => {
|
|
45
|
+
let found = false;
|
|
46
|
+
for (const menu of menus) {
|
|
47
|
+
if (menu.to === path) {
|
|
48
|
+
found = true;
|
|
49
|
+
} else if (menu.children) {
|
|
50
|
+
const childFound = expandRecursively(menu.children);
|
|
51
|
+
if (childFound) {
|
|
52
|
+
found = true;
|
|
53
|
+
menu.open = true;
|
|
54
|
+
menu.defaultOpen = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return found;
|
|
59
|
+
};
|
|
60
|
+
expandRecursively(sidebarMenus.value);
|
|
61
|
+
};
|
|
62
|
+
const hideNoPermissionMenus = (menuItems, paths) => {
|
|
63
|
+
return menuItems.filter((menuItem) => paths.has(menuItem.to) || paths.has(menuItem.triggerTo)).map((menuItem) => {
|
|
64
|
+
if (menuItem.children) {
|
|
65
|
+
return {
|
|
66
|
+
...menuItem,
|
|
67
|
+
children: hideNoPermissionMenus(menuItem.children, paths)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return { ...menuItem };
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
const disabledMenuPathSet = computed(() => {
|
|
74
|
+
const set = /* @__PURE__ */ new Set();
|
|
75
|
+
flattenBizMenus.value.forEach((menu) => {
|
|
76
|
+
if (menu.disabled)
|
|
77
|
+
set.add(menu.to);
|
|
78
|
+
});
|
|
79
|
+
menusFromUser.value.forEach((menu) => {
|
|
80
|
+
if (menu.disabled && menu.staticRouteKeys)
|
|
81
|
+
menu.staticRouteKeys.forEach((key) => set.add(key));
|
|
82
|
+
});
|
|
83
|
+
return set;
|
|
84
|
+
});
|
|
85
|
+
const sidebarMenusAndConstantMenus = computed(() => {
|
|
86
|
+
const result = [];
|
|
87
|
+
result.push(...constantMenus.value);
|
|
88
|
+
result.push(...sidebarMenus.value);
|
|
89
|
+
return result;
|
|
90
|
+
});
|
|
91
|
+
const breadcrumbs = ref([]);
|
|
92
|
+
function getBreadcrumbs(current, menus = sidebarMenusAndConstantMenus.value) {
|
|
93
|
+
for (const menu of menus) {
|
|
94
|
+
if (menu.to === current) {
|
|
95
|
+
return [transformMenuToBreadcrumb(menu)];
|
|
96
|
+
}
|
|
97
|
+
if (menu.children) {
|
|
98
|
+
const result = getBreadcrumbs(current, menu.children);
|
|
99
|
+
if (result.length > 0) {
|
|
100
|
+
return [transformMenuToBreadcrumb(menu), ...result];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
function transformMenuToBreadcrumb(menu) {
|
|
107
|
+
const { children, label, icon, to } = menu;
|
|
108
|
+
const breadcrumb = { label, icon, to };
|
|
109
|
+
if (children?.length) {
|
|
110
|
+
breadcrumb.children = children.map(transformMenuToBreadcrumb);
|
|
111
|
+
}
|
|
112
|
+
return breadcrumb;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
constantMenus,
|
|
116
|
+
constantMenuPathSet,
|
|
117
|
+
bizMenus,
|
|
118
|
+
flattenBizMenus,
|
|
119
|
+
bizMenuPathSet,
|
|
120
|
+
menusFromUser,
|
|
121
|
+
sidebarMenus,
|
|
122
|
+
sidebarMenuPathSet,
|
|
123
|
+
expandSidebarMenu,
|
|
124
|
+
setUserDynamicMenus,
|
|
125
|
+
disabledMenuPathSet,
|
|
126
|
+
// breadcrumb
|
|
127
|
+
breadcrumbs,
|
|
128
|
+
getBreadcrumbs
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
export const useSidebarMenus = createSharedComposable(_useSidebarMenus);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { I18nLocale } from '#v/types';
|
|
2
|
+
export declare const useTheme: () => {
|
|
3
|
+
blackAsPrimary: import("vue").WritableComputedRef<any, any>;
|
|
4
|
+
neutralColors: string[];
|
|
5
|
+
neutral: import("vue").WritableComputedRef<any, any>;
|
|
6
|
+
primaryColors: string[];
|
|
7
|
+
primary: import("vue").WritableComputedRef<any, any>;
|
|
8
|
+
chartColorVars: import("vue").ComputedRef<string[]>;
|
|
9
|
+
primaryColorVars: import("vue").ComputedRef<string[]>;
|
|
10
|
+
radiuses: number[];
|
|
11
|
+
radius: import("vue").WritableComputedRef<any, any>;
|
|
12
|
+
modes: import("vue").ComputedRef<{
|
|
13
|
+
label: string;
|
|
14
|
+
value: "light" | "dark" | "auto";
|
|
15
|
+
icon?: string;
|
|
16
|
+
}[]>;
|
|
17
|
+
mode: import("vue").WritableComputedRef<"light" | "dark" | "auto", "light" | "dark" | "auto">;
|
|
18
|
+
locale: import("vue").WritableComputedRef<I18nLocale, I18nLocale>;
|
|
19
|
+
locales: import("@nuxt/ui").Locale<import("@nuxt/ui").Messages>[];
|
|
20
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { createSharedComposable, useColorMode } from "@vueuse/core";
|
|
3
|
+
import colors from "tailwindcss/colors";
|
|
4
|
+
import { omit } from "@nuxt/ui/utils";
|
|
5
|
+
import { en, zh_cn } from "@nuxt/ui/locale";
|
|
6
|
+
import { useApp } from "./useApp.js";
|
|
7
|
+
import { useAppConfig } from "nuxt/app";
|
|
8
|
+
const _useTheme = () => {
|
|
9
|
+
const appConfig = useAppConfig();
|
|
10
|
+
const colorMode = useColorMode();
|
|
11
|
+
const app = useApp();
|
|
12
|
+
const neutralColors = ["slate", "gray", "zinc", "neutral", "stone", "taupe", "mauve", "mist", "olive"];
|
|
13
|
+
const neutral = computed({
|
|
14
|
+
get() {
|
|
15
|
+
return appConfig.ui.colors.neutral;
|
|
16
|
+
},
|
|
17
|
+
set(option) {
|
|
18
|
+
console.log(option, appConfig);
|
|
19
|
+
appConfig.ui.colors.neutral = option;
|
|
20
|
+
app.updateNeutralColor(option);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const blackAsPrimary = computed({
|
|
24
|
+
get() {
|
|
25
|
+
return appConfig.theme.blackAsPrimary;
|
|
26
|
+
},
|
|
27
|
+
set(option) {
|
|
28
|
+
appConfig.theme.blackAsPrimary = option;
|
|
29
|
+
app.updateBlackAsPrimary(option);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const colorsToOmit = ["inherit", "current", "transparent", "black", "white", ...neutralColors];
|
|
33
|
+
const primaryColors = Object.keys(omit(colors, colorsToOmit));
|
|
34
|
+
const primary = computed({
|
|
35
|
+
get() {
|
|
36
|
+
return appConfig.ui.colors.primary;
|
|
37
|
+
},
|
|
38
|
+
set(option) {
|
|
39
|
+
appConfig.ui.colors.primary = option;
|
|
40
|
+
appConfig.theme.blackAsPrimary = false;
|
|
41
|
+
app.updatePrimaryColor(option);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const chartColorVars = computed(() => ["chart-1", "chart-2", "chart-3", "chart-4", "chart-5"].map((c) => `var(--${c})`));
|
|
45
|
+
const primaryColorVars = computed(() => primaryColors.map((c) => `var(--color-${c}-${colorMode.value === "light" ? "400" : "500"})`));
|
|
46
|
+
const radiuses = [0, 0.125, 0.25, 0.375, 0.5];
|
|
47
|
+
const radius = computed({
|
|
48
|
+
get() {
|
|
49
|
+
return appConfig.theme.radius;
|
|
50
|
+
},
|
|
51
|
+
set(option) {
|
|
52
|
+
appConfig.theme.radius = option;
|
|
53
|
+
app.updateRadius(option);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const modes = computed(() => [
|
|
57
|
+
{ label: "\u660E\u4EAE\u6A21\u5F0F", value: "light", icon: appConfig.ui.icons.light },
|
|
58
|
+
{ label: "\u6697\u9ED1\u6A21\u5F0F", value: "dark", icon: appConfig.ui.icons.dark },
|
|
59
|
+
{ label: "\u8DDF\u968F\u7CFB\u7EDF", value: "auto", icon: appConfig.ui.icons.system }
|
|
60
|
+
]);
|
|
61
|
+
const mode = computed({
|
|
62
|
+
get() {
|
|
63
|
+
return colorMode.value;
|
|
64
|
+
},
|
|
65
|
+
set(option) {
|
|
66
|
+
colorMode.value = option;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const locales = [zh_cn, en];
|
|
70
|
+
const locale = computed({
|
|
71
|
+
get() {
|
|
72
|
+
return app.appConfig.value.locale ?? "zh-CN";
|
|
73
|
+
},
|
|
74
|
+
set(value) {
|
|
75
|
+
app.updateLocale(value);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
blackAsPrimary,
|
|
80
|
+
neutralColors,
|
|
81
|
+
neutral,
|
|
82
|
+
primaryColors,
|
|
83
|
+
primary,
|
|
84
|
+
chartColorVars,
|
|
85
|
+
primaryColorVars,
|
|
86
|
+
radiuses,
|
|
87
|
+
radius,
|
|
88
|
+
modes,
|
|
89
|
+
mode,
|
|
90
|
+
locale,
|
|
91
|
+
locales
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export const useTheme = createSharedComposable(_useTheme);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { OrderQueryOpr, VColumn } from '#v/types';
|
|
2
|
+
export declare const getCreateAtColumn: <T extends Model.BaseModel>(createdAtSortOpr?: OrderQueryOpr) => VColumn<T>;
|
|
3
|
+
export declare const getOprColumns: <T extends Model.BaseModel>(createdAtSortOpr?: OrderQueryOpr) => VColumn<T>[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useUserApi } from "#v/composables";
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
import { dateTimeFormat } from "./time.js";
|
|
4
|
+
export const getCreateAtColumn = (createdAtSortOpr = "desc") => ({
|
|
5
|
+
accessorKey: "createdAt",
|
|
6
|
+
header: "\u521B\u5EFA\u65F6\u95F4",
|
|
7
|
+
cell: ({ row }) => dayjs(row.original.createdAt).format(dateTimeFormat),
|
|
8
|
+
filterOption: {
|
|
9
|
+
type: "date-picker"
|
|
10
|
+
},
|
|
11
|
+
sortOption: {
|
|
12
|
+
defaultOpr: createdAtSortOpr
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export const getOprColumns = (createdAtSortOpr = "desc") => [
|
|
16
|
+
{
|
|
17
|
+
accessorKey: "createdBy",
|
|
18
|
+
header: "\u521B\u5EFA\u4EBA",
|
|
19
|
+
cell: ({ row }) => row.original.creator?.nickname || "/",
|
|
20
|
+
filterOption: {
|
|
21
|
+
type: "async-select",
|
|
22
|
+
listApi: useUserApi().list,
|
|
23
|
+
searchFields: ["nickname"],
|
|
24
|
+
labelField: "nickname",
|
|
25
|
+
multiple: true,
|
|
26
|
+
defaultOpr: "in"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
getCreateAtColumn(createdAtSortOpr),
|
|
30
|
+
{
|
|
31
|
+
accessorKey: "updatedBy",
|
|
32
|
+
header: "\u66F4\u65B0\u4EBA",
|
|
33
|
+
cell: ({ row }) => row.original.updater?.nickname || "/",
|
|
34
|
+
filterOption: {
|
|
35
|
+
type: "async-select",
|
|
36
|
+
listApi: useUserApi().list,
|
|
37
|
+
searchFields: ["nickname"],
|
|
38
|
+
labelField: "nickname",
|
|
39
|
+
multiple: true,
|
|
40
|
+
defaultOpr: "in"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
accessorKey: "updatedAt",
|
|
45
|
+
header: "\u66F4\u65B0\u65F6\u95F4",
|
|
46
|
+
cell: ({ row }) => dayjs(row.original.updatedAt).format(dateTimeFormat),
|
|
47
|
+
filterOption: {
|
|
48
|
+
type: "date-picker"
|
|
49
|
+
},
|
|
50
|
+
sortOption: true
|
|
51
|
+
}
|
|
52
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Position } from '@vue-flow/core';
|
|
2
|
+
export type HandlePosition = 'tl' | 'tr' | 'bl' | 'br' | 't1' | 't2' | 't3' | 'r1' | 'r2' | 'r3' | 'b1' | 'b2' | 'b3' | 'l1' | 'l2' | 'l3';
|
|
3
|
+
export type ResizeDirection = 'horizontal' | 'vertical' | 'both';
|
|
4
|
+
export interface FlowHandle {
|
|
5
|
+
id: HandlePosition;
|
|
6
|
+
position: Position;
|
|
7
|
+
offsetPercent?: {
|
|
8
|
+
x?: number;
|
|
9
|
+
y?: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare const FLOW_HANDLES: FlowHandle[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Position } from "@vue-flow/core";
|
|
2
|
+
export const FLOW_HANDLES = [
|
|
3
|
+
// 4个角 - 可以双向调整
|
|
4
|
+
{ id: "tl", position: Position.Top, offsetPercent: { x: 0 } },
|
|
5
|
+
{ id: "tr", position: Position.Top, offsetPercent: { x: 100 } },
|
|
6
|
+
{ id: "bl", position: Position.Bottom, offsetPercent: { x: 0 } },
|
|
7
|
+
{ id: "br", position: Position.Bottom, offsetPercent: { x: 100 } },
|
|
8
|
+
// top边3个点 - 只能垂直调整
|
|
9
|
+
{ id: "t1", position: Position.Top, offsetPercent: { x: 25 } },
|
|
10
|
+
{ id: "t2", position: Position.Top, offsetPercent: { x: 50 } },
|
|
11
|
+
{ id: "t3", position: Position.Top, offsetPercent: { x: 75 } },
|
|
12
|
+
// right边3个点 - 只能水平调整
|
|
13
|
+
{ id: "r1", position: Position.Right, offsetPercent: { y: 25 } },
|
|
14
|
+
{ id: "r2", position: Position.Right, offsetPercent: { y: 50 } },
|
|
15
|
+
{ id: "r3", position: Position.Right, offsetPercent: { y: 75 } },
|
|
16
|
+
// bottom边3个点 - 只能垂直调整
|
|
17
|
+
{ id: "b1", position: Position.Bottom, offsetPercent: { x: 25 } },
|
|
18
|
+
{ id: "b2", position: Position.Bottom, offsetPercent: { x: 50 } },
|
|
19
|
+
{ id: "b3", position: Position.Bottom, offsetPercent: { x: 75 } },
|
|
20
|
+
// left边3个点 - 只能水平调整
|
|
21
|
+
{ id: "l1", position: Position.Left, offsetPercent: { y: 25 } },
|
|
22
|
+
{ id: "l2", position: Position.Left, offsetPercent: { y: 50 } },
|
|
23
|
+
{ id: "l3", position: Position.Left, offsetPercent: { y: 75 } }
|
|
24
|
+
];
|