Skip to content

Commit

Permalink
!177 v3.2.4.2
Browse files Browse the repository at this point in the history
Merge pull request !177 from 码匠君/develop
  • Loading branch information
herodotus-ecosystem authored and gitee-org committed Apr 4, 2024
2 parents dc4c4b7 + 7cdadd0 commit 4b85873
Show file tree
Hide file tree
Showing 31 changed files with 1,323 additions and 1,245 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI Create Release

on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@
]
},
"dependencies": {
"@quasar/extras": "^1.16.9",
"@quasar/extras": "^1.16.11",
"lodash-es": "^4.17.21",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1",
"qs": "^6.12.0",
"quasar": "^2.15.1",
"quasar": "^2.15.2",
"vue": "^3.4.21",
"vue-i18n": "^9.10.2"
"vue-i18n": "^9.11.0"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@quasar/vite-plugin": "^1.6.0",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.11.30",
"@types/node": "^20.12.4",
"@types/qs": "^6.9.14",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@vitejs/plugin-vue": "^5.0.4",
"commitizen": "^4.3.0",
"cross-env": "^7.0.3",
Expand All @@ -60,20 +60,20 @@
"postcss": "^8.4.38",
"postcss-html": "^1.6.0",
"prettier": "^3.2.5",
"rollup": "4.13.1",
"rollup": "4.14.0",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.72.0",
"sass": "^1.74.1",
"stylelint": "^16.3.1",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-recess-order": "^5.0.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard-scss": "^13.0.0",
"terser": "^5.30.0",
"stylelint-config-standard-scss": "^13.1.0",
"terser": "^5.30.3",
"typescript": "^5.4.3",
"unplugin-auto-import": "^0.17.5",
"unplugin-icons": "^0.18.5",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.2.6",
"vite": "^5.2.8",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-dts": "3.8.1",
"vite-plugin-html": "^3.2.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@herodotus/oss-apis": "workspace:^",
"@highlightjs/vue-plugin": "^2.1.0",
"@mdi/js": "^7.4.47",
"@quasar/extras": "^1.16.9",
"@quasar/extras": "^1.16.11",
"@stomp/stompjs": "^7.0.0",
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.4",
Expand All @@ -35,13 +35,13 @@
"vkbeautify": "^0.99.3",
"vue": "^3.4.21",
"vue-cookies": "^1.8.3",
"vue-i18n": "^9.10.2",
"vue-i18n": "^9.11.0",
"vue-router": "^4.3.0",
"vue-simple-uploader": "^1.0.2",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@types/node": "20.11.30",
"@types/node": "20.12.4",
"@types/vkbeautify": "^0.99.4"
}
}
17 changes: 5 additions & 12 deletions packages/ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
</template>

<script lang="ts">
import { defineComponent, watch, nextTick, provide, ref, onMounted, onUnmounted } from 'vue';
import { defineComponent, watch, provide, ref, onMounted, onUnmounted } from 'vue';
import { useQuasar } from 'quasar';
import { echarts } from '/@/plugins';
import { useSettingsStore, useAuthenticationStore, useWebSocketStore } from '/@/stores';
import { useSettingsStore, useAuthenticationStore, useWebSocketStore, useApplicationStore } from '/@/stores';
import { variables } from '/@/lib/utils';
import { refreshTabInjectionKey, echartsInjectionKey } from '/@/lib/symbol';
import { echartsInjectionKey } from '/@/lib/symbol';
export default defineComponent({
name: 'App',
Expand All @@ -17,19 +17,12 @@ export default defineComponent({
const settings = useSettingsStore();
const authentication = useAuthenticationStore();
const webSocket = useWebSocketStore();
const app = useApplicationStore();
const { isRouterAlive } = storeToRefs(app);
const $q = useQuasar();
const gapTime = ref(0);
const beforeUnloadTime = ref(0);
// 局部组件刷新
const isRouterAlive = ref(true);
const refreshTab = () => {
isRouterAlive.value = false;
nextTick(() => {
isRouterAlive.value = true;
});
};
provide(refreshTabInjectionKey, refreshTab);
provide(echartsInjectionKey, echarts);
watch(
Expand Down
185 changes: 87 additions & 98 deletions packages/ui/src/components/layouts/common/header/HAppTabsView.vue
Original file line number Diff line number Diff line change
@@ -1,121 +1,110 @@
<script setup lang="ts">
import { defineOptions, watch } from 'vue';
import { useRoute } from 'vue-router';
import { useTabsStore } from '/@/stores';
defineOptions({ name: 'HAppTabsView' });
const route = useRoute();
const store = useTabsStore();
watch(
() => route.path,
() => {
store.smartTab(route);
},
{ immediate: true }
);
</script>

<template>
<q-toolbar>
<q-tabs shrink inline-label outside-arrows mobile-arrows dense active-color="primary">
<q-route-tab
v-for="(tab, i) in tabs"
:key="i"
class="tab-tabview"
v-for="(tab, i) in store.tabs"
:tabindex="i"
:name="(tab.name as string)"
:label="(tab.meta.title as string)"
:icon="(tab.meta.icon as string)"
:to="tab.path">
<q-icon v-if="isNotLastTab(i)" size="xs" name="mdi-close-circle" class="q-ml-md" @click="onCloseTab(tab)" />
<q-icon v-else size="xs" name="mdi-lock-outline" class="q-ml-md" />
:to="tab.path"
:key="tab.path"
:name="tab.path">
<template v-slot>
<q-icon size="1.1rem" v-if="tab.meta.icon" :name="tab.meta.icon as string" />
<span class="tab-label">{{ tab.meta['title'] }}</span>
<q-icon v-if="store.isLocked(tab)" name="mdi-lock-outline" />
<q-icon v-else name="close" class="tab-close" @click.prevent.stop="store.closeTab(tab)" />
<q-menu touch-position context-menu>
<q-list v-if="i === store.activatedTabIndex" dense bordered separator>
<q-item :disable="store.disableRefreshCurrentTab" clickable v-close-popup v-ripple>
<q-item-section @click="store.refreshCurrent()">刷新当前</q-item-section>
</q-item>
<q-item clickable v-close-popup v-ripple>
<q-item-section @click="store.closeOtherTabs()">关闭其它</q-item-section>
</q-item>
<q-item :disable="store.disableCloseLeftTabs" clickable v-close-popup v-ripple>
<q-item-section @click="store.closeLeftTabs()">关闭左侧</q-item-section>
</q-item>
<q-item :disable="store.disableCloseRightTabs" clickable v-close-popup v-ripple>
<q-item-section @click="store.closeRightTabs()">关闭右侧</q-item-section>
</q-item>
</q-list>
<q-list dense bordered separator>
<q-item clickable v-close-popup v-ripple>
<q-item-section @click="store.closeAllTabs()">关闭所有</q-item-section>
</q-item>
</q-list>
</q-menu>
</template>
</q-route-tab>
</q-tabs>
<q-space />
<q-btn-dropdown size="sm" color="red">
<q-list>
<h-list-item :disable="disableRefreshCurrentTab" label="刷新当前" icon="mdi-refresh" @click="onRefresh"></h-list-item>
<h-list-item
label="关闭当前"
:disable="disableCloseCurrentTab"
icon="mdi-close"
@click="onCloseCurrentTab()"></h-list-item>
<h-list-item
label="关闭其它"
icon="mdi-format-horizontal-align-center"
@click="onCloseOtherTabs()"></h-list-item>
<h-list-item
<HListItem
label="刷新当前"
:disable="store.disableRefreshCurrentTab"
icon="mdi-refresh"
@click="store.refreshCurrent()" />
<HListItem label="关闭其它" icon="mdi-format-horizontal-align-center" @click="store.closeOtherTabs()" />
<HListItem
label="关闭左侧"
:disable="disableCloseLeftTabs"
:disable="store.disableCloseLeftTabs"
icon="mdi-format-horizontal-align-right"
@click="onCloseLeftTabs()"></h-list-item>
<h-list-item
@click="store.closeLeftTabs()" />
<HListItem
label="关闭右侧"
:disable="disableCloseRightTabs"
:disable="store.disableCloseRightTabs"
icon="mdi-format-horizontal-align-left"
@click="onCloseRightTabs()"></h-list-item>
@click="store.closeRightTabs()" />
<HListItem label="关闭所有" :disable="false" icon="mdi-broom" @click="store.closeAllTabs()" />
</q-list>
</q-btn-dropdown>
</q-toolbar>
</template>

<script lang="ts">
import { defineComponent, watch, inject, computed } from 'vue';
import { useRoute } from 'vue-router';
import { storeToRefs } from 'pinia';
import type { Tab } from '/@/lib/declarations';
import { useTabsStore } from '/@/stores';
import { refreshTabInjectionKey } from '/@/lib/symbol';
<style lang="scss" scoped>
.tab-tabview {
padding: 0 8px;
}
export default defineComponent({
name: 'HAppTabsView',
.tab-label {
margin: 0 7px;
white-space: nowrap;
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
}
setup(props) {
const route = useRoute();
.tab-close {
display: inline-flex;
font-size: 20px;
border-radius: 4px;
padding: 2px;
opacity: 0.5;
transition: all 0.3s;
const store = useTabsStore();
const {
tabs,
isNotLastTab,
disableCloseCurrentTab,
disableCloseRightTabs,
disableCloseLeftTabs,
disableRefreshCurrentTab
} = storeToRefs(store);
const { closeTab, smartTab, closeCurrentTab, closeOtherTabs, closeLeftTabs, closeRightTabs } = store;
const refreshTab = inject<Function>(refreshTabInjectionKey);
watch(
() => route.path,
() => {
smartTab(route);
},
{ immediate: true }
);
const onCloseTab = (tab: Tab) => {
closeTab(tab);
};
const onCloseCurrentTab = () => {
closeCurrentTab();
};
const onCloseOtherTabs = () => {
closeOtherTabs();
};
const onCloseLeftTabs = () => {
closeLeftTabs();
};
const onCloseRightTabs = () => {
closeRightTabs();
};
const onRefresh = () => {
refreshTab && refreshTab();
};
return {
onCloseTab,
onCloseCurrentTab,
onCloseOtherTabs,
onCloseLeftTabs,
onCloseRightTabs,
onRefresh,
tabs,
isNotLastTab,
disableCloseCurrentTab,
disableCloseRightTabs,
disableCloseLeftTabs,
disableRefreshCurrentTab
};
&:hover {
opacity: 3;
background-color: #b7bcd1;
}
});
</script>
}
</style>
Loading

0 comments on commit 4b85873

Please sign in to comment.