删除项目列表模块(重复内容)
This commit is contained in:
@@ -83,12 +83,12 @@
|
||||
</div>
|
||||
|
||||
<div v-else class="empty-state-container">
|
||||
<el-empty description="请先在顶部或项目列表选择一个当前项目" />
|
||||
<el-empty description="请先在顶部选择一个当前项目" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import { useAuthStore } from "../store/auth";
|
||||
import { useStudyStore } from "../store/study";
|
||||
import { fetchFinanceSummary, fetchOverdueAesCount, fetchOverdueQueriesCount, fetchProgress } from "../api/dashboard";
|
||||
@@ -151,9 +151,24 @@ const loadData = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const resetData = () => {
|
||||
progress.value = null;
|
||||
financeSummary.value = null;
|
||||
overdueAes.value = 0;
|
||||
overdueQueries.value = 0;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
loadData();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => study.currentStudy?.id,
|
||||
() => {
|
||||
resetData();
|
||||
loadData();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
<template>
|
||||
<div class="study-list">
|
||||
<el-card>
|
||||
<div class="header">
|
||||
<h3>项目列表</h3>
|
||||
</div>
|
||||
<el-table :data="studies" style="width: 100%" v-loading="loading">
|
||||
<el-table-column prop="code" label="项目编号" width="160" />
|
||||
<el-table-column prop="name" label="项目名称" />
|
||||
<el-table-column prop="status" label="状态" width="120" />
|
||||
<el-table-column label="操作" width="140">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" @click="enterStudy(scope.row)">进入项目</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { fetchStudies } from "../api/studies";
|
||||
import { useStudyStore } from "../store/study";
|
||||
import type { Study } from "../types/api";
|
||||
|
||||
const studies = ref<Study[]>([]);
|
||||
const loading = ref(false);
|
||||
const router = useRouter();
|
||||
const studyStore = useStudyStore();
|
||||
|
||||
const loadStudies = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const { data } = await fetchStudies();
|
||||
studies.value = data.items;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const enterStudy = (study: Study) => {
|
||||
studyStore.setCurrentStudy(study);
|
||||
router.push("/study/home");
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
loadStudies();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.study-list {
|
||||
padding: 16px;
|
||||
}
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -14,7 +14,7 @@
|
||||
<!-- 提示未选择项目 -->
|
||||
<el-alert
|
||||
v-if="!currentStudyId"
|
||||
title="请先在顶部导航或项目列表中选择一个项目,以开启完整的工作台功能。"
|
||||
title="请先在顶部导航选择一个项目,以开启完整的工作台功能。"
|
||||
type="warning"
|
||||
show-icon
|
||||
:closable="false"
|
||||
|
||||
Reference in New Issue
Block a user