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