diff --git a/src/views/iotsync/tq/water/components/BusinessTable.vue b/src/views/iotsync/tq/water/components/BusinessTable.vue index ff5f312..d5deef1 100644 --- a/src/views/iotsync/tq/water/components/BusinessTable.vue +++ b/src/views/iotsync/tq/water/components/BusinessTable.vue @@ -77,7 +77,7 @@ function getTableAction(record) { }); } else { actions.push({ - label: '重新选择', + label: '变更', onClick: () => { toggleSelect(record); } @@ -146,11 +146,15 @@ const updateSelection = (selectedRecords) => { } }; +function reloadData(){ + reload(); +} + // 暴露给父组件的方法 defineExpose({ updateSelection, clearSelected, - reload, + reloadData, allSelectedRows, }); diff --git a/src/views/iotsync/tq/water/components/SelectNuList.vue b/src/views/iotsync/tq/water/components/SelectNuList.vue index 005384b..3f45332 100644 --- a/src/views/iotsync/tq/water/components/SelectNuList.vue +++ b/src/views/iotsync/tq/water/components/SelectNuList.vue @@ -50,10 +50,7 @@ fixed: 'right', }, beforeFetch: async (params) => { - queryParam.delFlag = '0'//查正常数据 - queryParam.izSync = '1'//查未同步数据 // queryParam.orgCode = props.orgCode //查对应机构数据 - queryParam.column = 'nuId' //排序字段 return Object.assign(params, queryParam); }, }, diff --git a/src/views/iotsync/tq/water/components/SelectedTable.vue b/src/views/iotsync/tq/water/components/SelectedTable.vue index 9c3e3fa..6b77acc 100644 --- a/src/views/iotsync/tq/water/components/SelectedTable.vue +++ b/src/views/iotsync/tq/water/components/SelectedTable.vue @@ -81,9 +81,13 @@ const removeSelected = (record) => { emit('removeSelect',record); }; +function reloadData(){ + reload(); +} + // 暴露给父组件的方法 defineExpose({ - reload, + reloadData, allSelectedRows, }); diff --git a/src/views/iotsync/tq/water/components/SourceTable.vue b/src/views/iotsync/tq/water/components/SourceTable.vue index 0c87a7a..8a9a41e 100644 --- a/src/views/iotsync/tq/water/components/SourceTable.vue +++ b/src/views/iotsync/tq/water/components/SourceTable.vue @@ -84,7 +84,7 @@ function getTableAction(record) { } else { let label = '添加'; if(record.nuId){ - label = '重新选择'; + label = '变更'; } actions.push({ label: label, @@ -140,11 +140,16 @@ const updateSelection = (selectedRecords) => { } }; +function reloadData(){ + reload(); +} + + // 暴露给父组件的方法 defineExpose({ updateSelection, clearSelected, - reload, + reloadData, allSelectedRows, }); diff --git a/src/views/iotsync/tq/water/index.vue b/src/views/iotsync/tq/water/index.vue index 59e6282..bbcc52e 100644 --- a/src/views/iotsync/tq/water/index.vue +++ b/src/views/iotsync/tq/water/index.vue @@ -9,7 +9,7 @@ - + 源数据 已同步 @@ -22,7 +22,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -38,7 +38,16 @@ - + + + + + 正常 + 作废 + + + + 查询 @@ -80,7 +89,7 @@ 已同步
- 重新选择 + 调整 移除
@@ -160,9 +169,9 @@ const wrapperCol = reactive({ xs: 24, sm: 20, }); -const queryParam = ref()//源数据查询参数 -const sourceParam = ref({viewType: 'unselected',departServerUrl:''})//源数据查询参数 -const businessParam = ref({departServerUrl:''})//源数据查询参数 +const queryParam = ref({status: '0'})//源数据查询参数 +const sourceParam = ref({viewType: 'unselected',departServerUrl:'',status: '0'})//源数据查询参数 +const businessParam = ref({departServerUrl:'',status: '0'})//源数据查询参数 const sourceComRef = ref(); const selectedComRef = ref(); const businessComRef = ref(); @@ -192,9 +201,9 @@ const orgChanged = async (org) => { //清空当前选择 allSelectedItems.value.clear(); //清空查询条件 - queryParam.value = {}; + queryParam.value = {status: '0'}; //源数据 - sourceParam.value = { viewType: 'unselected',departServerUrl:org.orgCode}; + sourceParam.value = { viewType: 'unselected',departServerUrl:org.orgCode,status: '0'}; //已选择 businessParam.value = {departServerUrl: org.orgCode}; // 切换视图 @@ -204,7 +213,7 @@ const orgChanged = async (org) => { } /** - * 机构重新选择 + * 机构变更 */ const orgReset = async (org) => { showDevices.value = false; @@ -218,24 +227,28 @@ function searchQuery() { sourceParam.value.address = queryParam.value.address; sourceParam.value.departId = queryParam.value.departId; sourceParam.value.nuId = queryParam.value.nuId; - sourceComRef.value.reload(); + sourceParam.value.status = queryParam.value.status; + sourceComRef.value.reloadData(); }else{ businessParam.value.address = queryParam.value.address; businessParam.value.departId = queryParam.value.departId; businessParam.value.nuId = queryParam.value.nuId; - businessComRef.value.reload(); + businessParam.value.status = queryParam.value.status; + businessComRef.value.reloadData(); } } function searchReset() { - queryParam.value = {}; + queryParam.value = { + status: '0' + }; if(dataType.value=='source'){ let vt = sourceParam.value.viewType; let dsu = sourceParam.value.departServerUrl; - sourceParam.value = { viewType: vt,departServerUrl:dsu }; + sourceParam.value = { viewType: vt,departServerUrl:dsu,status: '0' }; }else{ let dsu = businessParam.value.departServerUrl; - businessParam.value = { departServerUrl: dsu }; + businessParam.value = { departServerUrl: dsu,status: '0' }; } } @@ -266,7 +279,7 @@ const splitScreenChanged = (val) => { const dataTypeChanged = (value) => { if(value=='source'){ if(viewType.value=='selected'){ - sourceButtonText.value = '重新选择'; + sourceButtonText.value = '变更'; const departServerUrl = sourceParam.value.departServerUrl; getDepartList({dataType:'source',departServerUrl:departServerUrl}); getNuList({dataType:'source',departServerUrl:departServerUrl}); @@ -285,7 +298,7 @@ const viewTypeChanged = (value) => { sourceParam.value.viewType = value if(value=='selected'){ const departServerUrl = sourceParam.value.departServerUrl; - sourceButtonText.value = '重新选择'; + sourceButtonText.value = '变更'; getDepartList({dataType:'source',departServerUrl:departServerUrl}); getNuList({dataType:'source',departServerUrl:departServerUrl}); } @@ -426,7 +439,7 @@ function selectNuHandleSuccess(nuInfo){ } let item = {}; item["address"] = record.address; - item["actionType"] = '修改'; + item["actionType"] = '调整'; item["dataType"] = 'business'; item["dataTypeText"] = '已同步区'; item["nuId"] = nuInfo.nuId; @@ -446,7 +459,6 @@ function selectNuHandleSuccess(nuInfo){ } function selectNuHandleCancel(nuInfo){ - console.log(nuInfo); if(nuInfo.type == 'source'){ updateSourceSelection(); }else{ @@ -480,9 +492,9 @@ function handleReload(){ //同步 async function handleAsync(){ const arr = Array.from(allSelectedItems.value.values()) - console.log(arr); - const res = await syncDevicesApi(arr); - console.log(res); + await syncDevicesApi(arr); + sourceComRef.value.reloadData(); + businessComRef.value.reloadData(); handleReload(); } diff --git a/src/views/iotsync/tq/water/water.api.ts b/src/views/iotsync/tq/water/water.api.ts index 259cdc1..8f75049 100644 --- a/src/views/iotsync/tq/water/water.api.ts +++ b/src/views/iotsync/tq/water/water.api.ts @@ -5,7 +5,7 @@ enum Api { departList = '/iot/tq/waterMeter/departList', nuList = '/iot/tq/waterMeter/nuList', businessList = '/iot/tq/waterMeter/businessList', - nuSyncList = '/admin/nuBaseInfo/nuBaseInfo/list', + nuSyncList = '/iot/tq/waterMeter/nuSyncList', syncDevices = '/iot/tq/waterMeter/syncDevices', syncLogList = '/iot/tq/waterMeter/syncLogList', } diff --git a/src/views/iotsync/tq/water/water.data.ts b/src/views/iotsync/tq/water/water.data.ts index 58c1613..737e977 100644 --- a/src/views/iotsync/tq/water/water.data.ts +++ b/src/views/iotsync/tq/water/water.data.ts @@ -137,6 +137,11 @@ export const nusColumns: BasicColumn[] = [ align: "center", dataIndex: 'areaFlag_dictText', resizable: true, + }, + { + title: '绑定设备数量', + align: "center", + dataIndex: 'deviceNum' } ]; @@ -221,6 +226,11 @@ export const asyncSeedColumns: BasicColumn[] = [ align: "center", dataIndex: 'syncType', }, + { + title: '同步状态', + align: "center", + dataIndex: 'status', + }, { title: '同步时间', align: "center",