diff --git a/gradle.properties b/gradle.properties
index 9fe43cd3..9da6da06 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -36,9 +36,9 @@ application_version=1.0.0
# platform
###########################################################
platform_group=io.sc
-platform_version=8.1.25
+platform_version=8.1.26
platform_plugin_version=8.1.13
-platform_core_frontend_version=8.1.136
+platform_core_frontend_version=8.1.137
###########################################################
# dependencies version
diff --git a/io.sc.platform.core.frontend/package.json b/io.sc.platform.core.frontend/package.json
index 66e009e1..45e77bd5 100644
--- a/io.sc.platform.core.frontend/package.json
+++ b/io.sc.platform.core.frontend/package.json
@@ -1,6 +1,6 @@
{
"name": "platform-core",
- "version": "8.1.136",
+ "version": "8.1.137",
"description": "前端核心包,用于快速构建前端的脚手架",
"//main": "库的主文件",
"main": "dist/platform-core.js",
diff --git a/io.sc.platform.core.frontend/src/platform/components/index.ts b/io.sc.platform.core.frontend/src/platform/components/index.ts
index 5a48e5b1..594c401b 100644
--- a/io.sc.platform.core.frontend/src/platform/components/index.ts
+++ b/io.sc.platform.core.frontend/src/platform/components/index.ts
@@ -33,6 +33,7 @@ import WVExpandDiv from './layout/WVExpandDiv.vue';
import WInfoPanel from './panel/WInfoPanel.vue';
import WProgress from './progress/WProgress.vue';
+import WProgressBtn from './progress/WProgressBtn.vue';
import WEnableTag from './tag/WEnableTag.vue';
import WSuccessFailedTag from './tag/WSuccessFailedTag.vue';
@@ -76,6 +77,7 @@ export default {
app.component('WInfoPanel', WInfoPanel);
app.component('WProgress', WProgress);
+ app.component('WProgressBtn', WProgressBtn);
app.component('WEnableTag', WEnableTag);
app.component('WSuccessFailedTag', WSuccessFailedTag);
@@ -112,6 +114,7 @@ export {
WVExpandDiv,
WInfoPanel,
WProgress,
+ WProgressBtn,
WEnableTag,
WSuccessFailedTag,
WToolbar,
diff --git a/io.sc.platform.core.frontend/src/platform/components/progress/WProgress.vue b/io.sc.platform.core.frontend/src/platform/components/progress/WProgress.vue
index 3677c7c5..b5fee8cf 100644
--- a/io.sc.platform.core.frontend/src/platform/components/progress/WProgress.vue
+++ b/io.sc.platform.core.frontend/src/platform/components/progress/WProgress.vue
@@ -15,7 +15,7 @@ const props = defineProps({
const attrs = useAttrs();
const showRef = ref(false);
-const percentageRef = ref(0.2);
+const percentageRef = ref(0);
const messageRef = ref('');
let executeProgressInterval;
@@ -23,37 +23,48 @@ const refreshProgress = () => {
axios
.get(Environment.apiContextPath(props.dataUrl))
.then((response) => {
- const progressInfo = response.data;
- percentageRef.value = progressInfo.currentWeight / progressInfo.totalWeight;
- messageRef.value = progressInfo.messageKey;
- if (percentageRef.value >= 1) {
- clearInterval(executeProgressInterval);
- showRef.value = false;
+ if (response?.data?.running) {
+ const progressInfo = response.data;
+ percentageRef.value = progressInfo.currentWeight / progressInfo.totalWeight;
+ messageRef.value = progressInfo.messageKey;
+ if (percentageRef.value >= 1) {
+ stop();
+ }
+ } else {
+ stop();
}
})
.catch(() => {
- clearInterval(executeProgressInterval);
- showRef.value = false;
+ stop();
});
};
const start = () => {
showRef.value = true;
+ percentageRef.value = 0;
executeProgressInterval = setInterval(refreshProgress, props.interval);
};
+const stop = () => {
+ clearInterval(executeProgressInterval);
+ showRef.value = false;
+};
+
onMounted(() => {
axios
.get(Environment.apiContextPath(props.dataUrl))
.then((response) => {
- start();
+ if (response?.data?.running) {
+ start();
+ }
})
.catch(() => {
- showRef.value = false;
+ stop();
});
});
defineExpose({
start,
+ stop,
});
diff --git a/io.sc.platform.core.frontend/src/platform/components/progress/WProgressBtn.vue b/io.sc.platform.core.frontend/src/platform/components/progress/WProgressBtn.vue
new file mode 100644
index 00000000..fdae1dca
--- /dev/null
+++ b/io.sc.platform.core.frontend/src/platform/components/progress/WProgressBtn.vue
@@ -0,0 +1,76 @@
+
+