mirror of
				https://github.com/continew-org/continew-admin-ui.git
				synced 2025-11-01 08:57:14 +08:00 
			
		
		
		
	refactor: 优化视图组件命名
This commit is contained in:
		| @@ -76,16 +76,16 @@ | ||||
|       </GiTable> | ||||
|     </a-card> | ||||
|  | ||||
|     <AddDeptModal ref="AddDeptModalRef" @save-success="search" /> | ||||
|     <DeptAddModal ref="DeptAddModalRef" @save-success="search" /> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { listDept, deleteDept, exportDept, type DeptResp, type DeptQuery } from '@/apis' | ||||
| import DeptAddModal from './DeptAddModal.vue' | ||||
| import { Message } from '@arco-design/web-vue' | ||||
| import type GiTable from '@/components/GiTable/index.vue' | ||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||
| import AddDeptModal from './AddDeptModal.vue' | ||||
| import { DisEnableStatusList } from '@/constant/common' | ||||
| import { useDownload } from '@/hooks' | ||||
| import { isMobile } from '@/utils' | ||||
| @@ -152,15 +152,15 @@ const onExport = () => { | ||||
|   useDownload(() => exportDept(queryForm)) | ||||
| } | ||||
|  | ||||
| const AddDeptModalRef = ref<InstanceType<typeof AddDeptModal>>() | ||||
| const DeptAddModalRef = ref<InstanceType<typeof DeptAddModal>>() | ||||
| // 新增 | ||||
| const onAdd = (id?: string) => { | ||||
|   AddDeptModalRef.value?.onAdd(id) | ||||
|   DeptAddModalRef.value?.onAdd(id) | ||||
| } | ||||
|  | ||||
| // 修改 | ||||
| const onUpdate = (item: DeptResp) => { | ||||
|   AddDeptModalRef.value?.onUpdate(item.id) | ||||
|   DeptAddModalRef.value?.onUpdate(item.id) | ||||
| } | ||||
|  | ||||
| onMounted(() => { | ||||
|   | ||||
| @@ -48,14 +48,14 @@ | ||||
|       </GiTable> | ||||
|     </a-card> | ||||
|  | ||||
|     <AddDictModal ref="AddDictModalRef" @save-success="search" /> | ||||
|     <DictAddModal ref="DictAddModalRef" @save-success="search" /> | ||||
|     <DictItemModal ref="DictItemModalRef" /> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { listDict, deleteDict, type DictResp } from '@/apis' | ||||
| import AddDictModal from './AddDictModal.vue' | ||||
| import DictAddModal from './DictAddModal.vue' | ||||
| import DictItemModal from '@/views/system/dict/item/index.vue' | ||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||
| import { useTable } from '@/hooks' | ||||
| @@ -97,7 +97,6 @@ const { | ||||
| // 重置 | ||||
| const reset = () => { | ||||
|   queryForm.description = undefined | ||||
|   queryForm.status = undefined | ||||
|   search() | ||||
| } | ||||
|  | ||||
| @@ -106,15 +105,15 @@ const onDelete = (item: DictResp) => { | ||||
|   return handleDelete(() => deleteDict(item.id), { content: `是否确定删除字典 [${item.name}]?`, showModal: true }) | ||||
| } | ||||
|  | ||||
| const AddDictModalRef = ref<InstanceType<typeof AddDictModal>>() | ||||
| const DictAddModalRef = ref<InstanceType<typeof DictAddModal>>() | ||||
| // 新增 | ||||
| const onAdd = () => { | ||||
|   AddDictModalRef.value?.onAdd() | ||||
|   DictAddModalRef.value?.onAdd() | ||||
| } | ||||
|  | ||||
| // 修改 | ||||
| const onUpdate = (item: DictResp) => { | ||||
|   AddDictModalRef.value?.onUpdate(item.id) | ||||
|   DictAddModalRef.value?.onUpdate(item.id) | ||||
| } | ||||
|  | ||||
| const DictItemModalRef = ref<InstanceType<typeof DictItemModal>>() | ||||
|   | ||||
| @@ -57,13 +57,13 @@ | ||||
|       </template> | ||||
|     </GiTable> | ||||
|  | ||||
|     <AddDictItemModal ref="AddDictItemModalRef" @save-success="search" /> | ||||
|     <DictItemAddModal ref="DictItemAddModalRef" @save-success="search" /> | ||||
|   </a-modal> | ||||
| </template> | ||||
|  | ||||
| <script lang="ts" setup> | ||||
| import { listDictItem, deleteDictItem, type DictItemResp } from '@/apis' | ||||
| import AddDictItemModal from './AddDictItemModal.vue' | ||||
| import DictItemAddModal from './DictItemAddModal.vue' | ||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||
| import { useTable } from '@/hooks' | ||||
| import { isMobile } from '@/utils' | ||||
| @@ -137,15 +137,15 @@ const onDelete = (item: DictItemResp) => { | ||||
|   return handleDelete(() => deleteDictItem(item.id), { content: `是否确定删除 [${item.label}]?`, showModal: false }) | ||||
| } | ||||
|  | ||||
| const AddDictItemModalRef = ref<InstanceType<typeof AddDictItemModal>>() | ||||
| const DictItemAddModalRef = ref<InstanceType<typeof DictItemAddModal>>() | ||||
| // 新增 | ||||
| const onAdd = () => { | ||||
|   AddDictItemModalRef.value?.onAdd(dictId.value) | ||||
|   DictItemAddModalRef.value?.onAdd(dictId.value) | ||||
| } | ||||
|  | ||||
| // 修改 | ||||
| const onUpdate = (item: DictItemResp) => { | ||||
|   AddDictItemModalRef.value?.onUpdate(item.id) | ||||
|   DictItemAddModalRef.value?.onUpdate(item.id) | ||||
| } | ||||
| </script> | ||||
|  | ||||
|   | ||||
| @@ -88,16 +88,16 @@ | ||||
|       </GiTable> | ||||
|     </a-card> | ||||
|  | ||||
|     <AddMenuModal ref="AddMenuModalRef" :menus="dataList" @save-success="search"></AddMenuModal> | ||||
|     <MenuAddModal ref="MenuAddModalRef" :menus="dataList" @save-success="search" /> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { listMenu, deleteMenu, type MenuResp, type MenuQuery } from '@/apis' | ||||
| import MenuAddModal from './MenuAddModal.vue' | ||||
| import { Message } from '@arco-design/web-vue' | ||||
| import type GiTable from '@/components/GiTable/index.vue' | ||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||
| import AddMenuModal from './AddMenuModal.vue' | ||||
| import { DisEnableStatusList } from '@/constant/common' | ||||
| import { isMobile } from '@/utils' | ||||
|  | ||||
| @@ -168,15 +168,15 @@ const onExpanded = () => { | ||||
|   tableRef.value?.tableRef?.expandAll(isExpanded.value) | ||||
| } | ||||
|  | ||||
| const AddMenuModalRef = ref<InstanceType<typeof AddMenuModal>>() | ||||
| const MenuAddModalRef = ref<InstanceType<typeof MenuAddModal>>() | ||||
| // 新增 | ||||
| const onAdd = (id?: string) => { | ||||
|   AddMenuModalRef.value?.onAdd(id) | ||||
|   MenuAddModalRef.value?.onAdd(id) | ||||
| } | ||||
|  | ||||
| // 修改 | ||||
| const onUpdate = (item: MenuResp) => { | ||||
|   AddMenuModalRef.value?.onUpdate(item.id) | ||||
|   MenuAddModalRef.value?.onUpdate(item.id) | ||||
| } | ||||
|  | ||||
| onMounted(() => { | ||||
|   | ||||
| @@ -62,7 +62,7 @@ | ||||
|         </template> | ||||
|       </GiTable> | ||||
|  | ||||
|       <AddRoleModal ref="AddRoleModalRef" @save-success="search" /> | ||||
|       <RoleAddModal ref="RoleAddModalRef" @save-success="search" /> | ||||
|       <RoleDetailDrawer ref="RoleDetailDrawerRef" /> | ||||
|     </a-card> | ||||
|   </div> | ||||
| @@ -70,7 +70,7 @@ | ||||
|  | ||||
| <script setup lang="ts"> | ||||
| import { listRole, deleteRole, type RoleResp } from '@/apis' | ||||
| import AddRoleModal from './AddRoleModal.vue' | ||||
| import RoleAddModal from './RoleAddModal.vue' | ||||
| import RoleDetailDrawer from './RoleDetailDrawer.vue' | ||||
| import type { TableInstanceColumns } from '@/components/GiTable/type' | ||||
| import { useTable } from '@/hooks' | ||||
| @@ -129,15 +129,15 @@ const onDelete = (item: RoleResp) => { | ||||
|   return handleDelete(() => deleteRole(item.id), { content: `是否确定删除角色 [${item.name}]?`, showModal: true }) | ||||
| } | ||||
|  | ||||
| const AddRoleModalRef = ref<InstanceType<typeof AddRoleModal>>() | ||||
| const RoleAddModalRef = ref<InstanceType<typeof RoleAddModal>>() | ||||
| // 新增 | ||||
| const onAdd = () => { | ||||
|   AddRoleModalRef.value?.onAdd() | ||||
|   RoleAddModalRef.value?.onAdd() | ||||
| } | ||||
|  | ||||
| // 修改 | ||||
| const onUpdate = (item: RoleResp) => { | ||||
|   AddRoleModalRef.value?.onUpdate(item.id) | ||||
|   RoleAddModalRef.value?.onUpdate(item.id) | ||||
| } | ||||
|  | ||||
| const RoleDetailDrawerRef = ref<InstanceType<typeof RoleDetailDrawer>>() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user