From 9cf4500ed56034911f2ef83cb45a202a9399619d Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Tue, 15 Nov 2022 17:51:50 +0800 Subject: [PATCH] refactor: button --- .../views/system/sms/smsTemplate/index.vue | 10 +- .../src/views/system/tenantPackage/index.vue | 17 ++-- .../src/views/system/user/index.vue | 96 +++++++++---------- 3 files changed, 61 insertions(+), 62 deletions(-) diff --git a/yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue b/yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue index d1417e255..8dbb82cbb 100644 --- a/yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue @@ -6,9 +6,13 @@
- - {{ t('action.add') }} - +
- - {{ t('action.add') }} - +
{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
diff --git a/yudao-ui-admin-vue3/src/views/system/user/index.vue b/yudao-ui-admin-vue3/src/views/system/user/index.vue index f14409249..c9f017757 100644 --- a/yudao-ui-admin-vue3/src/views/system/user/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/user/index.vue @@ -4,9 +4,7 @@ @@ -37,23 +35,27 @@ />
- - {{ t('action.add') }} - - + - {{ t('action.import') }} - - + - {{ t('action.export') }} - + />
{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
@@ -296,6 +290,7 @@ import { useRouter } from 'vue-router' import { CommonStatusEnum } from '@/utils/constants' import { getAccessToken, getTenantId } from '@/utils/auth' import { useMessage } from '@/hooks/web/useMessage' +import { nextTick } from 'process' const message = useMessage() @@ -365,23 +360,24 @@ const setDialogTile = async (type: string) => { } // 新增操作 -const handleAdd = async () => { +const handleCreate = async () => { // 重置表单 deptId.value = null postIds.value = [] dialogVisible.value = true dialogTitle.value = t('action.create') actionType.value = 'create' - await unref(formRef)?.getElFormRef().resetFields() + await nextTick() + unref(formRef)?.getElFormRef().resetFields() } // 修改操作 -const handleUpdate = async (row: UserVO) => { +const handleUpdate = async (rowId: number) => { await setDialogTile('update') unref(formRef)?.delSchema('username') unref(formRef)?.delSchema('password') // 设置数据 - const res = await UserApi.getUserApi(row.id) + const res = await UserApi.getUserApi(rowId) deptId.value = res.deptId postIds.value = res.postIds unref(formRef)?.setValues(res)