szh-new
sunzehua 2 months ago
parent 099ae345f9
commit bb85d57454

@ -142,7 +142,7 @@ export function formatParams(params = {}, equal: any = [], otherQuery: any = [])
sortConditions: [], sortConditions: [],
}, },
} }
let otherQueryCondition={} let otherQueryCondition="[]"
const conditions = [] as any const conditions = [] as any
for (let key in params) { for (let key in params) {
if (params[key] !== undefined) { if (params[key] !== undefined) {

@ -17,3 +17,11 @@ export function GetClientUserPermissions(params) {
params: params params: params
}) })
} }
export function GetCodeDataRuleList(params) {
return request<DataResult>({
url: '/mainApi/CodeDataRule/GetCodeDataRuleList',
method: 'post',
data: params
})
}

@ -24,9 +24,9 @@
</div> </div>
<div class="tree-item"> <div class="tree-item">
<div class="title">用户权限配置</div> <div class="title">用户权限配置</div>
<BasicTree ref="treeRef" check-strictly :tree-data="treeData" @select="handleSelect"> <BasicTree ref="menuTreeRef" check-strictly :tree-data="menuTree" @select="handleSelectMenu">
<template #title="custom"> <template #title="custom">
<span>{{ custom.node.title }}</span> <span>{{ custom.node.name }}</span>
</template> </template>
</BasicTree> </BasicTree>
</div> </div>
@ -38,10 +38,11 @@ import { defineComponent, onMounted, ref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { getDataRuleList } from '/@/api/system/datarule' import { getDataRuleList } from '/@/api/system/datarule'
import { useModal } from '/@/components/Modal' import { useModal } from '/@/components/Modal'
import { GetOrgUserTree, GetClientUserPermissions } from './api' import { GetOrgUserTree, GetClientUserPermissions,GetCodeDataRuleList } from './api'
import { BasicTree } from '/@/components/Tree/index' import { BasicTree } from '/@/components/Tree/index'
// import { columns, searchFormSchema } from './columns' // import { columns, searchFormSchema } from './columns'
const treeData = ref([]) const treeData = ref([])
const menuTree = ref([])
onMounted(() => { onMounted(() => {
GetOrgUserTree().then(res => { GetOrgUserTree().then(res => {
treeData.value = res.data treeData.value = res.data
@ -50,9 +51,23 @@ onMounted(() => {
}); });
}) })
}) })
const userId = ref('')
function handleSelect(selectedKeys: any, info: any) { function handleSelect(selectedKeys: any, info: any) {
if (info.node.id) { if (info.node.id) {
userId.value = info.node.value
GetClientUserPermissions({ id: info.node.value }).then(res => { 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=>{
}) })
} }

Loading…
Cancel
Save