From 902b57c18ac0186da11e02717810227b386e01f2 Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Wed, 25 Jun 2025 09:02:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A4=E7=90=86=E5=8D=95=E5=85=83=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Sync/SyncComponent.vue | 151 ++++- src/components/Sync/SyncSimpleComponent.vue | 568 ++++++++++++++++++ src/components/dataAsync/AsyncMainList.vue | 5 +- .../{org.data.ts => directive.data.ts} | 0 src/views/synchronization/directive/index.vue | 7 +- .../nuBaseInfo/NuBaseInfo.api.ts | 96 +++ .../nuBaseInfo/NuBaseInfo.data.ts | 65 ++ .../nuBaseInfo/NuBaseInfoList.vue | 289 +++++++++ .../nuBaseInfo/components/NuBaseInfoForm.vue | 173 ++++++ .../nuBaseInfo/components/NuBaseInfoModal.vue | 82 +++ .../synchronization/nuBaseInfo/index.vue | 296 +++++++++ 11 files changed, 1704 insertions(+), 28 deletions(-) create mode 100644 src/components/Sync/SyncSimpleComponent.vue rename src/views/synchronization/directive/{org.data.ts => directive.data.ts} (100%) create mode 100644 src/views/synchronization/nuBaseInfo/NuBaseInfo.api.ts create mode 100644 src/views/synchronization/nuBaseInfo/NuBaseInfo.data.ts create mode 100644 src/views/synchronization/nuBaseInfo/NuBaseInfoList.vue create mode 100644 src/views/synchronization/nuBaseInfo/components/NuBaseInfoForm.vue create mode 100644 src/views/synchronization/nuBaseInfo/components/NuBaseInfoModal.vue create mode 100644 src/views/synchronization/nuBaseInfo/index.vue diff --git a/src/components/Sync/SyncComponent.vue b/src/components/Sync/SyncComponent.vue index 67eed46..92e5dbc 100644 --- a/src/components/Sync/SyncComponent.vue +++ b/src/components/Sync/SyncComponent.vue @@ -18,7 +18,7 @@ 有筛选条件未重置 - 点击展开更多操作区域 + {{ topTipText }}
@@ -124,21 +124,21 @@ -
- 源数据 - +
+ {{ leftListTipText }} + 全部 已选择 未选择
- + -
+
- 已选择 + {{ rightListTipText }} {{ ' ' + selectedSize + ' ' }} 条 @@ -152,7 +152,8 @@ - + +
@@ -162,20 +163,39 @@ - 同步数据 + {{ syncTipText }} - 全部添加 - - 全部移除 - + 新增 + + 批量新增 + + 全部添加 + + {{ + batchRemoveText + }} + + v-show="showResetDataBtn && tabActiveKey == 'dataAsync'" style="margin-left: 8px"> 还原数据 - + + + 刷新 + + @@ -218,8 +238,66 @@ import AsyncListComponent from '@/components/dataAsync/AsyncMainList.vue' const props = defineProps({ selectedSize: 0, hasSearchConditions: false, + syncType: '',//服务指令:'directive' + platType: '',//只查询对应机构类型的机构 业务机构:ywjg 试验机构:syjg + topTipText: { + type: String, + default: '点击展开更多操作区域' + },//机构信息卡片收起时提示文字 + showSelectedArea: { + type: Boolean, + default: true + },//是否展示全部、已选择、未选择区域 + syncTipText: { + type: String, + default: '同步数据' + },//同步数据按钮文字 + leftListTipText: { + type: String, + default: '源数据' + },//左侧列表提示文字 + rightListTipText: { + type: String, + default: '已选择' + },//右侧列表提示文字 + leftTableML: { + type: String, + default: '15px' + },//左侧列表提示文字margin-left + rightTableML: { + type: String, + default: '4px' + },//右侧列表提示文字margin-left + showAddBtn: { + type: Boolean, + default: false + },//是否展示新增 + showBatchAddBtn: { + type: Boolean, + default: false + },//是否展示批量新增 + showAddAllBtn: { + type: Boolean, + default: true + },//是否展示全部添加 + showRemoveAllBtn: { + type: Boolean, + default: true + },//是否展示全部移除 + showResetDataBtn: { + type: Boolean, + default: true + },//是否展示还原数据 + showReloadBtn: { + type: Boolean, + default: true + },//是否展示刷新数据按钮(非历史数据) + batchRemoveText: { + type: String, + default: '全部移除' + },//全部移除按钮对应文字 }); -const emit = defineEmits(['viewTypeChanged', 'orgChanged', 'handleAsync', 'handleAddAll', 'handleRemoveAll']); +const emit = defineEmits(['viewTypeChanged', 'orgChanged', 'handleAsync', 'handleAdd', 'handleBatchAdd', 'handleReload', 'handleAddAll', 'handleRemoveAll']); interface OrganizationData { id?: string; @@ -332,6 +410,23 @@ const refreshHistory = () => { //源数据查询参数 const viewType = ref('all') +// 新增功能 +const handleAdd = async () => { + if (!orgData.value) { + createMessage.warning("请先选择机构"); + return; + } + emit('handleAdd', null) +}; +// 批量新增功能 +const handleBatchAdd = async () => { + if (!orgData.value) { + createMessage.warning("请先选择机构"); + return; + } + emit('handleBatchAdd', null) +}; + // 全部选择功能 const handleSelectAll = async () => { if (!orgData.value) { @@ -341,6 +436,7 @@ const handleSelectAll = async () => { emit('handleAddAll', null) }; + // 全部移除功能 const handleRemoveAll = () => { Modal.confirm({ @@ -379,12 +475,21 @@ const handleRestore = async () => { }); }; - +//刷新数据(非历史) +const handleReload = () => { + emit('handleReload', null) +} onMounted(() => { - queryDepartTreeSync({ platType: 'ywjg' }).then(res => { - orgTable.value = res; - }); + if (!props.platType) { + queryDepartTreeSync().then(res => { + orgTable.value = res; + }); + } else { + queryDepartTreeSync({ platType: props.platType }).then(res => { + orgTable.value = res; + }); + } }); defineExpose({ diff --git a/src/components/Sync/SyncSimpleComponent.vue b/src/components/Sync/SyncSimpleComponent.vue new file mode 100644 index 0000000..8d4eae0 --- /dev/null +++ b/src/components/Sync/SyncSimpleComponent.vue @@ -0,0 +1,568 @@ + + + + + \ No newline at end of file diff --git a/src/components/dataAsync/AsyncMainList.vue b/src/components/dataAsync/AsyncMainList.vue index 179f348..0cdb674 100644 --- a/src/components/dataAsync/AsyncMainList.vue +++ b/src/components/dataAsync/AsyncMainList.vue @@ -52,7 +52,8 @@ import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Asyn import AsyncMainModal from './components/AsyncMainModal.vue' const props = defineProps({ - orgCode: 'orgCode' + orgCode: 'orgCode', + type:'', }); const queryParam = reactive({}); const registerModal = ref(); @@ -67,7 +68,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ showTableSetting: false, showActionColumn: false, beforeFetch: async (params) => { - queryParam.type = 'directive' + queryParam.type = props.type queryParam.orgCode = props.orgCode return Object.assign(params, queryParam); }, diff --git a/src/views/synchronization/directive/org.data.ts b/src/views/synchronization/directive/directive.data.ts similarity index 100% rename from src/views/synchronization/directive/org.data.ts rename to src/views/synchronization/directive/directive.data.ts diff --git a/src/views/synchronization/directive/index.vue b/src/views/synchronization/directive/index.vue index b531fab..226efea 100644 --- a/src/views/synchronization/directive/index.vue +++ b/src/views/synchronization/directive/index.vue @@ -1,5 +1,6 @@