From c76eabc8a1bf1435ab417900208c93a7b68ab727 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Thu, 25 Sep 2025 16:10:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=A7=92=E8=89=B2=E7=AD=9B?= =?UTF-8?q?=E9=80=89v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/assembly/index.ts | 1 + .../DesignForm/formControlPropertiNew.vue | 183 ++++++++++++++++-- 2 files changed, 164 insertions(+), 20 deletions(-) diff --git a/src/components/DesignForm/assembly/index.ts b/src/components/DesignForm/assembly/index.ts index 31d0c4c..ced14d3 100644 --- a/src/components/DesignForm/assembly/index.ts +++ b/src/components/DesignForm/assembly/index.ts @@ -1046,6 +1046,7 @@ export default [ modelValue: '', orgRange:[], roleRange:[], + roleCheckDataList:[], queryBy:'org', }, config: {}, // 其他配置信息 diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 8918bfa..e6dcc15 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -4060,7 +4060,7 @@ watch( } ); -//选择用户数据范围 +//选择用户数据范围 start const tabsRef = ref(null); const userRangeDialogFlag = ref(false) function handleUserRangeDialogFlag(){ @@ -4082,7 +4082,6 @@ function reRenderComponent() { } function handleExpandTabChange(){ - console.log("切换页签") if(controlData.value.control.queryBy=='role'){ queryAllRole() } @@ -4114,24 +4113,30 @@ function queryAllRole(){ }) } - +const expandPageNum = ref(1) function getPersonByRoleId(id:string){ return request({ url: "/javasys/lowCode/manCont/getPersonByRoleId", method: "post", data: { id: id, + pageNum: expandPageNum.value, + pageSize: '10', + number:expandQueryParamNumber.value, + name:expandQueryParamName.value }, }); } //const activeName = ref('1') +const total = ref(10) const activeTab = ref('') const expandTableData = ref() + function handleLeftTabChange(tab: any){ getPersonByRoleId(tab).then(({ data }) => { //console.log(data) - expandTableData.value = data - + expandTableData.value = data.list + total.value = data.total //activeName.value = tab }); @@ -4144,14 +4149,113 @@ const multipleSelection = ref([]) interface User { id: number name: string + number: string + key: string + } const handleSelectionChange = (val: User[]) => { - console.log(1111) + multipleSelection.value = val + +} +/* controlData.value.control.roleRange = computed(()=>{ + let arr: any[] = [] + checkDataList.value.forEach(element => { + let str = element.key+"" + arr.push(str) + }); + + + return arr +}) */ + +function gotoRight(){ + // 遍历multipleSelection中的每个用户 + multipleSelection.value.forEach(user => { + // 检查checkDataList中是否已存在具有相同key的用户 + const exists = controlData.value.control.roleCheckDataList.some((item: { key: string; }) => item.key === user.key); + + // 如果不存在,则添加到checkDataList中 + if (!exists) { + controlData.value.control.roleCheckDataList.push(user); + } + }); + + let arr: any[] = [] + controlData.value.control.roleCheckDataList.forEach((element: { key: string; }) => { + let str = element.key+"" + arr.push(str) + }); + console.log(arr) + controlData.value.control.roleRange = arr +} + +function handleCurrentChange(){ + //alert(expandPageNum.value) + handleLeftTabChange(activeTab.value) +} +const expandQueryParam = ref('') + +function isAllDigits(str:any) { + // 首先检查输入是否为字符串类型 + if (typeof str !== 'string') { + return false; + } + + // 检查字符串是否为空 + if (str.length === 0) { + return false; + } + + // 使用正则表达式检查是否全为数字 + // ^ 表示字符串开始,$ 表示字符串结束 + // \d+ 表示一个或多个数字 + const regex = /^\d+$/; + return regex.test(str); +} +const expandQueryParamNumber = ref('') +const expandQueryParamName = ref('') +function searchClick(){ + expandQueryParamNumber.value = '' + expandQueryParamName.value = '' + if(isAllDigits(expandQueryParam.value)){ + expandQueryParamNumber.value = expandQueryParam.value + }else{ + expandQueryParamName.value = expandQueryParam.value + } + handleLeftTabChange(activeTab.value) + +} + +function resetClick(){ + expandQueryParamNumber.value = '' + expandQueryParamName.value = '' + handleLeftTabChange(activeTab.value) } +function delRowClick(param: any){ + let key = param.key + console.log(key) + controlData.value.control.roleCheckDataList = controlData.value.control.roleCheckDataList.filter((item: { key: any; }) => item.key !== key); + let arr: any[] = [] + controlData.value.control.roleCheckDataList.forEach((element: { key: string; }) => { + let str = element.key+"" + arr.push(str) + }); + console.log(arr) + controlData.value.control.roleRange = arr +} + + +function delAllClick(){ + controlData.value.control.roleCheckDataList = [] + controlData.value.control.roleRange = [] +} + +//选择用户数据范围 end + /** @ 作者: 秦东 @ 时间: 2024-12-23 10:39:48 @@ -4588,11 +4692,7 @@ const aiAgentList = ref([ - - {{controlData.control.orgRange}} - {{controlData.control.roleRange}} 可选用户设置 - @@ -5756,15 +5856,15 @@ const aiAgentList = ref([ > - +
- - + +
- + 查询 重置
- + - + - + + +
@@ -5813,12 +5915,50 @@ const aiAgentList = ref([ - + - {{multipleSelection}} +
+
+
已选择:{{ controlData.control.roleCheckDataList.length }}
+ 全部移除 +
+ + + + + + + + + +
+ +
+ +
+ +
@@ -5826,7 +5966,10 @@ const aiAgentList = ref([
- +
+ +
+