anderx vor 9 Monaten
Ursprung
Commit
e39fedeb40

Datei-Diff unterdrückt, da er zu groß ist
+ 18 - 8672
package-lock.json


+ 28 - 28
public/mockServiceWorker.js

@@ -115,25 +115,25 @@ self.addEventListener('fetch', function (event) {
   const requestId = Math.random().toString(16).slice(2)
 
   event.respondWith(
-      handleRequest(event, requestId).catch((error) => {
-        if (error.name === 'NetworkError') {
-          console.warn(
-              '[MSW] Successfully emulated a network error for the "%s %s" request.',
-              request.method,
-              request.url,
-          )
-          return
-        }
-
-        // At this point, any exception indicates an issue with the original request/response.
-        console.error(
-            `\
-[MSW] Caught an exception from the "%s %s" request (%s). This is probably not a problem with Mock Service Worker. There is likely an additional logging output above.`,
-            request.method,
-            request.url,
-            `${error.name}: ${error.message}`,
+    handleRequest(event, requestId).catch((error) => {
+      if (error.name === 'NetworkError') {
+        console.warn(
+          '[MSW] Successfully emulated a network error for the "%s %s" request.',
+          request.method,
+          request.url,
         )
-      }),
+        return
+      }
+
+      // At this point, any exception indicates an issue with the original request/response.
+      console.error(
+        `\
+[MSW] Caught an exception from the "%s %s" request (%s). This is probably not a problem with Mock Service Worker. There is likely an additional logging output above.`,
+        request.method,
+        request.url,
+        `${error.name}: ${error.message}`,
+      )
+    }),
   )
 })
 
@@ -156,7 +156,7 @@ async function handleRequest(event, requestId) {
           status: clonedResponse.status,
           statusText: clonedResponse.statusText,
           body:
-              clonedResponse.body === null ? null : await clonedResponse.text(),
+            clonedResponse.body === null ? null : await clonedResponse.text(),
           headers: Object.fromEntries(clonedResponse.headers.entries()),
           redirected: clonedResponse.redirected,
         },
@@ -183,15 +183,15 @@ async function resolveMainClient(event) {
   })
 
   return allClients
-      .filter((client) => {
-        // Get only those clients that are currently visible.
-        return client.visibilityState === 'visible'
-      })
-      .find((client) => {
-        // Find the client ID that's recorded in the
-        // set of clients that have registered the worker.
-        return activeClientIds.has(client.id)
-      })
+    .filter((client) => {
+      // Get only those clients that are currently visible.
+      return client.visibilityState === 'visible'
+    })
+    .find((client) => {
+      // Find the client ID that's recorded in the
+      // set of clients that have registered the worker.
+      return activeClientIds.has(client.id)
+    })
 }
 
 async function getResponse(event, client, requestId) {

+ 132 - 132
src/components/NavMenu.vue

@@ -1,132 +1,132 @@
-<script setup lang="ts">
-import {
-  FilePptOutlined,
-  FileSearchOutlined,
-  NodeIndexOutlined,
-  LogoutOutlined,
-  HistoryOutlined,
-  StarOutlined,
-  ExclamationCircleOutlined,
-} from '@ant-design/icons-vue';
-import { createVNode, onMounted, ref, watch } from 'vue';
-import { useRoute, RouterLink } from "vue-router";
-import _ from "lodash";
-import { useAuthStore } from '@/stores/auth.store';
-import { routeToLogin } from "@/router";
-import { Modal } from 'ant-design-vue';
-
-const selectedKeys = ref<string[]>(['/']);
-const openKeys = ref<string[]>(['/']);
-// 当前路由
-const route = useRoute();
-// 授权store
-const authStore = useAuthStore();
-
-onMounted(() => {
-  openKeys.value = getOpenKeys(route.path);
-  selectedKeys.value = [route.path];
-
-  watch(
-    () => route.path,
-    (path: string) => {
-      const currentOpenkeys = getOpenKeys(path);
-      openKeys.value = _.uniq(_.concat(openKeys.value, currentOpenkeys));
-      selectedKeys.value = openKeys.value;
-    }
-  );
-});
-
-function getOpenKeys(path: string): string[] {
-  const parts = _.dropRight(path.split('/').filter(x => x != '').map(x => '/'+x), 1);
-  if (parts.length == 0) {
-    return ["/"];
-  }
-  let openKeys = parts.reduce((acc, item) => {
-    if (acc.length == 0) {
-      return acc.concat([item]);
-    }
-    return acc.concat([acc[acc.length-1] + item]);
-  }, [] as string[]);
-  openKeys.unshift("/");
-  return openKeys;
-}
-
-function logout(e: MouseEvent) {
-  authStore.logout();
-  routeToLogin();
-  e.stopPropagation();
-}
-
-function logoutConfirm(e: MouseEvent) {
-  Modal.confirm({
-    title: '正在退出系统,退出请点击确认。',
-    icon: createVNode(ExclamationCircleOutlined),
-    okText: '确认',
-    okType: 'danger',
-    cancelText: '取消',
-    onOk() {
-      logout(e);
-    }
-  });
-}
-</script>
-
-<template>
-  <a-menu
-    v-model:openKeys="openKeys"
-    v-model:selectedKeys="selectedKeys"
-    mode="inline"
-  >
-    <a-sub-menu key="/report">
-      <template #icon>
-        <FilePptOutlined />
-      </template>
-      <template #title>报告管理</template>
-      <a-menu-item key="/report/index">
-        <RouterLink to="/report/index">我的报告</RouterLink>
-      </a-menu-item>
-      <a-menu-item key="/report/template">
-        <RouterLink to="/report/template">模板管理</RouterLink>
-      </a-menu-item>
-    </a-sub-menu>
-    <a-sub-menu key="/search">
-      <template #icon>
-        <FileSearchOutlined />
-      </template>
-      <template #title>搜索</template>
-      <a-menu-item key="/search/index">
-        <RouterLink to="/search/index">智能搜索</RouterLink>
-      </a-menu-item>
-      <a-menu-item key="/search/advanced/index">
-        <RouterLink to="/search/advanced/index">高级搜索</RouterLink>
-      </a-menu-item>
-    </a-sub-menu>
-    <a-sub-menu key="/knowledgeGraph">
-      <template #icon>
-        <NodeIndexOutlined />
-      </template>
-      <template #title>知识导航</template>
-      <a-menu-item key="/knowledgeGraph/search">
-        <RouterLink to="/knowledgeGraph/search">建筑工程及工程设计</RouterLink>
-      </a-menu-item>
-    </a-sub-menu>
-    <a-menu-item key="/history">
-      <template #icon>
-        <history-outlined />
-      </template>
-      <RouterLink to="/history">历史记录</RouterLink>
-    </a-menu-item>
-    <a-menu-item key="/favorite">
-      <template #icon>
-        <star-outlined />
-      </template>
-      <RouterLink to="/favorite">我的收藏</RouterLink>
-    </a-menu-item>
-    <a-menu-item key="/logout" @click="logoutConfirm">
-      <template #icon>
-        <logout-outlined />
-      </template>
-      退出系统
-    </a-menu-item>
-  </a-menu>
-</template>
+<script setup lang="ts">
+import {
+  FilePptOutlined,
+  FileSearchOutlined,
+  NodeIndexOutlined,
+  LogoutOutlined,
+  HistoryOutlined,
+  StarOutlined,
+  ExclamationCircleOutlined,
+} from '@ant-design/icons-vue';
+import { createVNode, onMounted, ref, watch } from 'vue';
+import { useRoute, RouterLink } from "vue-router";
+import _ from "lodash";
+import { useAuthStore } from '@/stores/auth.store';
+import { routeToLogin } from "@/router";
+import { Modal } from 'ant-design-vue';
+
+const selectedKeys = ref<string[]>(['/']);
+const openKeys = ref<string[]>(['/']);
+// 当前路由
+const route = useRoute();
+// 授权store
+const authStore = useAuthStore();
+
+onMounted(() => {
+  openKeys.value = getOpenKeys(route.path);
+  selectedKeys.value = [route.path];
+
+  watch(
+    () => route.path,
+    (path: string) => {
+      const currentOpenkeys = getOpenKeys(path);
+      openKeys.value = _.uniq(_.concat(openKeys.value, currentOpenkeys));
+      selectedKeys.value = openKeys.value;
+    }
+  );
+});
+
+function getOpenKeys(path: string): string[] {
+  const parts = _.dropRight(path.split('/').filter(x => x != '').map(x => '/'+x), 1);
+  if (parts.length == 0) {
+    return ["/"];
+  }
+  let openKeys = parts.reduce((acc, item) => {
+    if (acc.length == 0) {
+      return acc.concat([item]);
+    }
+    return acc.concat([acc[acc.length-1] + item]);
+  }, [] as string[]);
+  openKeys.unshift("/");
+  return openKeys;
+}
+
+function logout(e: MouseEvent) {
+  authStore.logout();
+  routeToLogin();
+  e.stopPropagation();
+}
+
+function logoutConfirm(e: MouseEvent) {
+  Modal.confirm({
+    title: '正在退出系统,退出请点击确认。',
+    icon: createVNode(ExclamationCircleOutlined),
+    okText: '确认',
+    okType: 'danger',
+    cancelText: '取消',
+    onOk() {
+      logout(e);
+    }
+  });
+}
+</script>
+
+<template>
+  <a-menu
+    v-model:openKeys="openKeys"
+    v-model:selectedKeys="selectedKeys"
+    mode="inline"
+  >
+    <a-sub-menu key="/report">
+      <template #icon>
+        <FilePptOutlined />
+      </template>
+      <template #title>报告管理</template>
+      <a-menu-item key="/report/index">
+        <RouterLink to="/report/index">我的报告</RouterLink>
+      </a-menu-item>
+      <a-menu-item key="/report/template">
+        <RouterLink to="/report/template">模板管理</RouterLink>
+      </a-menu-item>
+    </a-sub-menu>
+    <a-sub-menu key="/search">
+      <template #icon>
+        <FileSearchOutlined />
+      </template>
+      <template #title>搜索</template>
+      <a-menu-item key="/search/index">
+        <RouterLink to="/search/index">智能搜索</RouterLink>
+      </a-menu-item>
+      <a-menu-item key="/search/advanced/index">
+        <RouterLink to="/search/advanced/index">高级搜索</RouterLink>
+      </a-menu-item>
+    </a-sub-menu>
+    <a-sub-menu key="/knowledgeGraph">
+      <template #icon>
+        <NodeIndexOutlined />
+      </template>
+      <template #title>知识导航</template>
+      <a-menu-item key="/knowledgeGraph/search">
+        <RouterLink to="/knowledgeGraph/search">建筑工程及工程设计</RouterLink>
+      </a-menu-item>
+    </a-sub-menu>
+    <a-menu-item key="/history">
+      <template #icon>
+        <history-outlined />
+      </template>
+      <RouterLink to="/history">历史记录</RouterLink>
+    </a-menu-item>
+    <a-menu-item key="/favorite">
+      <template #icon>
+        <star-outlined />
+      </template>
+      <RouterLink to="/favorite">我的收藏</RouterLink>
+    </a-menu-item>
+    <a-menu-item key="/logout" @click="logoutConfirm">
+      <template #icon>
+        <logout-outlined />
+      </template>
+      退出系统
+    </a-menu-item>
+  </a-menu>
+</template>

+ 15 - 15
src/stores/side-bar.ts

@@ -1,15 +1,15 @@
-import { defineStore } from "pinia";
-import { ref } from "vue";
-
-export const useSideBarStore = defineStore("sideBar", () => {
-  const collapsed = ref(false);
-
-  function setCollapse(collapse: boolean) {
-    collapsed.value = collapse
-  }
-
-  return {
-    collapsed,
-    setCollapse,
-  }
-});
+import { defineStore } from "pinia";
+import { ref } from "vue";
+
+export const useSideBarStore = defineStore("sideBar", () => {
+  const collapsed = ref(false);
+
+  function setCollapse(collapse: boolean) {
+    collapsed.value = collapse
+  }
+
+  return {
+    collapsed,
+    setCollapse,
+  }
+});

+ 32 - 32
src/types/doc.types.ts

@@ -1,32 +1,32 @@
-export interface Section {
-  // 章节ID
-  id: number;
-  // 章节标题
-  title: string;
-  // 上级章节标题
-  parentTitle: string;
-  // 章节内容
-  content: string;
-  // 章节所在页码
-  page: number;
-  // 章节标题
-  orderNum: number;
-  // 子章节内容
-  children: Section[];
-}
-
-/**
- * 文献详情
- */
-export interface PaperDetail {
-  id: number;
-  title: string;
-  journalName: string;
-  year: string;
-  summary: string;
-  keywords: string[];
-  authors: string;
-  units: string;
-  filePath: string;
-  sections: Section[];
-}
+export interface Section {
+  // 章节ID
+  id: number;
+  // 章节标题
+  title: string;
+  // 上级章节标题
+  parentTitle: string;
+  // 章节内容
+  content: string;
+  // 章节所在页码
+  page: number;
+  // 章节标题
+  orderNum: number;
+  // 子章节内容
+  children: Section[];
+}
+
+/**
+ * 文献详情
+ */
+export interface PaperDetail {
+  id: number;
+  title: string;
+  journalName: string;
+  year: string;
+  summary: string;
+  keywords: string[];
+  authors: string;
+  units: string;
+  filePath: string;
+  sections: Section[];
+}

+ 5 - 5
src/types/response.types.ts

@@ -1,5 +1,5 @@
-export interface Response<T> {
-  status: number;
-  msg: string;
-  data: T;
-}
+export interface Response<T> {
+  status: number;
+  msg: string;
+  data: T;
+}

+ 81 - 81
src/views/RouteView.vue

@@ -1,81 +1,81 @@
-<script setup lang="ts">
-import { ref, watch, computed } from "vue";
-import { RouterView } from "vue-router";
-import NavMenu from "@/components/NavMenu.vue";
-import Logo from "@/components/LogoComponent.vue";
-import { useSideBarStore } from "@/stores/side-bar";
-
-const sideBarStore = useSideBarStore();
-
-const brand = ref("技淘平台智慧产权大脑");
-
-const collapsed = computed(() => sideBarStore.collapsed);
-
-watch(
-  () => sideBarStore.collapsed,
-  (value: boolean) => {
-    brand.value = value ? "大脑" : "技淘平台智慧产权大脑";
-  }
-);
-</script>
-
-<template>
-  <a-layout class="layout">
-    <a-layout-sider
-      class="sider-nav-bar-wrap"
-      width="260"
-      theme="light"
-      v-model:collapsed="sideBarStore.collapsed"
-      collapsible
-    >
-      <div class="logo">
-        <Transition name="slide-fade">
-          <img src="@/assets/logo.png" width="50" v-if="collapsed" />
-          <img src="@/assets/logo.png" width="120" v-else />
-        </Transition>
-      </div>
-      <NavMenu class="sider-nav" />
-    </a-layout-sider>
-    <a-layout>
-      <a-layout-content class="main-content">
-        <RouterView />
-      </a-layout-content>
-    </a-layout>
-  </a-layout>
-</template>
-
-<style scoped lang="scss">
-.fade-enter-active,
-.fade-leave-active {
-  transition: opacity 0.2s ease;
-}
-
-.fade-enter-from,
-.fade-leave-to {
-  opacity: 0;
-}
-
-.layout {
-  background-color: #fff;
-  .main-content {
-    background-color: #fff;
-    border-left: 1px solid #f3f3f3;
-    min-width: 800px;
-    padding: 20px 40px;
-    padding-bottom: 60px;
-  }
-
-  .sider-nav-bar-wrap {
-    height: 100vh;
-    .logo {
-      /* height: 32px; */
-      margin: 16px;
-      text-align: center;
-    }
-    .sider-nav {
-      border-right: 0;
-      padding-bottom: 50px;
-    }
-  }
-}
-</style>
+<script setup lang="ts">
+import { ref, watch, computed } from "vue";
+import { RouterView } from "vue-router";
+import NavMenu from "@/components/NavMenu.vue";
+import Logo from "@/components/LogoComponent.vue";
+import { useSideBarStore } from "@/stores/side-bar";
+
+const sideBarStore = useSideBarStore();
+
+const brand = ref("技淘平台智慧产权大脑");
+
+const collapsed = computed(() => sideBarStore.collapsed);
+
+watch(
+  () => sideBarStore.collapsed,
+  (value: boolean) => {
+    brand.value = value ? "大脑" : "技淘平台智慧产权大脑";
+  }
+);
+</script>
+
+<template>
+  <a-layout class="layout">
+    <a-layout-sider
+      class="sider-nav-bar-wrap"
+      width="260"
+      theme="light"
+      v-model:collapsed="sideBarStore.collapsed"
+      collapsible
+    >
+      <div class="logo">
+        <Transition name="slide-fade">
+          <img src="@/assets/logo.png" width="50" v-if="collapsed" />
+          <img src="@/assets/logo.png" width="120" v-else />
+        </Transition>
+      </div>
+      <NavMenu class="sider-nav" />
+    </a-layout-sider>
+    <a-layout>
+      <a-layout-content class="main-content">
+        <RouterView />
+      </a-layout-content>
+    </a-layout>
+  </a-layout>
+</template>
+
+<style scoped lang="scss">
+.fade-enter-active,
+.fade-leave-active {
+  transition: opacity 0.2s ease;
+}
+
+.fade-enter-from,
+.fade-leave-to {
+  opacity: 0;
+}
+
+.layout {
+  background-color: #fff;
+  .main-content {
+    background-color: #fff;
+    border-left: 1px solid #f3f3f3;
+    min-width: 800px;
+    padding: 20px 40px;
+    padding-bottom: 60px;
+  }
+
+  .sider-nav-bar-wrap {
+    height: 100vh;
+    .logo {
+      /* height: 32px; */
+      margin: 16px;
+      text-align: center;
+    }
+    .sider-nav {
+      border-right: 0;
+      padding-bottom: 50px;
+    }
+  }
+}
+</style>

+ 51 - 51
src/views/report/ReportEditorView.vue

@@ -259,19 +259,19 @@ function duplicateCheck() {
   if (report.value) {
     extract(report.value.chapters, report.value.id +"")
   }
-  if (duplicateCheckRequest?.value) {
-    reportService.duplicateCheck(duplicateCheckRequest.value).then((data: any) => {
-      let index = 0;
-      for (let item of data.repetitiveRate) {
-        if (item && item > 0) {
-          chapterEditors.value[index]?.notifyRepetitiveWarning(true);
-        } else {
-          chapterEditors.value[index]?.notifyRepetitiveWarning(false);
-        }
-        index += 1;
+ if (duplicateCheckRequest?.value) {
+  reportService.duplicateCheck(duplicateCheckRequest.value).then((data: any) => {
+    let index = 0;
+    for (let item of data.repetitiveRate) {
+      if (item && item > 0) {
+        chapterEditors.value[index]?.notifyRepetitiveWarning(true);
+      } else {
+        chapterEditors.value[index]?.notifyRepetitiveWarning(false);
       }
-    })
-  }
+      index += 1;
+    }
+  })
+ }
 }
 
 function extract(chapters: ReportChapterRequest[], id: string) {
@@ -280,7 +280,7 @@ function extract(chapters: ReportChapterRequest[], id: string) {
     duplicateCheckRequest.value?.contents.push(chapters[i].content)
   }
   if (duplicateCheckRequest?.value) {
-    duplicateCheckRequest.value.reportId = id;
+      duplicateCheckRequest.value.reportId = id;
   }
 }
 
@@ -317,62 +317,62 @@ onUnmounted(() => {
     <a-col :span="12">
       <div class="metadata-wrap">
         <RelationCompanyInput
-            v-model:id="report.companyId"
-            @change="onCompanyChange"
-            ref="relationCompanyEl"
+          v-model:id="report.companyId"
+          @change="onCompanyChange"
+          ref="relationCompanyEl"
         />
         <ReportField
-            name="报告类型"
-            v-model="report.name"
-            :placeholder="placeholders[0]"
-            ref="reportCategoryEl"
+          name="报告类型"
+          v-model="report.name"
+          :placeholder="placeholders[0]"
+          ref="reportCategoryEl"
         />
         <ReportField
-            name="项目名称"
-            v-model="report.reportName"
-            :placeholder="placeholders[1]"
-            ref="reportNameEl"
+          name="项目名称"
+          v-model="report.reportName"
+          :placeholder="placeholders[1]"
+          ref="reportNameEl"
         />
         <ReportField
-            name="项目负责人"
-            v-model="report.supervisor"
-            :placeholder="placeholders[2]"
-            ref="supervisorEl"
+          name="项目负责人"
+          v-model="report.supervisor"
+          :placeholder="placeholders[2]"
+          ref="supervisorEl"
         />
         <ReportField
-            name="关键词"
-            v-model="report.keywords"
-            :placeholder="placeholders[3]"
-            ref="keywordsEl"
+          name="关键词"
+          v-model="report.keywords"
+          :placeholder="placeholders[3]"
+          ref="keywordsEl"
         />
         <DynamicMeta v-model:data="report.metadata" @change="onMetaChange" />
       </div>
     </a-col>
     <a-col :span="12">
       <LogoComponent
-          :title="report.reportName"
-          :list="chapterManager.getChapters()"
-          @change="onLogoChange"
-          @delete="onLogoDelete"
-          @ok="onChapterTypeSelected"
-          @one-touch="onNewChapterChange($event)"
-          :url="logoUrl"
+        :title="report.reportName"
+        :list="chapterManager.getChapters()"
+        @change="onLogoChange"
+        @delete="onLogoDelete"
+        @ok="onChapterTypeSelected"
+        @one-touch="onNewChapterChange($event)"
+        :url="logoUrl"
       />
     </a-col>
   </a-row>
   <a-divider />
   <div class="chapter-wrap" v-if="report">
     <ChapterEditor
-        v-for="(item, index) in chapterManager.getChapters()"
-        :key="index"
-        :title="report.reportName"
-        :data="item"
-        ref="chapterEditors"
-        :reportKeywords="report.keywords"
-        @change="onChapterChange(index, $event)"
-        @move-up="onChapterMoveUp(index)"
-        @move-down="onChapterMoveDown(index)"
-        @remove="onChapterRemove(index)"
+      v-for="(item, index) in chapterManager.getChapters()"
+      :key="index"
+      :title="report.reportName"
+      :data="item"
+      ref="chapterEditors"
+      :reportKeywords="report.keywords"
+      @change="onChapterChange(index, $event)"
+      @move-up="onChapterMoveUp(index)"
+      @move-down="onChapterMoveDown(index)"
+      @remove="onChapterRemove(index)"
     />
   </div>
   <div class="add-chapter-wrap">
@@ -395,8 +395,8 @@ onUnmounted(() => {
     </a-space>
   </div>
   <ChapterTypeSelect
-      @ok="onChapterTypeSelected"
-      v-model:visible="chapterTypeSelectVisible"
+    @ok="onChapterTypeSelected"
+    v-model:visible="chapterTypeSelectVisible"
   />
   <TemplateSaveModal ref="templateSaveModal" @ok="onSaveTemplate" />
 </template>

+ 5 - 5
src/views/report/components/ChapterTypeSelect.vue

@@ -46,11 +46,11 @@ function reset() {
 
 <template>
   <a-modal
-      :visible="visible"
-      title="选择章节类型"
-      :ok-button-props="{ disabled: checkedCategories.length == 0 }"
-      @ok="onOk"
-      @cancel="onCancel"
+    :visible="visible"
+    title="选择章节类型"
+    :ok-button-props="{ disabled: checkedCategories.length == 0 }"
+    @ok="onOk"
+    @cancel="onCancel"
   >
     <a-checkbox-group v-model:value="checkedCategories" name="checkboxgroup">
       <div v-for="(item, index) in categoryOptions" :key="index" class="category-item">

+ 72 - 72
src/views/report/components/LogoComponent.vue

@@ -131,67 +131,67 @@ function test1() {
     duration: 0,
   });
   aiService
-      .generatePlus(props.title, chapterTitle)
-      .then((resp) => {
-        // return;
-        const obj: any = resp;
-        if (props.list.length == 0) {
-          let list: any = [
-            {
-              title: "立项背景与意义",
-              fullTitle: "",
-              content: "",
-              chapterType: "BACKGROUND",
-              keywords: [],
-            },
-            {
-              title: "国内外研究现状与发展趋势",
-              fullTitle: "",
-              content: "",
-              chapterType: "RESEARCH_STATUS",
-              keywords: [],
-            },
-            {
-              title: "项目主要研究内容",
-              fullTitle: "",
-              content: "",
-              chapterType: "RESEARCH",
-              keywords: [],
-            },
-          ];
-          for (let item of list) {
-            const key: string = item.title;
-            onContentChange({
-              title: "",
-              fullTitle: "",
-              content: marked.parse(obj[key]),
-              chapterType: item.chapterType,
-              keywords: [],
-            });
-          }
-        } else {
-          for (let item of props.list) {
-            const key: string = item.title;
-            onContentChange({
-              title: item.title,
-              fullTitle: item.fullTitle,
-              content: marked.parse(obj[key]),
-              chapterType: item.chapterType,
-              keywords: item.keywords,
-            });
-          }
+    .generatePlus(props.title, chapterTitle)
+    .then((resp) => {
+      // return;
+      const obj: any = resp;
+      if (props.list.length == 0) {
+        let list: any = [
+          {
+            title: "立项背景与意义",
+            fullTitle: "",
+            content: "",
+            chapterType: "BACKGROUND",
+            keywords: [],
+          },
+          {
+            title: "国内外研究现状与发展趋势",
+            fullTitle: "",
+            content: "",
+            chapterType: "RESEARCH_STATUS",
+            keywords: [],
+          },
+          {
+            title: "项目主要研究内容",
+            fullTitle: "",
+            content: "",
+            chapterType: "RESEARCH",
+            keywords: [],
+          },
+        ];
+        for (let item of list) {
+          const key: string = item.title;
+          onContentChange({
+            title: "",
+            fullTitle: "",
+            content: marked.parse(obj[key]),
+            chapterType: item.chapterType,
+            keywords: [],
+          });
         }
-        // onContentChange(marked.parse(resp));
-        if (loadingHandler) {
-          loadingHandler();
+      } else {
+        for (let item of props.list) {
+          const key: string = item.title;
+          onContentChange({
+            title: item.title,
+            fullTitle: item.fullTitle,
+            content: marked.parse(obj[key]),
+            chapterType: item.chapterType,
+            keywords: item.keywords,
+          });
         }
-      })
-      .catch((err) => {
-        console.log("err", err);
-        if (loadingHandler) {
-          loadingHandler();
-        }
-      });
+      }
+      // onContentChange(marked.parse(resp));
+      if (loadingHandler) {
+        loadingHandler();
+      }
+    })
+    .catch((err) => {
+      console.log("err", err);
+      if (loadingHandler) {
+        loadingHandler();
+      }
+    });
 }
 </script>
 
@@ -199,14 +199,14 @@ function test1() {
   <a-row>
     <a-col>
       <a-upload
-          v-model:file-list="fileList"
-          name="avatar"
-          list-type="picture-card"
-          class="logo-uploader"
-          :show-upload-list="false"
-          action="/"
-          :before-upload="beforeUpload"
-          @change="handleChange"
+        v-model:file-list="fileList"
+        name="avatar"
+        list-type="picture-card"
+        class="logo-uploader"
+        :show-upload-list="false"
+        action="/"
+        :before-upload="beforeUpload"
+        @change="handleChange"
       >
         <img width="104" v-if="url" :src="url" alt="企业Logo" />
         <div v-else>
@@ -221,11 +221,11 @@ function test1() {
         <div style="flex: 1">请按需上传企业logo<br />仅支持 jpg. png. 格式图片</div>
         <div>
           <a-popconfirm
-              title="确定删除此Logoo?"
-              ok-text="确定"
-              cancel-text="取消"
-              @confirm="onDelete"
-              placement="topRight"
+            title="确定删除此Logoo?"
+            ok-text="确定"
+            cancel-text="取消"
+            @confirm="onDelete"
+            placement="topRight"
           >
             <a-button :disabled="!url"><delete-outlined /></a-button>
           </a-popconfirm>

+ 12 - 12
src/views/search/components/EmptySearchResult.vue

@@ -1,12 +1,12 @@
-<script setup lang="ts">
-defineProps({
-  keyword: {
-    type: String,
-    required: true
-  }
-});
-</script>
-
-<template>
-  <div>没有找到关键词 {{ keyword }} 的搜索结果</div>
-</template>
+<script setup lang="ts">
+defineProps({
+  keyword: {
+    type: String,
+    required: true
+  }
+});
+</script>
+
+<template>
+  <div>没有找到关键词 {{ keyword }} 的搜索结果</div>
+</template>

+ 36 - 36
src/views/search/components/SearchResultList.vue

@@ -1,36 +1,36 @@
-<script setup lang="ts">
-import { computed, type PropType } from "vue";
-import SearchResultItem from "./SearchResultItem.vue";
-import type { SearchResult } from "@/types/search.types";
-import type { ResultMode } from "@/types/search.types";
-
-const props = defineProps({
-  data: {
-    type: Object as PropType<SearchResult>,
-    required: true,
-  },
-  mode: {
-    type: String as PropType<ResultMode>,
-    default() { return 'detail' },
-  }
-});
-
-const docSize = computed(() => props.data.docs.length);
-</script>
-
-<template>
-  <div class="search-result-content">
-    <div v-for="(doc, index) in data.docs" :key="index">
-      <SearchResultItem :data="doc" :mode="mode" />
-      <a-divider v-if="index < docSize - 1" />
-    </div>
-  </div>
-</template>
-
-<style scoped lang="scss">
-.search-result-content {
-  background-color: #ffffff;
-  margin-top: 8px;
-  padding: 10px;
-}
-</style>
+<script setup lang="ts">
+import { computed, type PropType } from "vue";
+import SearchResultItem from "./SearchResultItem.vue";
+import type { SearchResult } from "@/types/search.types";
+import type { ResultMode } from "@/types/search.types";
+
+const props = defineProps({
+  data: {
+    type: Object as PropType<SearchResult>,
+    required: true,
+  },
+  mode: {
+    type: String as PropType<ResultMode>,
+    default() { return 'detail' },
+  }
+});
+
+const docSize = computed(() => props.data.docs.length);
+</script>
+
+<template>
+  <div class="search-result-content">
+    <div v-for="(doc, index) in data.docs" :key="index">
+      <SearchResultItem :data="doc" :mode="mode" />
+      <a-divider v-if="index < docSize - 1" />
+    </div>
+  </div>
+</template>
+
+<style scoped lang="scss">
+.search-result-content {
+  background-color: #ffffff;
+  margin-top: 8px;
+  padding: 10px;
+}
+</style>

+ 4 - 1
vite.config.ts

@@ -13,10 +13,13 @@ export default defineConfig({
     },
   },
   server: {
+    //
+    host: '0.0.0.0',
     port: 5274,
     proxy: {
       '/gw': {
-        target: 'http://localhost:8088',
+        // target: 'http://localhost:8088',
+        target: 'http://172.16.1.199:8088',
         changeOrigin: true,
       }
     }