diff --git a/src/hooks/web/common.ts b/src/hooks/web/common.ts index 2acee9a9..e5a13031 100644 --- a/src/hooks/web/common.ts +++ b/src/hooks/web/common.ts @@ -142,7 +142,7 @@ export function formatParams(params = {}, equal: any = [], otherQuery: any = []) sortConditions: [], }, } - let otherQueryCondition={} + let otherQueryCondition="[]" const conditions = [] as any for (let key in params) { if (params[key] !== undefined) { diff --git a/src/views/system/datarule/api.ts b/src/views/system/datarule/api.ts index 5414e935..2d6d5d5d 100644 --- a/src/views/system/datarule/api.ts +++ b/src/views/system/datarule/api.ts @@ -17,3 +17,11 @@ export function GetClientUserPermissions(params) { params: params }) } + +export function GetCodeDataRuleList(params) { + return request({ + url: '/mainApi/CodeDataRule/GetCodeDataRuleList', + method: 'post', + data: params + }) +} \ No newline at end of file diff --git a/src/views/system/datarule/index.vue b/src/views/system/datarule/index.vue index 0ffc6afd..f20a5885 100644 --- a/src/views/system/datarule/index.vue +++ b/src/views/system/datarule/index.vue @@ -24,9 +24,9 @@
用户权限配置
- +
@@ -38,10 +38,11 @@ import { defineComponent, onMounted, ref } from 'vue' import { BasicTable, useTable, TableAction } from '/@/components/Table' import { getDataRuleList } from '/@/api/system/datarule' import { useModal } from '/@/components/Modal' -import { GetOrgUserTree, GetClientUserPermissions } from './api' +import { GetOrgUserTree, GetClientUserPermissions,GetCodeDataRuleList } from './api' import { BasicTree } from '/@/components/Tree/index' // import { columns, searchFormSchema } from './columns' const treeData = ref([]) +const menuTree = ref([]) onMounted(() => { GetOrgUserTree().then(res => { treeData.value = res.data @@ -50,9 +51,23 @@ onMounted(() => { }); }) }) +const userId = ref('') function handleSelect(selectedKeys: any, info: any) { if (info.node.id) { + userId.value = info.node.value GetClientUserPermissions({ id: info.node.value }).then(res => { + menuTree.value = res.data + }) + } +} +function handleSelectMenu(selectedKeys: any, info: any){ + console.log(info) + if(info.node.children==null || info.node.children.length==0){ + const data = { + permissionId: info.node.id, + id:userId.value + } + GetCodeDataRuleList(data).then(res=>{ }) }