commit
3708c45789
27
CHANGELOG.md
27
CHANGELOG.md
|
@ -2,6 +2,33 @@
|
|||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [1.6.6](https://github.com/kailong321200875/vue-element-plus-admin/compare/v1.6.5...v1.6.6) (2022-10-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* table search params ([a62929a](https://github.com/kailong321200875/vue-element-plus-admin/commit/a62929a8dac21028d3dd1cddf98189492c33b093))
|
||||
|
||||
## [1.6.5](https://github.com/kailong321200875/vue-element-plus-admin/compare/v1.6.4...v1.6.5) (2022-10-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* The attribute of option does not work ([d946920](https://github.com/kailong321200875/vue-element-plus-admin/commit/d946920e61ed81beacf9f1f8be7ee1f50505f64d))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* perf store ([d416178](https://github.com/kailong321200875/vue-element-plus-admin/commit/d416178d69ca6100be4b635922b1a22d27629f08))
|
||||
* token test ([b320e65](https://github.com/kailong321200875/vue-element-plus-admin/commit/b320e658d1a559a6eaebdf374d63649c223c2ecd))
|
||||
|
||||
## [1.6.4](https://github.com/kailong321200875/vue-element-plus-admin/compare/v1.6.3...v1.6.4) (2022-09-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix bug ([da39f3b](https://github.com/kailong321200875/vue-element-plus-admin/commit/da39f3bc904ca2d80f432a31709725f9a57deb19))
|
||||
|
||||
## [1.6.3](https://github.com/kailong321200875/vue-element-plus-admin/compare/v1.6.2...v1.6.3) (2022-08-20)
|
||||
|
||||
|
||||
|
|
|
@ -215,6 +215,13 @@ Support modern browsers, not IE
|
|||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/hongxinzz">
|
||||
<img src="https://avatars.githubusercontent.com/u/31195324?v=4" width="100;" alt="hongxinzz"/>
|
||||
<br />
|
||||
<sub><b>Hongxinzz</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/amifed">
|
||||
<img src="https://avatars.githubusercontent.com/u/36906371?v=4" width="100;" alt="amifed"/>
|
||||
|
|
|
@ -215,6 +215,13 @@ pnpm run build:pro
|
|||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/hongxinzz">
|
||||
<img src="https://avatars.githubusercontent.com/u/31195324?v=4" width="100;" alt="hongxinzz"/>
|
||||
<br />
|
||||
<sub><b>Hongxinzz</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/amifed">
|
||||
<img src="https://avatars.githubusercontent.com/u/36906371?v=4" width="100;" alt="amifed"/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vue-element-plus-admin",
|
||||
"version": "1.6.3",
|
||||
"version": "1.6.6",
|
||||
"description": "一套基于vue3、element-plus、typesScript、vite3的后台集成方案。",
|
||||
"author": "Archer <502431556@qq.com>",
|
||||
"private": false,
|
||||
|
|
|
@ -7,13 +7,14 @@ import { useWindowSize } from '@vueuse/core'
|
|||
import { useAppStore } from '@/store/modules/app'
|
||||
import { setCssVar } from '@/utils'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { ElementPlusSize } from '@/types/elementPlus'
|
||||
|
||||
const { variables } = useDesign()
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
const props = defineProps({
|
||||
size: propTypes.oneOf<ElememtPlusSize[]>(['default', 'small', 'large']).def('default')
|
||||
size: propTypes.oneOf<ElementPlusSize[]>(['default', 'small', 'large']).def('default')
|
||||
})
|
||||
|
||||
provide('configGlobal', props)
|
||||
|
|
|
@ -4,7 +4,7 @@ import { PropType, ref } from 'vue'
|
|||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import type { RouteLocationNormalizedLoaded } from 'vue-router'
|
||||
|
||||
import { contextMenuSchema } from '../../../types/contextMenu'
|
||||
const { getPrefixCls } = useDesign()
|
||||
|
||||
const prefixCls = getPrefixCls('context-menu')
|
||||
|
|
|
@ -4,6 +4,7 @@ import { useDesign } from '@/hooks/web/useDesign'
|
|||
import { propTypes } from '@/utils/propTypes'
|
||||
import { ref, unref, PropType, computed, useAttrs } from 'vue'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { DescriptionsSchema } from '@/types/descriptions'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import Form from './src/Form.vue'
|
||||
import { ElForm } from 'element-plus'
|
||||
import { FormSchema, FormSetPropsType } from '@/types/form'
|
||||
|
||||
export interface FormExpose {
|
||||
setValues: (data: Recordable) => void
|
||||
|
|
|
@ -20,6 +20,7 @@ import { findIndex } from '@/utils'
|
|||
import { set } from 'lodash-es'
|
||||
import { FormProps } from './types'
|
||||
import { Icon } from '@/components/Icon'
|
||||
import { FormSchema, FormSetPropsType } from '@/types/form'
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import {
|
|||
} from 'element-plus'
|
||||
import { InputPassword } from '@/components/InputPassword'
|
||||
import { Editor } from '@/components/Editor'
|
||||
import { ComponentName } from '@/types/components'
|
||||
|
||||
const componentMap: Recordable<Component, ComponentName> = {
|
||||
Radio: ElRadioGroup,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { FormSchema } from '@/types/form'
|
||||
import { ElCheckbox, ElCheckboxButton } from 'element-plus'
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { FormSchema } from '@/types/form'
|
||||
import { ElRadio, ElRadioButton } from 'element-plus'
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import { ElOption, ElOptionGroup } from 'element-plus'
|
||||
import { getSlot } from '@/utils/tsxHelper'
|
||||
import { Slots } from 'vue'
|
||||
import { FormSchema } from '@/types/form'
|
||||
import { ComponentOptions } from '@/types/components'
|
||||
|
||||
export const useRenderSelect = (slots: Slots) => {
|
||||
// 渲染 select options
|
||||
|
|
|
@ -2,6 +2,7 @@ import { useI18n } from '@/hooks/web/useI18n'
|
|||
import type { Slots } from 'vue'
|
||||
import { getSlot } from '@/utils/tsxHelper'
|
||||
import { PlaceholderMoel } from './types'
|
||||
import { FormSchema } from '@/types/form'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { FormSchema } from '@/types/form'
|
||||
|
||||
export interface PlaceholderMoel {
|
||||
placeholder?: string
|
||||
startPlaceholder?: string
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { Highlight } from '@//components/Highlight'
|
||||
import { Highlight } from '@/components/Highlight'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { TipSchema } from '@/types/infoTip';
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import { cloneDeep } from 'lodash-es'
|
|||
import { propTypes } from '@/utils/propTypes'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { isString } from '@/utils/is'
|
||||
import { QrcodeLogo } from '@/types/qrcode'
|
||||
|
||||
const props = defineProps({
|
||||
// img 或者 canvas,img不支持logo嵌套
|
||||
|
|
|
@ -7,6 +7,7 @@ import { useI18n } from '@/hooks/web/useI18n'
|
|||
import { useForm } from '@/hooks/web/useForm'
|
||||
import { findIndex } from '@/utils'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { FormSchema } from '@/types/form'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import { useAppStore } from '@/store/modules/app'
|
|||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { ElementPlusSize } from '@/types/elementPlus'
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
|
||||
|
@ -20,7 +21,7 @@ const appStore = useAppStore()
|
|||
|
||||
const sizeMap = computed(() => appStore.sizeMap)
|
||||
|
||||
const setCurrentSize = (size: ElememtPlusSize) => {
|
||||
const setCurrentSize = (size: ElementPlusSize) => {
|
||||
appStore.setCurrentSize(size)
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import Table from './src/Table.vue'
|
||||
import { ElTable } from 'element-plus'
|
||||
import { TableSetPropsType } from '@/types/table'
|
||||
|
||||
export interface TableExpose {
|
||||
setProps: (props: Recordable) => void
|
||||
|
|
|
@ -6,6 +6,7 @@ import { setIndex } from './helper'
|
|||
import { getSlot } from '@/utils/tsxHelper'
|
||||
import type { TableProps } from './types'
|
||||
import { set } from 'lodash-es'
|
||||
import { TableColumn, TableSlotDefault, Pagination, TableSetPropsType } from '../../../types/table'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Table',
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { Pagination, TableColumn } from '@/types/table'
|
||||
|
||||
export type TableProps = {
|
||||
pageSize?: number
|
||||
currentPage?: number
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { ConfigGlobalTypes } from '@/types/configGlobal'
|
||||
import { inject } from 'vue'
|
||||
|
||||
export const useConfigGlobal = () => {
|
||||
|
|
|
@ -4,6 +4,9 @@ import { findIndex } from '@/utils'
|
|||
import { useDictStoreWithOut } from '@/store/modules/dict'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import type { AxiosPromise } from 'axios'
|
||||
import { FormSchema } from '@/types/form'
|
||||
import { TableColumn } from '@/types/table'
|
||||
import { DescriptionsSchema } from '@/types/descriptions'
|
||||
|
||||
export type CrudSchema = Omit<TableColumn, 'children'> & {
|
||||
search?: CrudSearchParams
|
||||
|
|
|
@ -2,6 +2,7 @@ import type { Form, FormExpose } from '@/components/Form'
|
|||
import type { ElForm } from 'element-plus'
|
||||
import { ref, unref, nextTick } from 'vue'
|
||||
import type { FormProps } from '@/components/Form/src/types'
|
||||
import { FormSchema, FormSetPropsType } from '@/types/form'
|
||||
|
||||
export const useForm = (props?: FormProps) => {
|
||||
// From实例
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { h } from 'vue'
|
||||
import type { VNode } from 'vue'
|
||||
import { Icon } from '@/components/Icon'
|
||||
import { IconTypes } from '@/types/icon'
|
||||
|
||||
export const useIcon = (props: IconTypes): VNode => {
|
||||
return h(Icon, props)
|
||||
|
|
|
@ -4,6 +4,7 @@ import { ref, reactive, watch, computed, unref, nextTick } from 'vue'
|
|||
import { get } from 'lodash-es'
|
||||
import type { TableProps } from '@/components/Table/src/types'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { TableSetPropsType } from '@/types/table'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ import { defineStore } from 'pinia'
|
|||
import { store } from '../index'
|
||||
import { setCssVar, humpToUnderline } from '@/utils'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElementPlusSize } from '@/types/elementPlus'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
@ -169,10 +170,10 @@ export const useAppStore = defineStore('app', {
|
|||
getIsDark(): boolean {
|
||||
return this.isDark
|
||||
},
|
||||
getCurrentSize(): ElememtPlusSize {
|
||||
getCurrentSize(): ElementPlusSize {
|
||||
return this.currentSize
|
||||
},
|
||||
getSizeMap(): ElememtPlusSize[] {
|
||||
getSizeMap(): ElementPlusSize[] {
|
||||
return this.sizeMap
|
||||
},
|
||||
getMobile(): boolean {
|
||||
|
@ -254,7 +255,7 @@ export const useAppStore = defineStore('app', {
|
|||
}
|
||||
wsCache.set('isDark', this.isDark)
|
||||
},
|
||||
setCurrentSize(currentSize: ElememtPlusSize) {
|
||||
setCurrentSize(currentSize: ElementPlusSize) {
|
||||
this.currentSize = currentSize
|
||||
wsCache.set('currentSize', this.currentSize)
|
||||
},
|
||||
|
|
|
@ -3,6 +3,7 @@ import { store } from '../index'
|
|||
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||||
import en from 'element-plus/es/locale/lang/en'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { LocaleDropdownType } from '@/types/localeDropdown'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
export type ComponentName =
|
||||
| 'Radio'
|
||||
| 'RadioButton'
|
||||
| 'Checkbox'
|
||||
| 'CheckboxButton'
|
||||
| 'Input'
|
||||
| 'Autocomplete'
|
||||
| 'InputNumber'
|
||||
| 'Select'
|
||||
| 'Cascader'
|
||||
| 'Switch'
|
||||
| 'Slider'
|
||||
| 'TimePicker'
|
||||
| 'DatePicker'
|
||||
| 'Rate'
|
||||
| 'ColorPicker'
|
||||
| 'Transfer'
|
||||
| 'Divider'
|
||||
| 'TimeSelect'
|
||||
| 'SelectV2'
|
||||
| 'InputPassword'
|
||||
| 'Editor'
|
||||
|
||||
export type ColProps = {
|
||||
span?: number
|
||||
xs?: number
|
||||
sm?: number
|
||||
md?: number
|
||||
lg?: number
|
||||
xl?: number
|
||||
tag?: string
|
||||
}
|
||||
|
||||
export type ComponentOptions = {
|
||||
label?: string
|
||||
value?: FormValueType
|
||||
disabled?: boolean
|
||||
key?: string | number
|
||||
children?: ComponentOptions[]
|
||||
options?: ComponentOptions[]
|
||||
} & Recordable
|
||||
|
||||
export type ComponentOptionsAlias = {
|
||||
labelField?: string
|
||||
valueField?: string
|
||||
}
|
||||
|
||||
export type ComponentProps = {
|
||||
optionsAlias?: ComponentOptionsAlias
|
||||
options?: ComponentOptions[]
|
||||
optionsSlot?: boolean
|
||||
} & Recordable
|
|
@ -0,0 +1,4 @@
|
|||
import { ElementPlusSize } from './elementPlus'
|
||||
export interface ConfigGlobalTypes {
|
||||
size?: ElementPlusSize
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
export type contextMenuSchema = {
|
||||
disabled?: boolean
|
||||
divided?: boolean
|
||||
icon?: string
|
||||
label: string
|
||||
command?: (item: contextMenuSchema) => void
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
declare interface DescriptionsSchema {
|
||||
export interface DescriptionsSchema {
|
||||
span?: number // 占多少分
|
||||
field: string // 字段名
|
||||
label?: string // label名
|
|
@ -0,0 +1,3 @@
|
|||
export type ElementPlusSize = 'default' | 'small' | 'large'
|
||||
|
||||
export type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
|
|
@ -0,0 +1,45 @@
|
|||
import type { CSSProperties } from 'vue'
|
||||
import { ColProps, ComponentProps, ComponentName } from '@/types/components'
|
||||
import { FormValueType, FormValueType } from '@/types/form'
|
||||
import type { AxiosPromise } from 'axios'
|
||||
|
||||
export type FormSetPropsType = {
|
||||
field: string
|
||||
path: string
|
||||
value: any
|
||||
}
|
||||
|
||||
export type FormValueType = string | number | string[] | number[] | boolean | undefined | null
|
||||
|
||||
export type FormItemProps = {
|
||||
labelWidth?: string | number
|
||||
required?: boolean
|
||||
rules?: Recordable
|
||||
error?: string
|
||||
showMessage?: boolean
|
||||
inlineMessage?: boolean
|
||||
style?: CSSProperties
|
||||
}
|
||||
|
||||
export type FormSchema = {
|
||||
// 唯一值
|
||||
field: string
|
||||
// 标题
|
||||
label?: string
|
||||
// 提示
|
||||
labelMessage?: string
|
||||
// col组件属性
|
||||
colProps?: ColProps
|
||||
// 表单组件属性,slots对应的是表单组件的插槽,规则:${field}-xxx,具体可以查看element-plus文档
|
||||
componentProps?: { slots?: Recordable } & ComponentProps
|
||||
// formItem组件属性
|
||||
formItemProps?: FormItemProps
|
||||
// 渲染的组件
|
||||
component?: ComponentName
|
||||
// 初始值
|
||||
value?: FormValueType
|
||||
// 是否隐藏
|
||||
hidden?: boolean
|
||||
// 远程加载下拉项
|
||||
api?: <T = any>() => AxiosPromise<T>
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
declare interface IconTypes {
|
||||
export interface IconTypes {
|
||||
size?: number
|
||||
color?: string
|
||||
icon: string
|
|
@ -1,4 +1,4 @@
|
|||
declare interface TipSchema {
|
||||
export interface TipSchema {
|
||||
label: string
|
||||
keys?: string[]
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
declare interface Language {
|
||||
export interface Language {
|
||||
el: Recordable
|
||||
name: string
|
||||
}
|
||||
|
||||
declare interface LocaleDropdownType {
|
||||
export interface LocaleDropdownType {
|
||||
lang: LocaleType
|
||||
name?: string
|
||||
elLocale?: Language
|
|
@ -1,4 +1,4 @@
|
|||
declare interface QrcodeLogo {
|
||||
export interface QrcodeLogo {
|
||||
src?: string
|
||||
logoSize?: number
|
||||
bgColor?: string
|
|
@ -1,16 +1,16 @@
|
|||
declare type TableColumn = {
|
||||
export type TableColumn = {
|
||||
field: string
|
||||
label?: string
|
||||
children?: TableColumn[]
|
||||
} & Recordable
|
||||
|
||||
declare type TableSlotDefault = {
|
||||
export type TableSlotDefault = {
|
||||
row: Recordable
|
||||
column: TableColumn
|
||||
$index: number
|
||||
} & Recordable
|
||||
|
||||
declare interface Pagination {
|
||||
export interface Pagination {
|
||||
small?: boolean
|
||||
background?: boolean
|
||||
pageSize?: number
|
||||
|
@ -29,7 +29,7 @@ declare interface Pagination {
|
|||
hideOnSinglePage?: boolean
|
||||
}
|
||||
|
||||
declare interface TableSetPropsType {
|
||||
export interface TableSetPropsType {
|
||||
field: string
|
||||
path: string
|
||||
value: any
|
|
@ -6,6 +6,7 @@ import { getUserListApi } from '@/api/login'
|
|||
import { UserType } from '@/api/login/types'
|
||||
import { ref, h } from 'vue'
|
||||
import { ElButton } from 'element-plus'
|
||||
import { TableColumn, TableSlotDefault } from '@/types/table'
|
||||
|
||||
interface Params {
|
||||
pageIndex?: number
|
||||
|
|
|
@ -6,6 +6,7 @@ import { getUserListApi } from '@/api/login'
|
|||
import { UserType } from '@/api/login/types'
|
||||
import { ref, h } from 'vue'
|
||||
import { ElButton } from 'element-plus'
|
||||
import { TableColumn, TableSlotDefault } from '@/types/table'
|
||||
|
||||
interface Params {
|
||||
pageIndex?: number
|
||||
|
|
|
@ -6,6 +6,7 @@ import { Form } from '@/components/Form'
|
|||
import { ElFormItem, ElInput, ElButton } from 'element-plus'
|
||||
import { useValidator } from '@/hooks/web/useValidator'
|
||||
import { useForm } from '@/hooks/web/useForm'
|
||||
import { DescriptionsSchema } from '@/types/descriptions'
|
||||
|
||||
const { required } = useValidator()
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import { ref, reactive, unref } from 'vue'
|
|||
import { Form, FormExpose } from '@/components/Form'
|
||||
import { useValidator } from '@/hooks/web/useValidator'
|
||||
import { getDictOneApi } from '@/api/common'
|
||||
import { FormSchema } from '@/types/form'
|
||||
|
||||
const { required } = useValidator()
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ import { useI18n } from '@/hooks/web/useI18n'
|
|||
import { useIcon } from '@/hooks/web/useIcon'
|
||||
import { ContentWrap } from '@/components/ContentWrap'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { FormSchema } from '@/types/form'
|
||||
import { ComponentOptions } from '@/types/components'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import { reactive, unref, ref } from 'vue'
|
|||
import { ElButton } from 'element-plus'
|
||||
import { useValidator } from '@/hooks/web/useValidator'
|
||||
import { getDictOneApi } from '@/api/common'
|
||||
import { FormSchema } from '@/types/form'
|
||||
|
||||
const { required } = useValidator()
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import { reactive, unref, ref } from 'vue'
|
|||
import { ElButton } from 'element-plus'
|
||||
import { useValidator } from '@/hooks/web/useValidator'
|
||||
import { getDictOneApi } from '@/api/common'
|
||||
import { FormSchema } from '@/types/form'
|
||||
|
||||
const { required } = useValidator()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import { reactive, ref, unref } from 'vue'
|
|||
import { useValidator } from '@/hooks/web/useValidator'
|
||||
import { ElButton } from 'element-plus'
|
||||
import { getDictOneApi } from '@/api/common'
|
||||
import { FormSchema } from '@/types/form'
|
||||
|
||||
const { required } = useValidator()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import { getTableListApi } from '@/api/table'
|
|||
import { TableData } from '@/api/table/types'
|
||||
import { ref, h } from 'vue'
|
||||
import { ElTag, ElButton } from 'element-plus'
|
||||
import { TableColumn, TableSlotDefault } from '@/types/table'
|
||||
|
||||
interface Params {
|
||||
pageIndex?: number
|
||||
|
|
|
@ -7,6 +7,7 @@ import { TableData } from '@/api/table/types'
|
|||
import { ref, h, reactive, unref } from 'vue'
|
||||
import { ElTag, ElButton } from 'element-plus'
|
||||
import { useTable } from '@/hooks/web/useTable'
|
||||
import { Pagination, TableColumn, TableSlotDefault } from '@/types/table'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import { TableData } from '@/api/table/types'
|
|||
import { ref, h, reactive, unref } from 'vue'
|
||||
import { ElTag, ElButton } from 'element-plus'
|
||||
import { useTable } from '@/hooks/web/useTable'
|
||||
import { Pagination, TableColumn, TableSlotDefault } from '@/types/table'
|
||||
|
||||
const { register, tableObject, methods, elTableRef } = useTable<TableData>({
|
||||
getListApi: getTableListApi,
|
||||
|
|
|
@ -12,6 +12,7 @@ import { h, ref, unref, reactive } from 'vue'
|
|||
import Write from './components/Write.vue'
|
||||
import Detail from './components/Detail.vue'
|
||||
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
||||
import { TableColumn } from '@/types/table'
|
||||
|
||||
const { register, tableObject, methods } = useTable<TableData>({
|
||||
getListApi: getTableListApi,
|
||||
|
|
|
@ -4,6 +4,7 @@ import type { TableData } from '@/api/table/types'
|
|||
import { Descriptions } from '@/components/Descriptions'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { ElTag } from 'element-plus'
|
||||
import { DescriptionsSchema } from '@/types/descriptions'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import { useForm } from '@/hooks/web/useForm'
|
|||
import { PropType, reactive, watch } from 'vue'
|
||||
import { TableData } from '@/api/table/types'
|
||||
import { useValidator } from '@/hooks/web/useValidator'
|
||||
import { FormSchema } from '@/types/form'
|
||||
|
||||
const { required } = useValidator()
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import { h, reactive, ref } from 'vue'
|
|||
import { useRouter } from 'vue-router'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
||||
import { TableColumn } from '@/types/table'
|
||||
|
||||
defineOptions({
|
||||
name: 'ExamplePage'
|
||||
|
|
|
@ -4,6 +4,7 @@ import type { TableData } from '@/api/table/types'
|
|||
import { Descriptions } from '@/components/Descriptions'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { ElTag } from 'element-plus'
|
||||
import { DescriptionsSchema } from '@/types/descriptions'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import { TableData } from '@/api/table/types'
|
|||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useValidator } from '@/hooks/web/useValidator'
|
||||
import { IDomEditor } from '@wangeditor/editor'
|
||||
import { FormSchema } from '@/types/form'
|
||||
|
||||
const { required } = useValidator()
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import { useRouter } from 'vue-router'
|
|||
import type { RouteLocationNormalizedLoaded, RouteRecordRaw } from 'vue-router'
|
||||
import { UserType } from '@/api/login/types'
|
||||
import { useValidator } from '@/hooks/web/useValidator'
|
||||
import { FormSchema } from '@/types/form'
|
||||
|
||||
const { required } = useValidator()
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import { useI18n } from '@/hooks/web/useI18n'
|
|||
import { useForm } from '@/hooks/web/useForm'
|
||||
import { ElButton, ElInput, FormRules } from 'element-plus'
|
||||
import { useValidator } from '@/hooks/web/useValidator'
|
||||
import { FormSchema } from '@/types/form'
|
||||
|
||||
const emit = defineEmits(['to-login'])
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import { h, ref, reactive } from 'vue'
|
|||
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { getDictOneApi } from '@/api/common'
|
||||
import { TableColumn } from '@/types/table'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
declare interface ConfigGlobalTypes {
|
||||
size?: ElememtPlusSize
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
declare type contextMenuSchema = {
|
||||
disabled?: boolean
|
||||
divided?: boolean
|
||||
icon?: string
|
||||
label: string
|
||||
command?: (item: contextMenuSchema) => viod
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
import type { CSSProperties } from 'vue'
|
||||
|
||||
declare global {
|
||||
declare type ComponentName =
|
||||
| 'Radio'
|
||||
| 'RadioButton'
|
||||
| 'Checkbox'
|
||||
| 'CheckboxButton'
|
||||
| 'Input'
|
||||
| 'Autocomplete'
|
||||
| 'InputNumber'
|
||||
| 'Select'
|
||||
| 'Cascader'
|
||||
| 'Switch'
|
||||
| 'Slider'
|
||||
| 'TimePicker'
|
||||
| 'DatePicker'
|
||||
| 'Rate'
|
||||
| 'ColorPicker'
|
||||
| 'Transfer'
|
||||
| 'Divider'
|
||||
| 'TimeSelect'
|
||||
| 'SelectV2'
|
||||
| 'InputPassword'
|
||||
| 'Editor'
|
||||
|
||||
declare type ColProps = {
|
||||
span?: number
|
||||
xs?: number
|
||||
sm?: number
|
||||
md?: number
|
||||
lg?: number
|
||||
xl?: number
|
||||
tag?: string
|
||||
}
|
||||
|
||||
declare type FormValueType = string | number | string[] | number[] | boolean | undefined | null
|
||||
|
||||
declare type FormItemProps = {
|
||||
labelWidth?: string | number
|
||||
required?: boolean
|
||||
rules?: Recordable
|
||||
error?: string
|
||||
showMessage?: boolean
|
||||
inlineMessage?: boolean
|
||||
style?: CSSProperties
|
||||
}
|
||||
|
||||
declare type ComponentOptions = {
|
||||
label?: string
|
||||
value?: FormValueType
|
||||
disabled?: boolean
|
||||
key?: string | number
|
||||
children?: ComponentOptions[]
|
||||
options?: ComponentOptions[]
|
||||
} & Recordable
|
||||
|
||||
declare type ComponentOptionsAlias = {
|
||||
labelField?: string
|
||||
valueField?: string
|
||||
}
|
||||
|
||||
declare type ComponentProps = {
|
||||
optionsAlias?: ComponentOptionsAlias
|
||||
options?: ComponentOptions[]
|
||||
optionsSlot?: boolean
|
||||
} & Recordable
|
||||
|
||||
declare type FormSchema = {
|
||||
// 唯一值
|
||||
field: string
|
||||
// 标题
|
||||
label?: string
|
||||
// 提示
|
||||
labelMessage?: string
|
||||
// col组件属性
|
||||
colProps?: ColProps
|
||||
// 表单组件属性,slots对应的是表单组件的插槽,规则:${field}-xxx,具体可以查看element-plus文档
|
||||
componentProps?: { slots?: Recordable } & ComponentProps
|
||||
// formItem组件属性
|
||||
formItemProps?: FormItemProps
|
||||
// 渲染的组件
|
||||
component?: ComponentName
|
||||
// 初始值
|
||||
value?: FormValueType
|
||||
// 是否隐藏
|
||||
hidden?: boolean
|
||||
// 远程加载下拉项
|
||||
api?: <T = any>() => AxiosPromise<T>
|
||||
}
|
||||
|
||||
declare type FormSetPropsType = {
|
||||
field: string
|
||||
path: string
|
||||
value: any
|
||||
}
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
import type { CSSProperties } from 'vue'
|
||||
declare global {
|
||||
declare interface Fn<T = any> {
|
||||
(...arg: T[]): T
|
||||
}
|
||||
|
@ -6,10 +8,6 @@ declare type Nullable<T> = T | null
|
|||
|
||||
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
|
||||
|
||||
declare type ElememtPlusSize = 'default' | 'small' | 'large'
|
||||
|
||||
declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
|
||||
|
||||
declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
|
||||
|
||||
declare type ComponentRef<T> = InstanceType<T>
|
||||
|
@ -38,3 +36,4 @@ declare interface IResponse<T = any> {
|
|||
code: string
|
||||
data: T extends any ? T : T & any
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue