|
|
|
|
@@ -16,11 +16,11 @@
|
|
|
|
|
<div
|
|
|
|
|
class="tab-item"
|
|
|
|
|
v-for="item in allTabs"
|
|
|
|
|
:key="item.moduleCode"
|
|
|
|
|
:key="item.screenCode"
|
|
|
|
|
:class="{ active: isCurrentTab(item.path) }"
|
|
|
|
|
@click="switchTabByRoute(item)"
|
|
|
|
|
>
|
|
|
|
|
<span>{{ item.moduleName }}</span>
|
|
|
|
|
<span>{{ item.screenName }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="query-group">
|
|
|
|
|
@@ -36,22 +36,18 @@
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
<main class="screen-content">
|
|
|
|
|
<div v-if="isHome" class="screen-page">
|
|
|
|
|
<HomePage />
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else class="screen-page">
|
|
|
|
|
<div class="screen-page">
|
|
|
|
|
<router-view />
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
<script lang="ts" setup name="ViewsBizMyScreenInfoIndex">
|
|
|
|
|
import { ref, onMounted, computed } from 'vue';
|
|
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
// import { getHomeModuleList } from '@/api/bizApi'
|
|
|
|
|
import HomePage from './Home/index.vue'
|
|
|
|
|
import { MyScreenInfo, myScreenInfoListAll } from '@jeesite/biz/api/biz/myScreenInfo';
|
|
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
@@ -60,7 +56,7 @@ const HOME_TITLE = "个人数字化分析看板";
|
|
|
|
|
const screenTitle = ref(HOME_TITLE);
|
|
|
|
|
const currentYear = new Date().getFullYear().toString();
|
|
|
|
|
|
|
|
|
|
const allTabs = ref([])
|
|
|
|
|
const allTabs = ref<MyScreenInfo[]>()
|
|
|
|
|
const queryDate = ref(currentYear);
|
|
|
|
|
|
|
|
|
|
const getTitle = (title) => {
|
|
|
|
|
@@ -73,7 +69,7 @@ const isHome = computed(() => {
|
|
|
|
|
|
|
|
|
|
const goHome = () => {
|
|
|
|
|
screenTitle.value = HOME_TITLE;
|
|
|
|
|
router.push('/bigScreen').catch(() => {});
|
|
|
|
|
router.push('/bigScreen/home').catch(() => {});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const isCurrentTab = (routePath) => {
|
|
|
|
|
@@ -81,7 +77,7 @@ const isCurrentTab = (routePath) => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const switchTabByRoute = (item) => {
|
|
|
|
|
getTitle(item.titleName);
|
|
|
|
|
getTitle(item.screenTitle);
|
|
|
|
|
if (!item.path) {
|
|
|
|
|
ElMessage.warning('该模块暂无对应路由');
|
|
|
|
|
return;
|
|
|
|
|
@@ -112,25 +108,21 @@ const handleQuery = () => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleSetting = () => {
|
|
|
|
|
router.push('/bigScreen/screenSetting');
|
|
|
|
|
router.push('/bigScreen/setting');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// async function getList() {
|
|
|
|
|
// try {
|
|
|
|
|
// const res = await getHomeModuleList();
|
|
|
|
|
// allTabs.value = res || [];
|
|
|
|
|
// } catch (error) {
|
|
|
|
|
// console.error('获取模块列表失败:', error);
|
|
|
|
|
// allTabs.value = [];
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
const initApp = () => {
|
|
|
|
|
// getList();
|
|
|
|
|
};
|
|
|
|
|
async function getList() {
|
|
|
|
|
try {
|
|
|
|
|
const res = await myScreenInfoListAll();
|
|
|
|
|
allTabs.value = res || [];
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取模块列表失败:', error);
|
|
|
|
|
allTabs.value = [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
initApp();
|
|
|
|
|
getList();
|
|
|
|
|
router.afterEach((to) => {
|
|
|
|
|
if (to.query.year) {
|
|
|
|
|
queryDate.value = to.query.year;
|
|
|
|
|
|