diff --git a/src/api/types.ts b/src/api/types.ts index 617286c..489167e 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -57,3 +57,43 @@ export interface TenantInfo { tenantEnabled: boolean; voList: TenantVO[]; } + +/** + * 表格列 + */ +export interface Column { + label: string; + prop: string; + align?: 'left' | 'center' | 'right'; + slot?: string; +} + +/** + * 表格上方的按钮 + */ +export interface Button { + text: string; + type: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'; + icon: string; + handler: () => void; + permission: string[]; + disabledCondition?: (ids: (string | number)[]) => boolean; +} + +/** + * 表格的操作栏 + */ +export interface Operation { + text: string; + type: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'; + icon: string; + handler: (row: any) => void; + permission: string[]; + needConfirm?: boolean; +} + +export interface QueryParams { + pageNum: number; + pageSize: number; + [key: string]: any; +} \ No newline at end of file diff --git a/src/components/RexCheckbox/index.vue b/src/components/RexCheckbox/index.vue new file mode 100644 index 0000000..31d5609 --- /dev/null +++ b/src/components/RexCheckbox/index.vue @@ -0,0 +1,72 @@ + + + + + + + + + + + diff --git a/src/components/RexDatePicker/index.vue b/src/components/RexDatePicker/index.vue new file mode 100644 index 0000000..7f5bfc1 --- /dev/null +++ b/src/components/RexDatePicker/index.vue @@ -0,0 +1,23 @@ + + + + + + + + + + + + + diff --git a/src/components/RexDrawer/index.vue b/src/components/RexDrawer/index.vue new file mode 100644 index 0000000..e632f76 --- /dev/null +++ b/src/components/RexDrawer/index.vue @@ -0,0 +1,26 @@ + + + + {{ title }} + + + + + + + + + + diff --git a/src/components/RexDrawer/useDrawerSize.ts b/src/components/RexDrawer/useDrawerSize.ts new file mode 100644 index 0000000..f0f20a4 --- /dev/null +++ b/src/components/RexDrawer/useDrawerSize.ts @@ -0,0 +1,18 @@ +import { ref, computed } from 'vue'; + +export function useDrawerSize(initialSize = 800) { + const drawerSize = ref(initialSize); + const maxDrawerSize = document.body.clientWidth; + + const isFullSize = computed(() => drawerSize.value === maxDrawerSize); + + const toggleDrawerSize = () => { + drawerSize.value = isFullSize.value ? initialSize : maxDrawerSize; + }; + + return { + drawerSize: computed(() => `${drawerSize.value}px`), + isFullSize, + toggleDrawerSize + }; +} diff --git a/src/components/RexEditor/index.vue b/src/components/RexEditor/index.vue new file mode 100644 index 0000000..c240738 --- /dev/null +++ b/src/components/RexEditor/index.vue @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + diff --git a/src/components/RexFileUpload/index.vue b/src/components/RexFileUpload/index.vue new file mode 100644 index 0000000..f470883 --- /dev/null +++ b/src/components/RexFileUpload/index.vue @@ -0,0 +1,231 @@ + + + + + + + 选取文件 + + + + 请上传 + + 大小不超过 {{ fileSize }}MB + + + 格式为 {{ fileType.join("/") }} + + 的文件 + + + + + + {{ getFileName(file.name) }} + + + 删除 + + + + + + + + + + + diff --git a/src/components/RexImageUpload/index.vue b/src/components/RexImageUpload/index.vue new file mode 100644 index 0000000..e5edf23 --- /dev/null +++ b/src/components/RexImageUpload/index.vue @@ -0,0 +1,230 @@ + + + + + + + + + + + + 请上传 + + 大小不超过 {{ fileSize }}MB + + + 格式为 {{ fileType.join("/") }} + + 的文件 + + + + + + + + + + + + + diff --git a/src/components/RexInput/index.vue b/src/components/RexInput/index.vue new file mode 100644 index 0000000..43f1fc9 --- /dev/null +++ b/src/components/RexInput/index.vue @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/src/components/RexRadio/index.vue b/src/components/RexRadio/index.vue new file mode 100644 index 0000000..933ca8e --- /dev/null +++ b/src/components/RexRadio/index.vue @@ -0,0 +1,65 @@ + + + + + + + + + + + diff --git a/src/components/RexSelect/index.vue b/src/components/RexSelect/index.vue new file mode 100644 index 0000000..e92d52d --- /dev/null +++ b/src/components/RexSelect/index.vue @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + diff --git a/src/components/RexTable/index.vue b/src/components/RexTable/index.vue new file mode 100644 index 0000000..077af50 --- /dev/null +++ b/src/components/RexTable/index.vue @@ -0,0 +1,132 @@ + + + + + + handleButtonClick(button.handler)" + v-if="button.permission && button.permission.length > 0" + v-hasPermi="button.permission" + > + {{ button.text }} + + handleButtonClick(button.handler)" + > + {{ button.text }} + + + + + + + + + + + + + + + + + + handleOperation(op, scope.row)" + v-if="op.permission && op.permission.length > 0" + v-hasPermi="op.permission" + > + handleOperation(op, scope.row)" + > + + + + + + + + + + diff --git a/src/components/RexTreeSelect/index.vue b/src/components/RexTreeSelect/index.vue new file mode 100644 index 0000000..aa2ce18 --- /dev/null +++ b/src/components/RexTreeSelect/index.vue @@ -0,0 +1,21 @@ + + + + + + + + +