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 @@ + + diff --git a/io.sc.platform.core.frontend/src/platform/index.ts b/io.sc.platform.core.frontend/src/platform/index.ts index c7bd4ebe..fbe34dd8 100644 --- a/io.sc.platform.core.frontend/src/platform/index.ts +++ b/io.sc.platform.core.frontend/src/platform/index.ts @@ -135,6 +135,7 @@ export { WVExpandDiv, WInfoPanel, WProgress, + WProgressBtn, WEnableTag, WSuccessFailedTag, WToolbar, diff --git a/io.sc.platform.core.frontend/template-project/package.json b/io.sc.platform.core.frontend/template-project/package.json index 3b215102..289039ad 100644 --- a/io.sc.platform.core.frontend/template-project/package.json +++ b/io.sc.platform.core.frontend/template-project/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.1.134", + "version": "8.1.137", "description": "前端核心包,用于快速构建前端的脚手架", "private": false, "keywords": [], @@ -92,7 +92,7 @@ "luckyexcel": "1.0.1", "mockjs": "1.1.0", "pinia": "2.1.7", - "platform-core": "8.1.134", + "platform-core": "8.1.137", "quasar": "2.14.5", "tailwindcss": "3.4.0", "vue": "3.4.3", diff --git a/io.sc.platform.core.frontend/template-project/src/views/FormElements.vue b/io.sc.platform.core.frontend/template-project/src/views/FormElements.vue index 56c12f65..ca17b66a 100644 --- a/io.sc.platform.core.frontend/template-project/src/views/FormElements.vue +++ b/io.sc.platform.core.frontend/template-project/src/views/FormElements.vue @@ -39,6 +39,7 @@ + diff --git a/io.sc.platform.developer.frontend/package.json b/io.sc.platform.developer.frontend/package.json index e67e58e3..966ddc4a 100644 --- a/io.sc.platform.developer.frontend/package.json +++ b/io.sc.platform.developer.frontend/package.json @@ -1,6 +1,6 @@ { "name": "io.sc.platform.developer.frontend", - "version": "8.1.25", + "version": "8.1.26", "description": "", "private": false, "keywords": [ @@ -80,7 +80,7 @@ "luckyexcel": "1.0.1", "mockjs": "1.1.0", "pinia": "2.1.7", - "platform-core": "8.1.136", + "platform-core": "8.1.137", "quasar": "2.14.2", "tailwindcss": "3.4.0", "vue": "3.4.3", diff --git a/io.sc.platform.developer.frontend/src/views/backend/ExportLiquibase.vue b/io.sc.platform.developer.frontend/src/views/backend/ExportLiquibase.vue index 7b4df675..87496c57 100644 --- a/io.sc.platform.developer.frontend/src/views/backend/ExportLiquibase.vue +++ b/io.sc.platform.developer.frontend/src/views/backend/ExportLiquibase.vue @@ -55,13 +55,13 @@
- + >
@@ -69,7 +69,6 @@ import { ref, reactive, toRaw, onMounted, onUpdated } from 'vue'; import { useI18n } from 'vue-i18n'; import { axios, Environment, EnumTools, Formater, Options, DialogManager, NotifyManager, Tools } from 'platform-core'; -import WProgressBtn from './WProgressBtn.vue'; const { t } = useI18n(); const formRef = ref(); diff --git a/io.sc.platform.developer.frontend/src/views/backend/ImportLiquibase.vue b/io.sc.platform.developer.frontend/src/views/backend/ImportLiquibase.vue index f6e3cdf4..cf0ee25d 100644 --- a/io.sc.platform.developer.frontend/src/views/backend/ImportLiquibase.vue +++ b/io.sc.platform.developer.frontend/src/views/backend/ImportLiquibase.vue @@ -33,13 +33,13 @@
- + >
@@ -49,7 +49,6 @@ import { ref, reactive, onMounted, onUpdated } from 'vue'; import { useI18n } from 'vue-i18n'; import { axios, Environment, DialogManager } from 'platform-core'; -import WProgressBtn from './WProgressBtn.vue'; const { t } = useI18n();