diff --git a/src/components/DesignForm/assembly/index.ts b/src/components/DesignForm/assembly/index.ts index 8ce24d1..31d0c4c 100644 --- a/src/components/DesignForm/assembly/index.ts +++ b/src/components/DesignForm/assembly/index.ts @@ -1044,8 +1044,9 @@ export default [ control: { // 组件所有属性 modelValue: '', - range:[], - queryBy:'org' + orgRange:[], + roleRange:[], + queryBy:'org', }, config: {}, // 其他配置信息 styles: { diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index c522f0b..8918bfa 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -315,7 +315,7 @@ const attrList = computed(() => { // console.log("判断校验规则--->", item); if (typeof controlData.value.customRules == "object") { if (Array.isArray(controlData.value.customRules)) { - let otherPick = []; + let otherPick: any[] = []; controlData.value.customRules.forEach((item: any) => { // console.log("判断校验规则-1-->", item); if (item.type == ValidateText.type) { @@ -2786,13 +2786,13 @@ function removeTreeNode(tree: any, targetId: any) { const clonedTree = JSON.parse(JSON.stringify(tree)); // 递归处理节点 - function processNode(node) { + function processNode(node: { id: any; children: any[]; }) { // 命中目标节点时返回null进行过滤 if (node.id === targetId) return null; // 递归处理子节点并过滤空值 if (node.children?.length) { - node.children = node.children.map((child) => processNode(child)).filter(Boolean); + node.children = node.children.map((child: any) => processNode(child)).filter(Boolean); } return node; @@ -4061,15 +4061,18 @@ watch( ); //选择用户数据范围 - +const tabsRef = ref(null); const userRangeDialogFlag = ref(false) function handleUserRangeDialogFlag(){ userRangeDialogFlag.value = true + if(controlData.value.control.queryBy=='role'){ + queryAllRole() + } } function checkedIdListChangedIndex(val:any){ //console.log(val) - controlData.value.control.range = val + controlData.value.control.orgRange = val } let componentKey = 0 @@ -4079,10 +4082,74 @@ function reRenderComponent() { } function handleExpandTabChange(){ - controlData.value.control.range = [] + console.log("切换页签") + if(controlData.value.control.queryBy=='role'){ + queryAllRole() + } +} + + +function getAllRole() { + return request({ + url: "/javasys/lowCode/manCont/getAllRole", + method: "get", + }); +} +const tabsData = ref([]) +function queryAllRole(){ + getAllRole().then(({ data }) => { + //console.log(data) + tabsData.value = data + + + }).finally(()=>{ + //activeName.value = tabsData.value[2]?.name + setTimeout(()=>{ + activeTab.value = tabsData.value[0]?.id + //alert(tabsData.value[0]?.id) + //activeName.value = tabsData.value[0]?.id + handleLeftTabChange(activeTab.value) + },500) + + }) + } +function getPersonByRoleId(id:string){ + return request({ + url: "/javasys/lowCode/manCont/getPersonByRoleId", + method: "post", + data: { + id: id, + }, + }); +} +//const activeName = ref('1') +const activeTab = ref('') +const expandTableData = ref() +function handleLeftTabChange(tab: any){ + getPersonByRoleId(tab).then(({ data }) => { + //console.log(data) + expandTableData.value = data + + //activeName.value = tab + + }); +} +import type { TableInstance } from 'element-plus' +const multipleTableRef = ref() +const multipleSelection = ref([]) + +interface User { + id: number + name: string +} + +const handleSelectionChange = (val: User[]) => { + console.log(1111) + multipleSelection.value = val +} /** @@ -4522,7 +4589,8 @@ const aiAgentList = ref([ - {{controlData.control.range}} + {{controlData.control.orgRange}} + {{controlData.control.roleRange}} 可选用户设置 @@ -5684,29 +5752,95 @@ const aiAgentList = ref([ - - - - - + + -
- 根据角色筛选 +
+ + + + + +
+ + 查询 + 重置 +
+
+ + + + + + + + + + + + + +
+
+ +
+ +
+ +
+
+ + + + + {{multipleSelection}} + +
+ +
+ + + + -
- - 确定 - -
+ + +