mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-04 04:08:44 +08:00 
			
		
		
		
	Merge branch 'master' of https://gitee.com/meibe/yudao-ui-admin-vue3
This commit is contained in:
		@@ -131,7 +131,6 @@
 | 
			
		||||
                ref="treeRef"
 | 
			
		||||
                node-key="id"
 | 
			
		||||
                show-checkbox
 | 
			
		||||
                :default-checked-keys="defaultCheckedKeys"
 | 
			
		||||
                :check-strictly="!checkStrictly"
 | 
			
		||||
                :props="defaultProps"
 | 
			
		||||
                :data="treeOptions"
 | 
			
		||||
@@ -255,7 +254,6 @@ const dialogScopeVisible = ref(false)
 | 
			
		||||
const dialogScopeTitle = ref('数据权限')
 | 
			
		||||
const actionScopeType = ref('')
 | 
			
		||||
const dataScopeDictDatas = ref()
 | 
			
		||||
const defaultCheckedKeys = ref()
 | 
			
		||||
// 选项
 | 
			
		||||
const checkStrictly = ref(true)
 | 
			
		||||
const treeNodeAll = ref(false)
 | 
			
		||||
@@ -268,13 +266,16 @@ const handleScope = async (type: string, row: RoleApi.RoleVO) => {
 | 
			
		||||
  dataScopeForm.id = row.id
 | 
			
		||||
  dataScopeForm.name = row.name
 | 
			
		||||
  dataScopeForm.code = row.code
 | 
			
		||||
  actionScopeType.value = type
 | 
			
		||||
  dialogScopeVisible.value = true
 | 
			
		||||
  if (type === 'menu') {
 | 
			
		||||
    const menuRes = await listSimpleMenusApi()
 | 
			
		||||
    treeOptions.value = handleTree(menuRes)
 | 
			
		||||
    const role = await PermissionApi.listRoleMenusApi(row.id)
 | 
			
		||||
    if (role) {
 | 
			
		||||
      // treeRef.value!.setCheckedKeys(role as unknown as Array<number>)
 | 
			
		||||
      defaultCheckedKeys.value = role
 | 
			
		||||
      role?.forEach((item: any) => {
 | 
			
		||||
        unref(treeRef)?.setChecked(item, true, false)
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  } else if (type === 'data') {
 | 
			
		||||
    const deptRes = await listSimpleDeptApi()
 | 
			
		||||
@@ -282,12 +283,11 @@ const handleScope = async (type: string, row: RoleApi.RoleVO) => {
 | 
			
		||||
    const role = await RoleApi.getRoleApi(row.id)
 | 
			
		||||
    dataScopeForm.dataScope = role.dataScope
 | 
			
		||||
    if (role.dataScopeDeptIds) {
 | 
			
		||||
      // treeRef.value!.setCheckedKeys(role.dataScopeDeptIds as unknown as Array<number>, false)
 | 
			
		||||
      defaultCheckedKeys.value = role.dataScopeDeptIds
 | 
			
		||||
      role.dataScopeDeptIds?.forEach((item: any) => {
 | 
			
		||||
        unref(treeRef)?.setChecked(item, true, false)
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  actionScopeType.value = type
 | 
			
		||||
  dialogScopeVisible.value = true
 | 
			
		||||
}
 | 
			
		||||
// 保存权限
 | 
			
		||||
const submitScope = async () => {
 | 
			
		||||
 
 | 
			
		||||
@@ -9,12 +9,19 @@ export const rules = reactive({
 | 
			
		||||
})
 | 
			
		||||
// CrudSchema
 | 
			
		||||
const crudSchemas = reactive<VxeCrudSchema>({
 | 
			
		||||
  primaryKey: 'id',
 | 
			
		||||
  primaryTitle: '角色编号',
 | 
			
		||||
  primaryType: 'seq',
 | 
			
		||||
  // primaryKey: 'id',
 | 
			
		||||
  // primaryTitle: '角色编号',
 | 
			
		||||
  // primaryType: 'seq',
 | 
			
		||||
  action: true,
 | 
			
		||||
  actionWidth: '400px',
 | 
			
		||||
  columns: [
 | 
			
		||||
    {
 | 
			
		||||
      title: '角色编号',
 | 
			
		||||
      field: 'id',
 | 
			
		||||
      table: {
 | 
			
		||||
        width: 200
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      title: '角色名称',
 | 
			
		||||
      field: 'name',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user