Skip to content

Commit

Permalink
chore: 优化部分命名
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Jul 18, 2024
1 parent ed085c9 commit 805ae65
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 56 deletions.
10 changes: 5 additions & 5 deletions src/views/system/dept/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ const reset = () => {
}
// 删除
const onDelete = (item: DeptResp) => {
return handleDelete(() => deleteDept(item.id), {
content: `是否确定删除 [${item.name}]?`,
const onDelete = (record: DeptResp) => {
return handleDelete(() => deleteDept(record.id), {
content: `是否确定删除 [${record.name}]?`,
showModal: true
})
}
Expand All @@ -150,8 +150,8 @@ const onAdd = (parentId?: string) => {
}
// 修改
const onUpdate = (item: DeptResp) => {
DeptAddModalRef.value?.onUpdate(item.id)
const onUpdate = (record: DeptResp) => {
DeptAddModalRef.value?.onUpdate(record.id)
}
</script>

Expand Down
8 changes: 4 additions & 4 deletions src/views/system/dict/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ const reset = () => {
}
// 删除
const onDelete = (item: DictItemResp) => {
return handleDelete(() => deleteDictItem(item.id), { content: `是否确定删除 [${item.label}]?`, showModal: true })
const onDelete = (record: DictItemResp) => {
return handleDelete(() => deleteDictItem(record.id), { content: `是否确定删除 [${record.label}]?`, showModal: true })
}
// 根据选中字典查询
Expand All @@ -144,8 +144,8 @@ const onAdd = () => {
}
// 修改
const onUpdate = (item: DictItemResp) => {
DictItemAddModalRef.value?.onUpdate(item.id)
const onUpdate = (record: DictItemResp) => {
DictItemAddModalRef.value?.onUpdate(record.id)
}
</script>

Expand Down
10 changes: 5 additions & 5 deletions src/views/system/menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ const reset = () => {
}
// 删除
const onDelete = (item: MenuResp) => {
return handleDelete(() => deleteMenu(item.id), {
content: `是否确定删除 [${item.title}]?`,
const onDelete = (record: MenuResp) => {
return handleDelete(() => deleteMenu(record.id), {
content: `是否确定删除 [${record.title}]?`,
showModal: true
})
}
Expand All @@ -162,8 +162,8 @@ const onAdd = (parentId?: string) => {
}
// 修改
const onUpdate = (item: MenuResp) => {
MenuAddModalRef.value?.onUpdate(item.id)
const onUpdate = (record: MenuResp) => {
MenuAddModalRef.value?.onUpdate(record.id)
}
</script>

Expand Down
14 changes: 7 additions & 7 deletions src/views/system/notice/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ const reset = () => {
}
// 删除
const onDelete = (item: NoticeResp) => {
return handleDelete(() => deleteNotice(item.id), {
content: `是否确定删除公告 [${item.title}]?`,
const onDelete = (record: NoticeResp) => {
return handleDelete(() => deleteNotice(record.id), {
content: `是否确定删除公告 [${record.title}]?`,
showModal: true
})
}
Expand All @@ -125,14 +125,14 @@ const onAdd = () => {
}
// 修改
const onUpdate = (item: NoticeResp) => {
NoticeAddModalRef.value?.onUpdate(item.id)
const onUpdate = (record: NoticeResp) => {
NoticeAddModalRef.value?.onUpdate(record.id)
}
const NoticeDetailModalRef = ref<InstanceType<typeof NoticeDetailModal>>()
// 详情
const onDetail = (item: NoticeResp) => {
NoticeDetailModalRef.value?.onDetail(item.id)
const onDetail = (record: NoticeResp) => {
NoticeDetailModalRef.value?.onDetail(record.id)
}
</script>

Expand Down
File renamed without changes.
20 changes: 10 additions & 10 deletions src/views/system/role/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@
</template>
</GiTable>

<RoleAddModal ref="RoleAddModalRef" @save-success="search" />
<RoleAddDrawer ref="RoleAddDrawerRef" @save-success="search" />
<RoleDetailDrawer ref="RoleDetailDrawerRef" />
</div>
</template>

<script setup lang="ts">
import RoleAddModal from './RoleAddModal.vue'
import RoleAddDrawer from './RoleAddDrawer.vue'
import RoleDetailDrawer from './RoleDetailDrawer.vue'
import { type RoleQuery, type RoleResp, deleteRole, listRole } from '@/apis'
import type { TableInstanceColumns } from '@/components/GiTable/type'
Expand Down Expand Up @@ -115,25 +115,25 @@ const reset = () => {
}
// 删除
const onDelete = (item: RoleResp) => {
return handleDelete(() => deleteRole(item.id), { content: `是否确定删除 [${item.name}]?`, showModal: true })
const onDelete = (record: RoleResp) => {
return handleDelete(() => deleteRole(record.id), { content: `是否确定删除 [${record.name}]?`, showModal: true })
}
const RoleAddModalRef = ref<InstanceType<typeof RoleAddModal>>()
const RoleAddDrawerRef = ref<InstanceType<typeof RoleAddDrawer>>()
// 新增
const onAdd = () => {
RoleAddModalRef.value?.onAdd()
RoleAddDrawerRef.value?.onAdd()
}
// 修改
const onUpdate = (item: RoleResp) => {
RoleAddModalRef.value?.onUpdate(item.id)
const onUpdate = (record: RoleResp) => {
RoleAddDrawerRef.value?.onUpdate(record.id)
}
const RoleDetailDrawerRef = ref<InstanceType<typeof RoleDetailDrawer>>()
// 详情
const onDetail = (item: RoleResp) => {
RoleDetailDrawerRef.value?.onDetail(item.id)
const onDetail = (record: RoleResp) => {
RoleDetailDrawerRef.value?.onDetail(record.id)
}
</script>

Expand Down
16 changes: 8 additions & 8 deletions src/views/system/storage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
</template>
</GiTable>

<StorageAddModal ref="StorageAddModalRef" @save-success="search" />
<StorageAddDrawer ref="StorageAddDrawerRef" @save-success="search" />
</div>
</template>

<script setup lang="ts">
import StorageAddModal from './StorageAddModal.vue'
import StorageAddDrawer from './StorageAddDrawer.vue'
import { type StorageQuery, type StorageResp, deleteStorage, listStorage } from '@/apis'
import type { TableInstanceColumns } from '@/components/GiTable/type'
import { useTable } from '@/hooks'
Expand Down Expand Up @@ -130,19 +130,19 @@ const reset = () => {
}
// 删除
const onDelete = (item: StorageResp) => {
return handleDelete(() => deleteStorage(item.id), { content: `是否确定删除存储 [${item.name}]?`, showModal: true })
const onDelete = (record: StorageResp) => {
return handleDelete(() => deleteStorage(record.id), { content: `是否确定删除存储 [${record.name}]?`, showModal: true })
}
const StorageAddModalRef = ref<InstanceType<typeof StorageAddModal>>()
const StorageAddDrawerRef = ref<InstanceType<typeof StorageAddDrawer>>()
// 新增
const onAdd = () => {
StorageAddModalRef.value?.onAdd()
StorageAddDrawerRef.value?.onAdd()
}
// 修改
const onUpdate = (item: StorageResp) => {
StorageAddModalRef.value?.onUpdate(item.id)
const onUpdate = (record: StorageResp) => {
StorageAddDrawerRef.value?.onUpdate(record.id)
}
</script>

Expand Down
File renamed without changes.
File renamed without changes.
34 changes: 17 additions & 17 deletions src/views/system/user/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@
</a-col>
</a-row>

<UserAddModal ref="UserAddModalRef" @save-success="search" />
<UserImportModal ref="UserImportModalRef" @save-success="search" />
<UserAddDrawer ref="UserAddDrawerRef" @save-success="search" />
<UserImportDrawer ref="UserImportDrawerRef" @save-success="search" />
<UserDetailDrawer ref="UserDetailDrawerRef" />
<UserResetPwdModal ref="UserResetPwdModalRef" />
</div>
</template>

<script setup lang="ts">
import DeptTree from './dept/index.vue'
import UserAddModal from './UserAddModal.vue'
import UserImportModal from './UserImportModal.vue'
import UserAddDrawer from './UserAddDrawer.vue'
import UserImportDrawer from './UserImportDrawer.vue'
import UserDetailDrawer from './UserDetailDrawer.vue'
import UserResetPwdModal from './UserResetPwdModal.vue'
import { type UserQuery, type UserResp, deleteUser, exportUser, listUser } from '@/apis'
Expand Down Expand Up @@ -165,9 +165,9 @@ const reset = () => {
}
// 删除
const onDelete = (item: UserResp) => {
return handleDelete(() => deleteUser(item.id), {
content: `是否确定删除 [${item.nickname}(${item.username})]?`,
const onDelete = (record: UserResp) => {
return handleDelete(() => deleteUser(record.id), {
content: `是否确定删除 [${record.nickname}(${record.username})]?`,
showModal: true
})
}
Expand All @@ -183,33 +183,33 @@ const handleSelectDept = (keys: Array<any>) => {
search()
}
const UserAddModalRef = ref<InstanceType<typeof UserAddModal>>()
const UserAddDrawerRef = ref<InstanceType<typeof UserAddDrawer>>()
// 新增
const onAdd = () => {
UserAddModalRef.value?.onAdd()
UserAddDrawerRef.value?.onAdd()
}
const UserImportModalRef = ref<InstanceType<typeof UserImportModal>>()
const UserImportDrawerRef = ref<InstanceType<typeof UserImportDrawer>>()
// 导入
const onImport = () => {
UserImportModalRef.value?.onImport()
UserImportDrawerRef.value?.onImport()
}
// 修改
const onUpdate = (item: UserResp) => {
UserAddModalRef.value?.onUpdate(item.id)
const onUpdate = (record: UserResp) => {
UserAddDrawerRef.value?.onUpdate(record.id)
}
const UserDetailDrawerRef = ref<InstanceType<typeof UserDetailDrawer>>()
// 详情
const onDetail = (item: UserResp) => {
UserDetailDrawerRef.value?.onDetail(item.id)
const onDetail = (record: UserResp) => {
UserDetailDrawerRef.value?.onDetail(record.id)
}
const UserResetPwdModalRef = ref<InstanceType<typeof UserResetPwdModal>>()
// 重置密码
const onResetPwd = (item: UserResp) => {
UserResetPwdModalRef.value?.onReset(item.id)
const onResetPwd = (record: UserResp) => {
UserResetPwdModalRef.value?.onReset(record.id)
}
</script>

Expand Down

0 comments on commit 805ae65

Please sign in to comment.