From f3ce9bf8c898aadbf87b819530c76f5aa26a8027 Mon Sep 17 00:00:00 2001 From: sunzehua Date: Fri, 13 Sep 2024 18:54:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TenantAuditStepModal.vue | 33 ++++++++++++------- .../system/CodeDataRuleTemplate/columns.tsx | 18 ++++------ src/views/taskmanage/index.vue | 14 ++++---- src/views/taskmanage/taskList/data.json | 9 +++-- src/views/taskmanage/taskList/taskCustom.vue | 25 ++++++++++---- 5 files changed, 60 insertions(+), 39 deletions(-) diff --git a/src/views/system/CodeDataRuleTemplate/TenantAuditStepModal.vue b/src/views/system/CodeDataRuleTemplate/TenantAuditStepModal.vue index a718d7b1..8eaf575d 100644 --- a/src/views/system/CodeDataRuleTemplate/TenantAuditStepModal.vue +++ b/src/views/system/CodeDataRuleTemplate/TenantAuditStepModal.vue @@ -4,15 +4,17 @@
权限规则
-
+
本人 本部门 本公司 - + {{ item.label }} - + {{ item.label }} @@ -44,7 +46,7 @@ import { BasicForm, useForm } from '/@/components/Form/index' import { getDictOption } from '/@/utils/dictUtil' import { getColumns, getClientPermissionList } from '/@/api/system/role' import { - getOrgList,GetUserList + getOrgList, GetUserList } from '/@/api/common' import columnView from './columnView.vue' // 字段数据 @@ -64,9 +66,12 @@ onMounted(() => { columnViewData.value.push({ label: item.description, value: item.description, - ...item, + ...item }) }) + setTimeout(() => { + columnViewData.value = uniqueObjectsByProperty(columnViewData.value, 'label'); + }) } }) getOrgList().then(res => { @@ -193,6 +198,10 @@ const formSchema = [ componentProps: (e) => { return { options: columnViewData.value, + showSearch: true, + onfilterOption: (input: string, option: any) => { + return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, getPopupContainer: () => document.body, onChange: (val: any) => { let tableViewName = '' @@ -204,12 +213,6 @@ const formSchema = [ }) } }) - // console.log(formActionType) - // const res: any = getColumns({ tableViewName }) - // if (res.succeeded) { - // console.log(res.data) - // formActionType ? formActionType.linkageForm(res.data) : null - // } }, } }, @@ -276,6 +279,14 @@ function handleCopySelectUser(val) { document.execCommand('copy'); document.body.removeChild(cInput); } +function uniqueObjectsByProperty(array, property) { + const seen = new Set(); + return array.filter(item => { + const key = JSON.stringify(item[property]); + return !seen.has(key) && seen.add(key); + }); +} + // 声明Emits const emit = defineEmits(['success', 'register']) const isUpdate = ref(true) diff --git a/src/views/system/CodeDataRuleTemplate/columns.tsx b/src/views/system/CodeDataRuleTemplate/columns.tsx index 6ad93b04..92ec471f 100644 --- a/src/views/system/CodeDataRuleTemplate/columns.tsx +++ b/src/views/system/CodeDataRuleTemplate/columns.tsx @@ -5,17 +5,7 @@ import { getColumns, getClientPermissionList } from '/@/api/system/role' import { Tag } from 'ant-design-vue' // 引入字典数据 import { getDictOption } from '/@/utils/dictUtil' -const columnViewData: any = [] -const res: API.DataResult = await getTablesByClient() -if (res.succeeded) { - res.data.forEach((item) => { - columnViewData.push({ - label: item.description, - value: item.description, - ...item, - }) - }) -} + // 下拉框数据接口 import { GetClientListByCode } from '/@/api/common' export const columns: BasicColumn[] = [ @@ -89,5 +79,11 @@ export const searchFormSchema: FormSchema[] = [ component: 'Input', colProps: { span: 6 }, }, + { + field: 'columnView', + label: '中文视图名', + component: 'Input', + colProps: { span: 6 }, + }, ] diff --git a/src/views/taskmanage/index.vue b/src/views/taskmanage/index.vue index 8767688f..8ce735b7 100644 --- a/src/views/taskmanage/index.vue +++ b/src/views/taskmanage/index.vue @@ -95,9 +95,6 @@ 任务转交 - 任务自定义列