添加查看进度刷新按钮
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'"> |
| ... | @@ -1009,12 +1011,12 @@ const uploadFileDialogInfo = ref({ | ... | @@ -1009,12 +1011,12 @@ const uploadFileDialogInfo = ref({ |
| 1009 | 1011 | ||
| 1010 | const folderRefreshTimer = ref(); | 1012 | const folderRefreshTimer = ref(); |
| 1011 | 1013 | ||
| 1012 | const processFolderRefresh = async () => { | 1014 | const processFolderRefresh = async (isRefresh = false) => { |
| 1013 | // 组件已卸载时不再执行 | 1015 | // 组件已卸载时不再执行 |
| 1014 | if (!containerRef.value) { | 1016 | if (!containerRef.value) { |
| 1015 | return; | 1017 | return; |
| 1016 | } | 1018 | } |
| 1017 | await getDicomStatisticsData(taskGuid.value); | 1019 | await getDicomStatisticsData(taskGuid.value, isRefresh); |
| 1018 | if (!dicomStatisticsData.value.state || dicomStatisticsData.value.state == 'S' || dicomStatisticsData.value.state == 'R') { | 1020 | if (!dicomStatisticsData.value.state || dicomStatisticsData.value.state == 'S' || dicomStatisticsData.value.state == 'R') { |
| 1019 | if (folderRefreshTimer.value) { | 1021 | if (folderRefreshTimer.value) { |
| 1020 | return; | 1022 | return; |
| ... | @@ -1038,6 +1040,18 @@ const processFolderRefresh = async () => { | ... | @@ -1038,6 +1040,18 @@ const processFolderRefresh = async () => { |
| 1038 | } | 1040 | } |
| 1039 | } | 1041 | } |
| 1040 | 1042 | ||
| 1043 | /** 随时点击刷新查看结果。 */ | ||
| 1044 | const refreshFolderResult = () => { | ||
| 1045 | if (getFolderResultPromise.value) { | ||
| 1046 | return; | ||
| 1047 | } | ||
| 1048 | if (folderRefreshTimer.value) { | ||
| 1049 | clearInterval(folderRefreshTimer.value); | ||
| 1050 | folderRefreshTimer.value = null; | ||
| 1051 | } | ||
| 1052 | processFolderRefresh(true); | ||
| 1053 | } | ||
| 1054 | |||
| 1041 | // TODO,需要将selectNode与oldSelectNode即对话框展开的做区分处理。 | 1055 | // TODO,需要将selectNode与oldSelectNode即对话框展开的做区分处理。 |
| 1042 | 1056 | ||
| 1043 | const dialogBtnClick = (btn) => { | 1057 | const dialogBtnClick = (btn) => { |
| ... | @@ -1263,15 +1277,22 @@ const getDicomMetaData = (taskGuid) => { | ... | @@ -1263,15 +1277,22 @@ const getDicomMetaData = (taskGuid) => { |
| 1263 | 1277 | ||
| 1264 | const dicomStatisticsData: any = ref({}); | 1278 | const dicomStatisticsData: any = ref({}); |
| 1265 | 1279 | ||
| 1280 | const getFolderResultPromise: any = ref(null); | ||
| 1281 | |||
| 1266 | /** 获取解析文件结果数据 */ | 1282 | /** 获取解析文件结果数据 */ |
| 1267 | const getDicomStatisticsData = (taskGuid) => { | 1283 | const getDicomStatisticsData = (taskGuid, isRefresh = false) => { |
| 1268 | return getDicomStatistics(taskGuid).then((res: any) => { | 1284 | getFolderResultPromise.value = getDicomStatistics(taskGuid).then((res: any) => { |
| 1285 | getFolderResultPromise.value = null; | ||
| 1269 | if (res?.code == proxy.$passCode) { | 1286 | if (res?.code == proxy.$passCode) { |
| 1287 | if (isRefresh) { | ||
| 1288 | proxy.$ElMessage.success('刷新成功'); | ||
| 1289 | } | ||
| 1270 | dicomStatisticsData.value = res.data || {}; | 1290 | dicomStatisticsData.value = res.data || {}; |
| 1271 | } else { | 1291 | } else { |
| 1272 | res?.msg && proxy.$ElMessage.error(res.msg); | 1292 | res?.msg && proxy.$ElMessage.error(res.msg); |
| 1273 | } | 1293 | } |
| 1274 | }) | 1294 | }) |
| 1295 | return getFolderResultPromise.value; | ||
| 1275 | } | 1296 | } |
| 1276 | 1297 | ||
| 1277 | /** 将时间转换为时分秒 */ | 1298 | /** 将时间转换为时分秒 */ | ... | ... |
-
Please register or sign in to post a comment