添加查看进度刷新按钮
Showing
1 changed file
with
25 additions
and
4 deletions
| ... | @@ -75,6 +75,7 @@ | ... | @@ -75,6 +75,7 @@ |
| 75 | changeNum(dicomStatisticsData.total, 0) + '个文件' }}</span><span v-show="dicomStatisticsData.remainingTime" class="desc">{{ '剩' + | 75 | changeNum(dicomStatisticsData.total, 0) + '个文件' }}</span><span v-show="dicomStatisticsData.remainingTime" class="desc">{{ '剩' + |
| 76 | transferTime(dicomStatisticsData.remainingTime) | 76 | transferTime(dicomStatisticsData.remainingTime) |
| 77 | }}</span></div> | 77 | }}</span></div> |
| 78 | <div style="display: flex;justify-content: center;margin-top: 4px;"><el-button :icon="RefreshRight" link @click="refreshFolderResult" v-preReClick>刷新进度</el-button></div> | ||
| 78 | </div> | 79 | </div> |
| 79 | <!-- 正在解析的状态 --> | 80 | <!-- 正在解析的状态 --> |
| 80 | <div class="folder-progress" | 81 | <div class="folder-progress" |
| ... | @@ -88,6 +89,7 @@ | ... | @@ -88,6 +89,7 @@ |
| 88 | + (!dicomStatisticsData.progress ? 0 : changeNum(dicomStatisticsData.progress, 2)) + '%' }}</span><span v-show="dicomStatisticsData.remainingTime" class="desc">{{ '剩' + | 89 | + (!dicomStatisticsData.progress ? 0 : changeNum(dicomStatisticsData.progress, 2)) + '%' }}</span><span v-show="dicomStatisticsData.remainingTime" class="desc">{{ '剩' + |
| 89 | transferTime(dicomStatisticsData.remainingTime) | 90 | transferTime(dicomStatisticsData.remainingTime) |
| 90 | }}</span></div> | 91 | }}</span></div> |
| 92 | <div style="display: flex;justify-content: center;margin-top: 4px;"><el-button :icon="RefreshRight" link @click="refreshFolderResult" v-preReClick>刷新进度</el-button></div> | ||
| 91 | </div> | 93 | </div> |
| 92 | <!-- 解析失败的状态 --> | 94 | <!-- 解析失败的状态 --> |
| 93 | <div class="folder-progress" v-show="clickSelectNode.path && dicomStatisticsData.state == 'E'"> | 95 | <div class="folder-progress" v-show="clickSelectNode.path && dicomStatisticsData.state == 'E'"> |
| ... | @@ -1016,12 +1018,12 @@ const uploadFileDialogInfo = ref({ | ... | @@ -1016,12 +1018,12 @@ const uploadFileDialogInfo = ref({ |
| 1016 | 1018 | ||
| 1017 | const folderRefreshTimer = ref(); | 1019 | const folderRefreshTimer = ref(); |
| 1018 | 1020 | ||
| 1019 | const processFolderRefresh = async () => { | 1021 | const processFolderRefresh = async (isRefresh = false) => { |
| 1020 | // 组件已卸载时不再执行 | 1022 | // 组件已卸载时不再执行 |
| 1021 | if (!containerRef.value) { | 1023 | if (!containerRef.value) { |
| 1022 | return; | 1024 | return; |
| 1023 | } | 1025 | } |
| 1024 | await getDicomStatisticsData(taskGuid.value); | 1026 | await getDicomStatisticsData(taskGuid.value, isRefresh); |
| 1025 | if (!dicomStatisticsData.value.state || dicomStatisticsData.value.state == 'S' || dicomStatisticsData.value.state == 'R') { | 1027 | if (!dicomStatisticsData.value.state || dicomStatisticsData.value.state == 'S' || dicomStatisticsData.value.state == 'R') { |
| 1026 | if (folderRefreshTimer.value) { | 1028 | if (folderRefreshTimer.value) { |
| 1027 | return; | 1029 | return; |
| ... | @@ -1045,6 +1047,18 @@ const processFolderRefresh = async () => { | ... | @@ -1045,6 +1047,18 @@ const processFolderRefresh = async () => { |
| 1045 | } | 1047 | } |
| 1046 | } | 1048 | } |
| 1047 | 1049 | ||
| 1050 | /** 随时点击刷新查看结果。 */ | ||
| 1051 | const refreshFolderResult = () => { | ||
| 1052 | if (getFolderResultPromise.value) { | ||
| 1053 | return; | ||
| 1054 | } | ||
| 1055 | if (folderRefreshTimer.value) { | ||
| 1056 | clearInterval(folderRefreshTimer.value); | ||
| 1057 | folderRefreshTimer.value = null; | ||
| 1058 | } | ||
| 1059 | processFolderRefresh(true); | ||
| 1060 | } | ||
| 1061 | |||
| 1048 | // TODO,需要将selectNode与oldSelectNode即对话框展开的做区分处理。 | 1062 | // TODO,需要将selectNode与oldSelectNode即对话框展开的做区分处理。 |
| 1049 | 1063 | ||
| 1050 | const dialogBtnClick = (btn) => { | 1064 | const dialogBtnClick = (btn) => { |
| ... | @@ -1270,15 +1284,22 @@ const getDicomMetaData = (taskGuid) => { | ... | @@ -1270,15 +1284,22 @@ const getDicomMetaData = (taskGuid) => { |
| 1270 | 1284 | ||
| 1271 | const dicomStatisticsData: any = ref({}); | 1285 | const dicomStatisticsData: any = ref({}); |
| 1272 | 1286 | ||
| 1287 | const getFolderResultPromise: any = ref(null); | ||
| 1288 | |||
| 1273 | /** 获取解析文件结果数据 */ | 1289 | /** 获取解析文件结果数据 */ |
| 1274 | const getDicomStatisticsData = (taskGuid) => { | 1290 | const getDicomStatisticsData = (taskGuid, isRefresh = false) => { |
| 1275 | return getDicomStatistics(taskGuid).then((res: any) => { | 1291 | getFolderResultPromise.value = getDicomStatistics(taskGuid).then((res: any) => { |
| 1292 | getFolderResultPromise.value = null; | ||
| 1276 | if (res?.code == proxy.$passCode) { | 1293 | if (res?.code == proxy.$passCode) { |
| 1294 | if (isRefresh) { | ||
| 1295 | proxy.$ElMessage.success('刷新成功'); | ||
| 1296 | } | ||
| 1277 | dicomStatisticsData.value = res.data || {}; | 1297 | dicomStatisticsData.value = res.data || {}; |
| 1278 | } else { | 1298 | } else { |
| 1279 | res?.msg && proxy.$ElMessage.error(res.msg); | 1299 | res?.msg && proxy.$ElMessage.error(res.msg); |
| 1280 | } | 1300 | } |
| 1281 | }) | 1301 | }) |
| 1302 | return getFolderResultPromise.value; | ||
| 1282 | } | 1303 | } |
| 1283 | 1304 | ||
| 1284 | /** 将时间转换为时分秒 */ | 1305 | /** 将时间转换为时分秒 */ | ... | ... |
-
Please register or sign in to post a comment