|
@@ -0,0 +1,108 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <div class="tw-bg-white tw-p-5 tw-rounded-xl tw-mb-5">
|
|
|
|
+ <span class="tw-mr-4"></span>
|
|
|
|
+ 项目名称<a-input
|
|
|
|
+ disabled
|
|
|
|
+ v-model:value="project.name"
|
|
|
|
+ class="tw-mr-4"
|
|
|
|
+ style="width: 178px"
|
|
|
|
+ placeholder="项目名称"
|
|
|
|
+ allowClear
|
|
|
|
+ ></a-input>
|
|
|
|
+
|
|
|
|
+ <span class="tw-mr-4"></span>
|
|
|
|
+ 数据解析状态<a-input
|
|
|
|
+ disabled
|
|
|
|
+ :value="$filters.projectStatusFilter(project.status)"
|
|
|
|
+ class="tw-mr-4"
|
|
|
|
+ style="width: 178px"
|
|
|
|
+ placeholder="项目名称"
|
|
|
|
+ allowClear
|
|
|
|
+ ></a-input>
|
|
|
|
+ <span class="tw-mr-4"></span>
|
|
|
|
+ <a-button @click="goBack">返回</a-button>
|
|
|
|
+
|
|
|
|
+ <div class="tw-mt-4">
|
|
|
|
+ <a-form>
|
|
|
|
+ <a-form-item label="文件地址">
|
|
|
|
+ <input id="file-input" :multiple="false" type="file" />
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item label="下载模板">
|
|
|
|
+ <a-button @click="downloadTpl">下载模板</a-button>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-form>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="tw-mt-4">
|
|
|
|
+ 处理报告
|
|
|
|
+ <a-button @click="handleLogsOfProject"> 下载报告文件 </a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script setup lang="ts">
|
|
|
|
+import {
|
|
|
|
+ cancelProject,
|
|
|
|
+ deleteProjects,
|
|
|
|
+ getProjectList,
|
|
|
|
+ importProjectDataSource,
|
|
|
|
+ logsOfProject,
|
|
|
|
+ updateProject,
|
|
|
|
+} from "@/api/projectManagementPage";
|
|
|
|
+import { useMainStore } from "@/store";
|
|
|
|
+import { downloadFileURL, goBack } from "@/utils/utils";
|
|
|
|
+import { message } from "ant-design-vue";
|
|
|
|
+import { watch, onMounted, ref, reactive, toRaw, computed } from "vue-demi";
|
|
|
|
+import { useRoute } from "vue-router";
|
|
|
|
+
|
|
|
|
+const store = useMainStore();
|
|
|
|
+store.currentLocation = "基础管理 / 项目列表";
|
|
|
|
+
|
|
|
|
+let rootOrgId = $ref(undefined as unknown as number);
|
|
|
|
+
|
|
|
|
+const route = useRoute();
|
|
|
|
+const projectId = +route.params.id;
|
|
|
|
+let data = $ref([]);
|
|
|
|
+
|
|
|
|
+let project: any = computed(() => data[0] || {});
|
|
|
|
+
|
|
|
|
+async function search() {
|
|
|
|
+ await fetchData();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+async function fetchData() {
|
|
|
|
+ const res = await getProjectList({
|
|
|
|
+ id: projectId,
|
|
|
|
+ rootOrgId,
|
|
|
|
+ });
|
|
|
|
+ data = res.data.content;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+onMounted(async () => {
|
|
|
|
+ rootOrgId = store.userInfo.rootOrgId;
|
|
|
|
+ await search();
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+async function downloadTpl() {
|
|
|
|
+ downloadFileURL("/api/ess/project/template");
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+async function handleImport() {
|
|
|
|
+ const files = (document.querySelector("#file-input") as HTMLInputElement)
|
|
|
|
+ .files;
|
|
|
|
+ const fileToImport = files && files[0];
|
|
|
|
+ if (!fileToImport) {
|
|
|
|
+ message.warn({ content: "请选择文件" });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ await importProjectDataSource(rootOrgId, fileToImport);
|
|
|
|
+ message.success({ content: "导入成功" });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+async function handleLogsOfProject() {
|
|
|
|
+ await logsOfProject(projectId);
|
|
|
|
+ message.success({ content: "操作成功" });
|
|
|
|
+}
|
|
|
|
+</script>
|