feat: 升级vue3 v1.8.0

This commit is contained in:
xingyu
2022-10-11 13:59:30 +08:00
parent a98af3edbc
commit 7a717ef80d
42 changed files with 191 additions and 271 deletions

View File

@ -1,3 +1,4 @@
import { ConfigGlobalTypes } from '@/types/configGlobal'
import { inject } from 'vue'
export const useConfigGlobal = () => {

View File

@ -1,6 +1,9 @@
import { reactive } from 'vue'
import { eachTree, treeMap, filter } from '@/utils/tree'
import { getIntDictOptions } from '@/utils/dict'
import { FormSchema } from '@/types/form'
import { TableColumn } from '@/types/table'
import { DescriptionsSchema } from '@/types/descriptions'
export type CrudSchema = Omit<TableColumn, 'children'> & {
search?: CrudSearchParams

View File

@ -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实例

View File

@ -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)

View File

@ -4,6 +4,7 @@ import { ElMessage, ElMessageBox, ElTable } from 'element-plus'
import { computed, nextTick, reactive, ref, unref, watch } from 'vue'
import type { TableProps } from '@/components/Table/src/types'
import { useI18n } from '@/hooks/web/useI18n'
import { TableSetPropsType } from '@/types/table'
const { t } = useI18n()
interface ResponseType<T = any> {
@ -150,13 +151,17 @@ export const useTable = <T = any>(config?: UseTableConfig<T>) => {
},
// 与Search组件结合
setSearchParams: (data: Recordable) => {
tableObject.currentPage = 1
tableObject.params = Object.assign(tableObject.params, {
pageSize: tableObject.pageSize,
pageNo: tableObject.currentPage,
pageNo: 1,
...data
})
methods.getList()
// 页码不等于1时更新页码重新获取数据页码等于1时重新获取数据
if (tableObject.currentPage !== 1) {
tableObject.currentPage = 1
} else {
methods.getList()
}
},
// 删除数据
delList: async (