Browse Source

update

main
wangshaoping 12 months ago
parent
commit
ce17bc9bd6
  1. 4
      gradle.properties
  2. 2
      io.sc.platform.core.frontend/package.json
  3. 3
      io.sc.platform.core.frontend/src/platform/components/index.ts
  4. 33
      io.sc.platform.core.frontend/src/platform/components/progress/WProgress.vue
  5. 76
      io.sc.platform.core.frontend/src/platform/components/progress/WProgressBtn.vue
  6. 1
      io.sc.platform.core.frontend/src/platform/index.ts
  7. 4
      io.sc.platform.core.frontend/template-project/package.json
  8. 1
      io.sc.platform.core.frontend/template-project/src/views/FormElements.vue
  9. 4
      io.sc.platform.developer.frontend/package.json
  10. 5
      io.sc.platform.developer.frontend/src/views/backend/ExportLiquibase.vue
  11. 5
      io.sc.platform.developer.frontend/src/views/backend/ImportLiquibase.vue

4
gradle.properties

@ -36,9 +36,9 @@ application_version=1.0.0
# platform # platform
########################################################### ###########################################################
platform_group=io.sc platform_group=io.sc
platform_version=8.1.25 platform_version=8.1.26
platform_plugin_version=8.1.13 platform_plugin_version=8.1.13
platform_core_frontend_version=8.1.136 platform_core_frontend_version=8.1.137
########################################################### ###########################################################
# dependencies version # dependencies version

2
io.sc.platform.core.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "platform-core", "name": "platform-core",
"version": "8.1.136", "version": "8.1.137",
"description": "前端核心包,用于快速构建前端的脚手架", "description": "前端核心包,用于快速构建前端的脚手架",
"//main": "库的主文件", "//main": "库的主文件",
"main": "dist/platform-core.js", "main": "dist/platform-core.js",

3
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 WInfoPanel from './panel/WInfoPanel.vue';
import WProgress from './progress/WProgress.vue'; import WProgress from './progress/WProgress.vue';
import WProgressBtn from './progress/WProgressBtn.vue';
import WEnableTag from './tag/WEnableTag.vue'; import WEnableTag from './tag/WEnableTag.vue';
import WSuccessFailedTag from './tag/WSuccessFailedTag.vue'; import WSuccessFailedTag from './tag/WSuccessFailedTag.vue';
@ -76,6 +77,7 @@ export default {
app.component('WInfoPanel', WInfoPanel); app.component('WInfoPanel', WInfoPanel);
app.component('WProgress', WProgress); app.component('WProgress', WProgress);
app.component('WProgressBtn', WProgressBtn);
app.component('WEnableTag', WEnableTag); app.component('WEnableTag', WEnableTag);
app.component('WSuccessFailedTag', WSuccessFailedTag); app.component('WSuccessFailedTag', WSuccessFailedTag);
@ -112,6 +114,7 @@ export {
WVExpandDiv, WVExpandDiv,
WInfoPanel, WInfoPanel,
WProgress, WProgress,
WProgressBtn,
WEnableTag, WEnableTag,
WSuccessFailedTag, WSuccessFailedTag,
WToolbar, WToolbar,

33
io.sc.platform.core.frontend/src/platform/components/progress/WProgress.vue

@ -15,7 +15,7 @@ const props = defineProps({
const attrs = useAttrs(); const attrs = useAttrs();
const showRef = ref(false); const showRef = ref(false);
const percentageRef = ref(0.2); const percentageRef = ref(0);
const messageRef = ref(''); const messageRef = ref('');
let executeProgressInterval; let executeProgressInterval;
@ -23,37 +23,48 @@ const refreshProgress = () => {
axios axios
.get(Environment.apiContextPath(props.dataUrl)) .get(Environment.apiContextPath(props.dataUrl))
.then((response) => { .then((response) => {
const progressInfo = response.data; if (response?.data?.running) {
percentageRef.value = progressInfo.currentWeight / progressInfo.totalWeight; const progressInfo = response.data;
messageRef.value = progressInfo.messageKey; percentageRef.value = progressInfo.currentWeight / progressInfo.totalWeight;
if (percentageRef.value >= 1) { messageRef.value = progressInfo.messageKey;
clearInterval(executeProgressInterval); if (percentageRef.value >= 1) {
showRef.value = false; stop();
}
} else {
stop();
} }
}) })
.catch(() => { .catch(() => {
clearInterval(executeProgressInterval); stop();
showRef.value = false;
}); });
}; };
const start = () => { const start = () => {
showRef.value = true; showRef.value = true;
percentageRef.value = 0;
executeProgressInterval = setInterval(refreshProgress, props.interval); executeProgressInterval = setInterval(refreshProgress, props.interval);
}; };
const stop = () => {
clearInterval(executeProgressInterval);
showRef.value = false;
};
onMounted(() => { onMounted(() => {
axios axios
.get(Environment.apiContextPath(props.dataUrl)) .get(Environment.apiContextPath(props.dataUrl))
.then((response) => { .then((response) => {
start(); if (response?.data?.running) {
start();
}
}) })
.catch(() => { .catch(() => {
showRef.value = false; stop();
}); });
}); });
defineExpose({ defineExpose({
start, start,
stop,
}); });
</script> </script>

76
io.sc.platform.core.frontend/src/platform/components/progress/WProgressBtn.vue

@ -0,0 +1,76 @@
<template>
<q-btn icon="bi-database-down" :label="$t('export')" outline no-caps v-bind="attrs" :loading="showRef" :percentage="percentageRef">
<!-- <template #loading>
<div class="justify-between">
<q-icon :name="attrs.icon"></q-icon>
<span>正在执行...</span>
<q-btn v-if="showRef" icon="bi-info" title="show detail" dense rounded flat @click.stop.prevent="() => {}"></q-btn>
</div>
</template> -->
</q-btn>
</template>
<script setup lang="ts">
import { ref, useAttrs, onMounted } from 'vue';
import { axios, Environment } from '@/platform';
const props = defineProps({
dataUrl: { type: String, default: '' },
interval: { type: Number, default: 1000 },
});
const attrs = useAttrs();
const showRef = ref(false);
const percentageRef = ref(0);
const messageRef = ref('');
let executeProgressInterval;
const refreshProgress = () => {
axios
.get(Environment.apiContextPath(props.dataUrl))
.then((response) => {
if (response?.data?.running) {
const progressInfo = response.data;
percentageRef.value = (progressInfo.currentWeight / progressInfo.totalWeight) * 100;
messageRef.value = progressInfo.messageKey;
if (percentageRef.value >= 100) {
setTimeout(stop, 1000);
}
} else {
stop();
}
})
.catch((error) => {
console.log(error);
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) => {
if (response?.data?.running) {
start();
}
})
.catch(() => {
stop();
});
});
defineExpose({
start,
stop,
});
</script>

1
io.sc.platform.core.frontend/src/platform/index.ts

@ -135,6 +135,7 @@ export {
WVExpandDiv, WVExpandDiv,
WInfoPanel, WInfoPanel,
WProgress, WProgress,
WProgressBtn,
WEnableTag, WEnableTag,
WSuccessFailedTag, WSuccessFailedTag,
WToolbar, WToolbar,

4
io.sc.platform.core.frontend/template-project/package.json

@ -1,6 +1,6 @@
{ {
"name": "platform-core", "name": "platform-core",
"version": "8.1.134", "version": "8.1.137",
"description": "前端核心包,用于快速构建前端的脚手架", "description": "前端核心包,用于快速构建前端的脚手架",
"private": false, "private": false,
"keywords": [], "keywords": [],
@ -92,7 +92,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.134", "platform-core": "8.1.137",
"quasar": "2.14.5", "quasar": "2.14.5",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

1
io.sc.platform.core.frontend/template-project/src/views/FormElements.vue

@ -39,6 +39,7 @@
<w-code-mirror v-model="valueRef" label="please input SQL:" lang="sql" outlined dense></w-code-mirror> <w-code-mirror v-model="valueRef" label="please input SQL:" lang="sql" outlined dense></w-code-mirror>
<q-input v-model="valueRef" label="please input number 2:" outlined dense clearable></q-input> <q-input v-model="valueRef" label="please input number 2:" outlined dense clearable></q-input>
<w-icon v-model="iconValueRef" label="please select icon:" lang="sql" outlined dense></w-icon> <w-icon v-model="iconValueRef" label="please select icon:" lang="sql" outlined dense></w-icon>
<w-progress data-url="/api/jdbc/export/traceExecuteProgress"></w-progress>
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
</template> </template>

4
io.sc.platform.developer.frontend/package.json

@ -1,6 +1,6 @@
{ {
"name": "io.sc.platform.developer.frontend", "name": "io.sc.platform.developer.frontend",
"version": "8.1.25", "version": "8.1.26",
"description": "", "description": "",
"private": false, "private": false,
"keywords": [ "keywords": [
@ -80,7 +80,7 @@
"luckyexcel": "1.0.1", "luckyexcel": "1.0.1",
"mockjs": "1.1.0", "mockjs": "1.1.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"platform-core": "8.1.136", "platform-core": "8.1.137",
"quasar": "2.14.2", "quasar": "2.14.2",
"tailwindcss": "3.4.0", "tailwindcss": "3.4.0",
"vue": "3.4.3", "vue": "3.4.3",

5
io.sc.platform.developer.frontend/src/views/backend/ExportLiquibase.vue

@ -55,13 +55,13 @@
</w-form> </w-form>
<div class="row justify-center q-gutter-md py-2"> <div class="row justify-center q-gutter-md py-2">
<WProgressBtn <w-progress-btn
ref="progressBtnRef" ref="progressBtnRef"
icon="bi-database-down" icon="bi-database-down"
:label="$t('export')" :label="$t('export')"
data-url="/api/jdbc/data/traceExporterExecuteProgress" data-url="/api/jdbc/data/traceExporterExecuteProgress"
@click="exportData" @click="exportData"
></WProgressBtn> ></w-progress-btn>
</div> </div>
</div> </div>
</template> </template>
@ -69,7 +69,6 @@
import { ref, reactive, toRaw, onMounted, onUpdated } from 'vue'; import { ref, reactive, toRaw, onMounted, onUpdated } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { axios, Environment, EnumTools, Formater, Options, DialogManager, NotifyManager, Tools } from 'platform-core'; import { axios, Environment, EnumTools, Formater, Options, DialogManager, NotifyManager, Tools } from 'platform-core';
import WProgressBtn from './WProgressBtn.vue';
const { t } = useI18n(); const { t } = useI18n();
const formRef = ref(); const formRef = ref();

5
io.sc.platform.developer.frontend/src/views/backend/ImportLiquibase.vue

@ -33,13 +33,13 @@
<div class="row py-1"> <div class="row py-1">
<div class="col-3"></div> <div class="col-3"></div>
<div class="col-6 row justify-center q-gutter-md py-2"> <div class="col-6 row justify-center q-gutter-md py-2">
<WProgressBtn <w-progress-btn
ref="progressBtnRef" ref="progressBtnRef"
icon="bi-database-up" icon="bi-database-up"
:label="$t('import')" :label="$t('import')"
data-url="/api/jdbc/data/traceImporterExecuteProgress" data-url="/api/jdbc/data/traceImporterExecuteProgress"
@click="importData" @click="importData"
></WProgressBtn> ></w-progress-btn>
</div> </div>
<div class="col-3"></div> <div class="col-3"></div>
</div> </div>
@ -49,7 +49,6 @@
import { ref, reactive, onMounted, onUpdated } from 'vue'; import { ref, reactive, onMounted, onUpdated } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { axios, Environment, DialogManager } from 'platform-core'; import { axios, Environment, DialogManager } from 'platform-core';
import WProgressBtn from './WProgressBtn.vue';
const { t } = useI18n(); const { t } = useI18n();

Loading…
Cancel
Save