Kevin 2 years ago
parent
commit
3a8bb1ff86

+ 5 - 0
src/views/report/ReportListView.vue

@@ -130,6 +130,11 @@ function onReportDelete(id: number) {
     message.success('删除报告失败')
   })
 }
+function serialNumber(index: number) {
+  index += 1;
+  return (currentPage.value - 1) * 10 + index;
+}
+
 
 function serialNumber(index: number) {
   index += 1;

+ 1 - 1
src/views/report/components/report-list/ReportItem.vue

@@ -34,7 +34,7 @@ function onDelete(id: number) {
   <a-card size="small">
     <template #title>
       <RouterLink class="title-link" :to="{ name: 'ReportEditor', params: { id: data.id } }">
-        <span class="text-black"> {{  serialNumber }}. </span>
+        <span class="text-black"> {{ serialNumber }}. </span>
         <span v-if="data.companyName" class="text-black"> {{  data.companyName }}</span>
         <span v-else class="text-red">无关联企业</span>
         <span class="text-black"> - </span>

+ 19 - 1
src/views/search/SearchResultView.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { onUnmounted, ref, computed, type Ref, onMounted, reactive, h } from "vue";
+import { onUnmounted, ref, computed, type Ref, onMounted, reactive, h, watch } from "vue";
 import { useRoute } from "vue-router";
 import { LoadingOutlined } from '@ant-design/icons-vue';
 import { useSideBarStore } from "@/stores/side-bar";
@@ -30,6 +30,7 @@ const keyword = ref("");
 const field = ref("TP");
 // 排序
 const sort: Ref<Sort> = ref("Relevance");
+const placeholder = ref("请输入文献主题") 
 
 const pagination = reactive({
   page: 1,
@@ -271,6 +272,22 @@ function onUnitFilterChange(selected: string[]) {
   doSearch()
 }
 
+watch(field, (newValue) => {
+  if (newValue == 'TI') {
+    placeholder.value = "请输入文献标题"
+  } else if (newValue == 'AU') {
+    placeholder.value = "请输入文献作者"
+  } else if (newValue == 'KW') {
+    placeholder.value = "请输入文献关键词"
+  } else if (newValue == 'AB') {
+    placeholder.value = "请输入文献摘要"
+  } else if (newValue == 'UN') {
+    placeholder.value = "请输入文献机构"
+  } else {
+    placeholder.value = "请输入文献主题"
+  }
+});
+
 onUnmounted(() => {
   sideBarStore.setCollapse(false);
 });
@@ -282,6 +299,7 @@ onUnmounted(() => {
       <SearchBox
         v-model:keyword="keyword"
         v-model:field="field"
+        :placeholder="placeholder"
         @search="onSimpleSearch"
         @update:field="changeField"
         @update:keyword="changKeyword"

+ 3 - 0
src/views/search/SearchView.vue

@@ -23,6 +23,7 @@ const fieldOptions = ref<SelectProps['options']>([
   { value: 'AU', label: '作者' },
   { value: 'KW', label: '关键词' },
   { value: 'AB', label: '摘要' },
+  { value: 'UN', label: '机构' },
 ]);
 
 watch(field, (newValue) => {
@@ -34,6 +35,8 @@ watch(field, (newValue) => {
     placeholder.value = "请输入文献关键词"
   } else if (newValue == 'AB') {
     placeholder.value = "请输入文献摘要"
+  } else if (newValue == 'UN') {
+    placeholder.value = "请输入文献机构"
   } else {
     placeholder.value = "请输入文献主题"
   }

+ 7 - 1
src/views/search/components/SearchBox.vue

@@ -10,6 +10,10 @@ const props = defineProps({
   field: {
     type: String,
     required: true,
+  },
+  placeholder: {
+    type: String,
+    required: true,
   }
 });
 
@@ -25,6 +29,8 @@ const fieldOptions = ref<SelectProps['options']>([
   { value: 'TI', label: '标题', },
   { value: 'AU', label: '作者', },
   { value: 'KW', label: '关键词', },
+  { value: 'AB', label: '摘要' },
+  { value: 'UN', label: '机构' },
 ]);
 
 function onSearch() {
@@ -62,7 +68,7 @@ function onFieldChange(value: string) {
     <a-col flex="1">
       <a-input-search
         :value="keyword"
-        placeholder="请输入关键词进行搜索"
+        :placeholder="placeholder"
         enter-button="搜&nbsp;&nbsp;索"
         size="large"
         @change="onKeywordChange"