Browse Source

feature/1001815

lizi 2 years ago
parent
commit
a7aa1e8164

+ 10 - 1
src/views/report/components/reference/ReferenceDraw.vue

@@ -111,12 +111,20 @@ function onSectionRecordUse(sectionId: number) {
   })
 }
 
-function onSectionRecordCancel(sectionId: number) {
+function onSectionRecordCancel(sectionId: number) { 
   paperSectionService.cancel(sectionId).then(() => {
     paperSectionUsage.value[`${sectionId}`] = false
   })
 }
 
+function serialNumber(index) {
+  index ++;
+  if (pagination.page == 1) {
+    return index
+  }
+  return pagination.page * pagination.size + index;
+}
+
 const onClose = () => {
   visible.value = false;
   emits("close")
@@ -158,6 +166,7 @@ defineExpose({
         <ReferenceSearchResultItem
           :data="item"
           :used="paperSectionUsage[item.id] || false"
+          :serialNumber="serialNumber(index)"
           @insert="emits('insert', $event)"
           @record-use="onSectionRecordUse"
           @record-cancel="onSectionRecordCancel"

+ 11 - 5
src/views/report/components/reference/ReferenceSearchResultItem.vue

@@ -13,6 +13,10 @@ const props = defineProps({
   used: {
     type: Boolean,
     required: false,
+  },
+  serialNumber: {
+    type: Number,
+    required: true,
   }
 });
 
@@ -58,10 +62,9 @@ function onInsertion() {
 </script>
 
 <template>
-  <h3>{{ data.title }}</h3>
-  <h4 class="section-title" v-html="data.section"></h4>
+  <h3>{{serialNumber}}. {{ data.title }}</h3>
   <div class="meta">
-    <a-space>
+    <a-space style="row-gap: 0px;column-gap: 8px;">
       <span v-if="data.journalName">期刊名称:{{ data.journalName }}</span> <br />
       <span v-if="data.year">时间:{{ data.year }}</span>
       <span v-for="(item, index) in data.unitScholars" :key="index">
@@ -69,6 +72,7 @@ function onInsertion() {
       </span>
     </a-space>
   </div>
+  <h4 class="section-title" v-html="data.section"></h4>
   <div class="content-wrap" :class="{'used': used}">
     <exclamation-circle-filled v-if="used" />
     <span class="content" v-html="data.content"></span>
@@ -84,15 +88,17 @@ function onInsertion() {
 </template>
 
 <style scoped lang="scss">
+.meta .ant-space {
+  flex-wrap: wrap;
+}
 .section-title {
+  margin: 4px 0 4px 0;
   :deep em {
     color: red;
     font-style: normal;
   }
 }
 .content-wrap {
-  margin-top: 0.5em;
-
   &.used {
     color: #bebebe;
   }