mirror of
				https://github.com/continew-org/continew-admin-ui.git
				synced 2025-10-31 10:57:10 +08:00 
			
		
		
		
	refactor: useForm => useResetReactive(同步 GiDemo 更新)
This commit is contained in:
		| @@ -7,3 +7,4 @@ export * from './modules/useForm' | |||||||
| export * from './modules/useDevice' | export * from './modules/useDevice' | ||||||
| export * from './modules/useBreakpoint' | export * from './modules/useBreakpoint' | ||||||
| export * from './modules/useDownload' | export * from './modules/useDownload' | ||||||
|  | export * from './modules/useResetReactive' | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								src/hooks/modules/useResetReactive.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/hooks/modules/useResetReactive.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | import { reactive } from 'vue' | ||||||
|  | import { cloneDeep } from 'lodash-es' | ||||||
|  |  | ||||||
|  | export function useResetReactive<T extends object>(value: T) { | ||||||
|  |   const getInitValue = () => cloneDeep(value) | ||||||
|  |  | ||||||
|  |   const state = reactive(getInitValue()) | ||||||
|  |  | ||||||
|  |   const reset = () => { | ||||||
|  |     Object.keys(state).forEach((key) => delete state[key]) | ||||||
|  |     Object.assign(state, getInitValue()) | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   return [state, reset] as const | ||||||
|  | } | ||||||
| @@ -125,7 +125,7 @@ import { type FieldConfigResp, type GeneratorConfigResp, getGenConfig, listField | |||||||
| import type { LabelValueState } from '@/types/global' | import type { LabelValueState } from '@/types/global' | ||||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
| import { useDict } from '@/hooks/app' | import { useDict } from '@/hooks/app' | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
| @@ -146,7 +146,7 @@ const options: Options = { | |||||||
|   grid: { cols: 2 }, |   grid: { cols: 2 }, | ||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   isOverride: false, |   isOverride: false, | ||||||
| }) | }) | ||||||
| const formColumns: Columns = reactive([ | const formColumns: Columns = reactive([ | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ import { Message } from '@arco-design/web-vue' | |||||||
| import { useWindowSize } from '@vueuse/core' | import { useWindowSize } from '@vueuse/core' | ||||||
| import { addApp, getApp, updateApp } from '@/apis/open/app' | import { addApp, getApp, updateApp } from '@/apis/open/app' | ||||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
|   (e: 'save-success'): void |   (e: 'save-success'): void | ||||||
| @@ -37,7 +37,7 @@ const options: Options = { | |||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   status: 1, |   status: 1, | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -180,10 +180,9 @@ | |||||||
| import { type ColProps, type FormInstance, Message } from '@arco-design/web-vue' | import { type ColProps, type FormInstance, Message } from '@arco-design/web-vue' | ||||||
| import { useWindowSize } from '@vueuse/core' | import { useWindowSize } from '@vueuse/core' | ||||||
| import { addJob, listGroup, updateJob } from '@/apis/schedule/job' | import { addJob, listGroup, updateJob } from '@/apis/schedule/job' | ||||||
| import { useForm } from '@/hooks' |  | ||||||
| import { useDict } from '@/hooks/app' |  | ||||||
| import CronGeneratorModal from '@/components/GenCron/CronModel/index.vue' |  | ||||||
| import type { LabelValueState } from '@/types/global' | import type { LabelValueState } from '@/types/global' | ||||||
|  | import { useResetReactive } from '@/hooks' | ||||||
|  | import { useDict } from '@/hooks/app' | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
|   (e: 'save-success'): void |   (e: 'save-success'): void | ||||||
| @@ -221,7 +220,7 @@ const rules: FormInstance['rules'] = { | |||||||
|   parallelNum: [{ required: true, message: '请输入并行数' }], |   parallelNum: [{ required: true, message: '请输入并行数' }], | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   triggerType: 2, |   triggerType: 2, | ||||||
|   triggerInterval: 60, |   triggerInterval: 60, | ||||||
|   taskType: 1, |   taskType: 1, | ||||||
|   | |||||||
| @@ -29,7 +29,7 @@ import { type BehaviorCaptchaReq, getEmailCaptcha, updateUserEmail, updateUserPa | |||||||
| import { encryptByRsa } from '@/utils/encrypt' | import { encryptByRsa } from '@/utils/encrypt' | ||||||
| import { useUserStore } from '@/stores' | import { useUserStore } from '@/stores' | ||||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
| import * as Regexp from '@/utils/regexp' | import * as Regexp from '@/utils/regexp' | ||||||
| import modalErrorWrapper from '@/utils/modal-error-wrapper' | import modalErrorWrapper from '@/utils/modal-error-wrapper' | ||||||
| import router from '@/router' | import router from '@/router' | ||||||
| @@ -49,7 +49,7 @@ const options: Options = { | |||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   phone: '', |   phone: '', | ||||||
|   email: '', |   email: '', | ||||||
|   captcha: '', |   captcha: '', | ||||||
|   | |||||||
| @@ -18,8 +18,8 @@ import { useWindowSize } from '@vueuse/core' | |||||||
| import { Message } from '@arco-design/web-vue' | import { Message } from '@arco-design/web-vue' | ||||||
| import { updateUserBaseInfo } from '@/apis/system' | import { updateUserBaseInfo } from '@/apis/system' | ||||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||||
| import { useForm } from '@/hooks' |  | ||||||
| import { useUserStore } from '@/stores' | import { useUserStore } from '@/stores' | ||||||
|  | import { useResetReactive } from '@/hooks' | ||||||
|  |  | ||||||
| const { width } = useWindowSize() | const { width } = useWindowSize() | ||||||
| const userStore = useUserStore() | const userStore = useUserStore() | ||||||
| @@ -33,7 +33,7 @@ const options: Options = { | |||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   nickname: userInfo.value.nickname, |   nickname: userInfo.value.nickname, | ||||||
|   gender: userInfo.value.gender, |   gender: userInfo.value.gender, | ||||||
| }) | }) | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ import { useWindowSize } from '@vueuse/core' | |||||||
| import { mapTree } from 'xe-utils' | import { mapTree } from 'xe-utils' | ||||||
| import { type DeptResp, addDept, getDept, updateDept } from '@/apis/system/dept' | import { type DeptResp, addDept, getDept, updateDept } from '@/apis/system/dept' | ||||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
|  |  | ||||||
| interface Props { | interface Props { | ||||||
|   depts: DeptResp[] |   depts: DeptResp[] | ||||||
| @@ -55,7 +55,7 @@ const options: Options = { | |||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   sort: 999, |   sort: 999, | ||||||
|   status: 1, |   status: 1, | ||||||
| }) | }) | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ import { Message } from '@arco-design/web-vue' | |||||||
| import { useWindowSize } from '@vueuse/core' | import { useWindowSize } from '@vueuse/core' | ||||||
| import { addDictItem, getDictItem, updateDictItem } from '@/apis/system/dict' | import { addDictItem, getDictItem, updateDictItem } from '@/apis/system/dict' | ||||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
|   (e: 'save-success'): void |   (e: 'save-success'): void | ||||||
| @@ -46,7 +46,7 @@ const options: Options = { | |||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   color: 'blue', |   color: 'blue', | ||||||
|   sort: 999, |   sort: 999, | ||||||
|   status: 1, |   status: 1, | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ import { Message } from '@arco-design/web-vue' | |||||||
| import { useWindowSize } from '@vueuse/core' | import { useWindowSize } from '@vueuse/core' | ||||||
| import { addDict, getDict, updateDict } from '@/apis/system/dict' | import { addDict, getDict, updateDict } from '@/apis/system/dict' | ||||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
|   (e: 'save-success'): void |   (e: 'save-success'): void | ||||||
| @@ -37,7 +37,7 @@ const options: Options = { | |||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({}) | const [form, resetForm] = useResetReactive({}) | ||||||
|  |  | ||||||
| const columns: Columns = reactive([ | const columns: Columns = reactive([ | ||||||
|   { label: '名称', field: 'name', type: 'input', rules: [{ required: true, message: '请输入名称' }] }, |   { label: '名称', field: 'name', type: 'input', rules: [{ required: true, message: '请输入名称' }] }, | ||||||
|   | |||||||
| @@ -119,7 +119,7 @@ import { type FormInstance, Message, type TreeNodeData } from '@arco-design/web- | |||||||
| import { useWindowSize } from '@vueuse/core' | import { useWindowSize } from '@vueuse/core' | ||||||
| import { mapTree } from 'xe-utils' | import { mapTree } from 'xe-utils' | ||||||
| import { type MenuResp, addMenu, getMenu, updateMenu } from '@/apis/system/menu' | import { type MenuResp, addMenu, getMenu, updateMenu } from '@/apis/system/menu' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
| import { filterTree, transformPathToName } from '@/utils' | import { filterTree, transformPathToName } from '@/utils' | ||||||
|  |  | ||||||
| interface Props { | interface Props { | ||||||
| @@ -141,7 +141,7 @@ const isUpdate = computed(() => !!dataId.value) | |||||||
| const title = computed(() => (isUpdate.value ? '修改菜单' : '新增菜单')) | const title = computed(() => (isUpdate.value ? '修改菜单' : '新增菜单')) | ||||||
| const formRef = ref<FormInstance>() | const formRef = ref<FormInstance>() | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   type: 1, |   type: 1, | ||||||
|   sort: 999, |   sort: 999, | ||||||
|   isExternal: false, |   isExternal: false, | ||||||
|   | |||||||
| @@ -64,7 +64,7 @@ import { listUserDict } from '@/apis' | |||||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||||
| import type { LabelValueState } from '@/types/global' | import type { LabelValueState } from '@/types/global' | ||||||
| import { useTabsStore } from '@/stores' | import { useTabsStore } from '@/stores' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
| import { useDict } from '@/hooks/app' | import { useDict } from '@/hooks/app' | ||||||
|  |  | ||||||
| const { width } = useWindowSize() | const { width } = useWindowSize() | ||||||
| @@ -85,7 +85,7 @@ const options: Options = { | |||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   title: '', |   title: '', | ||||||
|   type: '', |   type: '', | ||||||
|   effectiveTime: '', |   effectiveTime: '', | ||||||
|   | |||||||
| @@ -41,7 +41,7 @@ | |||||||
| import AiEditor from './components/index.vue' | import AiEditor from './components/index.vue' | ||||||
| import { getNotice } from '@/apis/system/notice' | import { getNotice } from '@/apis/system/notice' | ||||||
| import { useTabsStore } from '@/stores' | import { useTabsStore } from '@/stores' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
|  |  | ||||||
| const route = useRoute() | const route = useRoute() | ||||||
| const router = useRouter() | const router = useRouter() | ||||||
| @@ -49,7 +49,7 @@ const tabsStore = useTabsStore() | |||||||
|  |  | ||||||
| const { id } = route.query | const { id } = route.query | ||||||
| const containerRef = ref<HTMLElement | null>() | const containerRef = ref<HTMLElement | null>() | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   title: '', |   title: '', | ||||||
|   createUserString: '', |   createUserString: '', | ||||||
|   effectiveTime: '', |   effectiveTime: '', | ||||||
|   | |||||||
| @@ -105,7 +105,7 @@ | |||||||
| import { type FormInstance, Message, type TreeNodeData } from '@arco-design/web-vue' | import { type FormInstance, Message, type TreeNodeData } from '@arco-design/web-vue' | ||||||
| import { useWindowSize } from '@vueuse/core' | import { useWindowSize } from '@vueuse/core' | ||||||
| import { addRole } from '@/apis/system/role' | import { addRole } from '@/apis/system/role' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
| import { useDept, useDict, useMenu } from '@/hooks/app' | import { useDept, useDict, useMenu } from '@/hooks/app' | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
| @@ -127,7 +127,7 @@ const rules: FormInstance['rules'] = { | |||||||
|   dataScope: [{ required: true, message: '请选择数据权限' }], |   dataScope: [{ required: true, message: '请选择数据权限' }], | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   menuCheckStrictly: true, |   menuCheckStrictly: true, | ||||||
|   deptCheckStrictly: true, |   deptCheckStrictly: true, | ||||||
|   sort: 999, |   sort: 999, | ||||||
|   | |||||||
| @@ -84,7 +84,7 @@ | |||||||
| import { type FormInstance, Message, type TreeNodeData } from '@arco-design/web-vue' | import { type FormInstance, Message, type TreeNodeData } from '@arco-design/web-vue' | ||||||
| import { useWindowSize } from '@vueuse/core' | import { useWindowSize } from '@vueuse/core' | ||||||
| import { getRole, updateRole } from '@/apis/system/role' | import { getRole, updateRole } from '@/apis/system/role' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
| import { useDept, useDict, useMenu } from '@/hooks/app' | import { useDept, useDict, useMenu } from '@/hooks/app' | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
| @@ -106,7 +106,7 @@ const rules: FormInstance['rules'] = { | |||||||
|   dataScope: [{ required: true, message: '请选择数据权限' }], |   dataScope: [{ required: true, message: '请选择数据权限' }], | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   menuCheckStrictly: true, |   menuCheckStrictly: true, | ||||||
|   deptCheckStrictly: true, |   deptCheckStrictly: true, | ||||||
|   sort: 999, |   sort: 999, | ||||||
|   | |||||||
| @@ -95,7 +95,7 @@ | |||||||
| import { type FormInstance, Message } from '@arco-design/web-vue' | import { type FormInstance, Message } from '@arco-design/web-vue' | ||||||
| import { useWindowSize } from '@vueuse/core' | import { useWindowSize } from '@vueuse/core' | ||||||
| import { addStorage, getStorage, updateStorage } from '@/apis/system/storage' | import { addStorage, getStorage, updateStorage } from '@/apis/system/storage' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
| import { useDict } from '@/hooks/app' | import { useDict } from '@/hooks/app' | ||||||
| import { encryptByRsa } from '@/utils/encrypt' | import { encryptByRsa } from '@/utils/encrypt' | ||||||
| import { isIPv4 } from '@/utils/validate' | import { isIPv4 } from '@/utils/validate' | ||||||
| @@ -123,7 +123,7 @@ const rules: FormInstance['rules'] = { | |||||||
|   bucketName: [{ required: true, message: '请输入桶名称' }], |   bucketName: [{ required: true, message: '请输入桶名称' }], | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   type: 2, |   type: 2, | ||||||
|   isDefault: false, |   isDefault: false, | ||||||
|   sort: 999, |   sort: 999, | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ import { addUser, getUser, updateUser } from '@/apis/system/user' | |||||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||||
| import type { Gender, Status } from '@/types/global' | import type { Gender, Status } from '@/types/global' | ||||||
| import { GenderList } from '@/constant/common' | import { GenderList } from '@/constant/common' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
| import { useDept, useRole } from '@/hooks/app' | import { useDept, useRole } from '@/hooks/app' | ||||||
| import { encryptByRsa } from '@/utils/encrypt' | import { encryptByRsa } from '@/utils/encrypt' | ||||||
|  |  | ||||||
| @@ -42,7 +42,7 @@ const options: Options = { | |||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   gender: 1 as Gender, |   gender: 1 as Gender, | ||||||
|   status: 1 as Status, |   status: 1 as Status, | ||||||
| }) | }) | ||||||
|   | |||||||
| @@ -94,7 +94,7 @@ import { | |||||||
|   importUser, |   importUser, | ||||||
|   parseImportUser, |   parseImportUser, | ||||||
| } from '@/apis/system/user' | } from '@/apis/system/user' | ||||||
| import { useDownload, useForm } from '@/hooks' | import { useDownload, useResetReactive } from '@/hooks' | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
|   (e: 'save-success'): void |   (e: 'save-success'): void | ||||||
| @@ -106,7 +106,7 @@ const visible = ref(false) | |||||||
| const formRef = ref<FormInstance>() | const formRef = ref<FormInstance>() | ||||||
| const uploadFile = ref([]) | const uploadFile = ref([]) | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({ | const [form, resetForm] = useResetReactive({ | ||||||
|   errorPolicy: 1, |   errorPolicy: 1, | ||||||
|   duplicateUser: 1, |   duplicateUser: 1, | ||||||
|   duplicateEmail: 1, |   duplicateEmail: 1, | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ | |||||||
| import { Message } from '@arco-design/web-vue' | import { Message } from '@arco-design/web-vue' | ||||||
| import { resetUserPwd } from '@/apis/system' | import { resetUserPwd } from '@/apis/system' | ||||||
| import { type Columns, GiForm } from '@/components/GiForm' | import { type Columns, GiForm } from '@/components/GiForm' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
| import { encryptByRsa } from '@/utils/encrypt' | import { encryptByRsa } from '@/utils/encrypt' | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
| @@ -34,7 +34,7 @@ const options: Options = { | |||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({}) | const [form, resetForm] = useResetReactive({}) | ||||||
|  |  | ||||||
| const columns: Columns = reactive([ | const columns: Columns = reactive([ | ||||||
|   { label: '密码', field: 'newPassword', type: 'input-password', rules: [{ required: true, message: '请输入密码' }] }, |   { label: '密码', field: 'newPassword', type: 'input-password', rules: [{ required: true, message: '请输入密码' }] }, | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ import { Message } from '@arco-design/web-vue' | |||||||
| import { useWindowSize } from '@vueuse/core' | import { useWindowSize } from '@vueuse/core' | ||||||
| import { getUser, updateUserRole } from '@/apis/system' | import { getUser, updateUserRole } from '@/apis/system' | ||||||
| import { type Columns, GiForm, type Options } from '@/components/GiForm' | import { type Columns, GiForm, type Options } from '@/components/GiForm' | ||||||
| import { useForm } from '@/hooks' | import { useResetReactive } from '@/hooks' | ||||||
| import { useRole } from '@/hooks/app' | import { useRole } from '@/hooks/app' | ||||||
|  |  | ||||||
| const emit = defineEmits<{ | const emit = defineEmits<{ | ||||||
| @@ -36,7 +36,7 @@ const options: Options = { | |||||||
|   btns: { hide: true }, |   btns: { hide: true }, | ||||||
| } | } | ||||||
|  |  | ||||||
| const { form, resetForm } = useForm({}) | const [form, resetForm] = useResetReactive({}) | ||||||
|  |  | ||||||
| const columns: Columns = reactive([ | const columns: Columns = reactive([ | ||||||
|   { |   { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user