Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

wwj 4 mesiacov pred
rodič
commit
37f906f595

BIN
public/favicon.ico


BIN
public/logo.gif


+ 4 - 1
src/api/museums/specimeninfo/index.ts

@@ -40,7 +40,10 @@ export const SpecimenInfoApi = {
   getSpecimenInfoPage: async (params: any) => {
     return await request.get({ url: `/museums/specimen-info/page`, params })
   },
-
+//查询标本记录
+  getStustusInfo: async (specimenId: any) => {
+    return await request.get({ url: `/museums/specimen-info/logs?specimenId=` + specimenId + '&moduleType=MUSEUMS 标本'})
+  },
   // 查询标本管理详情
   getSpecimenInfo: async (id: number) => {
     return await request.get({ url: `/museums/specimen-info/get?id=` + id })

+ 1 - 0
src/layout/components/Footer/src/Footer.vue

@@ -16,6 +16,7 @@ const title = computed(() => appStore.getTitle)
 
 <template>
   <div
+    style="line-height: 12px"
     :class="prefixCls"
     class="h-[var(--app-footer-height)] bg-[var(--app-content-bg-color)] text-center leading-[var(--app-footer-height)] text-[var(--el-text-color-placeholder)] dark:bg-[var(--el-bg-color)] overflow-hidden"
   >

+ 6 - 6
src/views/Home/Index.vue

@@ -136,23 +136,23 @@
       <el-row>
         <el-col :xl="9" :lg="9" :md="12" :sm="24" :xs="24">
 
-          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 410px;">
+          <el-card shadow="hover" class="mr-5px" style="height: 390px;">
             <div class="title"><img src="/@/assets/imgs/tj3.png" alt="" /><span>历年标本数量统计</span></div>
 
             <el-skeleton :loading="loading" animated>
-              <Echart :options="yearOptionsData" :height="340" />
+              <Echart :options="yearOptionsData" :height="320" />
             </el-skeleton>
           </el-card>
           <!-- 历年标本来源增减统计 -->
 
         </el-col>
         <el-col :xl="9" :lg="9" :md="12" :sm="24" :xs="24">
-          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 410px;">
+          <el-card shadow="hover" class="mr-5px " style="height: 390px;">
 
             <div class="title"><img src="/@/assets/imgs/tj3.png" alt="" /><span>历年标本来源增减统计</span></div>
 
             <el-skeleton :loading="loading" animated>
-              <Echart :options="originOptionsData" :height="340" />
+              <Echart :options="originOptionsData" :height="320" />
             </el-skeleton>
           </el-card>
           <!-- 历年标本来源增减统计 -->
@@ -161,9 +161,9 @@
         <!-- 本年标本回库 -->
         <el-col :xl="6" :lg="6" :md="24" :sm="24" :xs="24">
 
-          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 410px;">
+          <el-card shadow="hover" class="mr-5px " style="height: 390px;">
             <div class="title"><img src="/@/assets/imgs/tj3.png" alt="" /><span>按标本类型统计</span></div>
-            <Echart :options="pieOptionsData" :height="340" />
+            <Echart :options="pieOptionsData" :height="320" />
 
           </el-card>
         </el-col>

+ 1 - 2
src/views/museums/museumsdocument/index.vue

@@ -305,8 +305,7 @@ const handleExport = async () => {
       console.log("photo",photo)
       const response = await fetch(photo.url);
       const blob = await response.blob();
-      const extension = photo.url.split('.').pop() // 获取文件扩展名
-      zip.file(`${photo.id}.${extension}`, blob)
+      zip.file(`${photo.name}`, blob)
     });
 
     await Promise.all(promises);

+ 1 - 0
src/views/museums/photogroup/PhotosIndex.vue

@@ -238,6 +238,7 @@ const handleExport = async () => {
 
     const zip = new JSZip();
     const promises = selectedPhotos.value.map(async (photo) => {
+      console.log("photo",photo)
       const response = await fetch(photo.photoUrl);
       const blob = await response.blob();
       const extension = photo.photoUrl.split('.').pop() // 获取文件扩展名

+ 145 - 4
src/views/museums/specimeninfo/index.vue

@@ -323,7 +323,7 @@
           @click="handleImport"
           v-hasPermi="['museums:specimen-info:import']"
         >
-          <Icon icon="ep:upload" /> 批量导入
+          <Icon icon="ep:download" /> 批量导入
         </el-button>
         <el-button
           type="success"
@@ -331,7 +331,15 @@
           @click="handleExport"
           :loading="exportLoading"
         >
-          <Icon icon="ep:download" class="mr-5px" /> 导出
+          <Icon icon="ep:upload" class="mr-5px" /> 导出
+        </el-button>
+        <el-button
+          type="success"
+          plain
+          @click="labelExport"
+          :loading="exportLoading"
+        >
+          <Icon icon="ep:upload" class="mr-5px" /> 制作标签
         </el-button>
       </el-form-item>
     </el-form>
@@ -341,9 +349,10 @@
   <ContentWrap>
     <el-segmented  block  v-model="queryParams.specimenType" :options="options" size="large"  @update:modelValue="handleSegmentedChange"/>
 
-    <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
-
+    <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" />
 <!--      <el-table-column label="序号" align="center" prop="id" />-->
+
       <el-table-column label="标本编号" align="center" prop="specimenNumber" />
       <el-table-column label="中文名称" align="center" prop="chineseName" />
 
@@ -456,6 +465,23 @@
     />
   </ContentWrap>
 
+<!--  制作标签弹窗-->
+  <el-dialog v-model="dialogTableVisible" title="标签制作" width="800">
+    <div>
+      <el-form :model="form" label-width="auto" style="max-width: 600px">
+      <el-form-item label="Activity zone">
+        <el-select v-model="form.region" placeholder="please select your zone">
+          <el-option
+            v-for="item in optionsLabel"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      </el-form>
+    </div>
+  </el-dialog>
   <!-- 表单弹窗:添加/修改 -->
   <SpecimenInfoForm ref="formRef" @success="getList" />
   <SpecimenImportForm ref="importFormRef" @success="getList" />
@@ -613,7 +639,121 @@ const handleExport = async () => {
     exportLoading.value = false
   }
 }
+//字段类型
+const optionsLabel = [
+  {
+    value: 'specimenNumber',
+    label: '标本编号',
+  },
+  {
+    value: 'chineseName',
+    label: '中文名称',
+  },
+  {
+    value: 'specimenType',
+    label: '标本类型',
+  },
+  {
+    value: 'storageLocation',
+    label: '存放位置',
+  },
+  {
+    value: 'englishName',
+    label: '英文名称',
+  },
+
+  {
+    value: 'composition',
+    label: '成分',
+  },
+  {
+    value: 'origin',
+    label: '产地',
+  },
+  {
+    value: 'era',
+    label: '时代',
+  },
+  {
+    value: 'preservedLayer',
+    label: '保存地层',
+  },
+  {
+    value: 'meteoriteType',
+    label: '陨石类型',
+  },
+
+  {
+    value: 'internationalName',
+    label: '国际命名',
+  },
+  {
+    value: 'preservationType',
+    label: '保存类型',
+  },
+  {
+    value: 'size',
+    label: '尺寸',
+  },
+  {
+    value: 'preservationType',
+    label: '保存类型',
+  },
+  {
+    value: 'weight',
+    label: '重量',
+  },
+  {
+    value: 'source',
+    label: '来源',
+  },
+  {
+    value: 'provider',
+    label: '标本提供者',
+  },
+
+  {
+    value: 'purpose',
+    label: '用途',
+  },
+
+  {
+    value: 'source',
+    label: '来源',
+  },
+  {
+    value: 'provider',
+    label: '标本提供者',
+  },
+
+]
+
 
+
+const selectedlabel = ref<any[]>([]) // 选中的标本
+const dialogTableVisible = ref(false) //弹窗开关
+/** 处理选中变化 */
+const handleSelectionChange = (selection: any[]) => {
+  selectedlabel.value = selection
+}
+/** 导出标签操作 */
+const labelExport = async () => {
+  try {
+    // 导出的二次确认
+    await message.exportConfirm()
+    // 发起导出
+    exportLoading.value = true
+    if (selectedlabel.value.length === 0) {
+      message.warning('请勾选要制作标签的标本')
+      return
+    }
+    dialogTableVisible.value = true
+
+  } catch {
+  } finally {
+    exportLoading.value = false
+  }
+}
 /** 初始化 **/
 onMounted(() => {
   getList()
@@ -623,6 +763,7 @@ onMounted(() => {
 /** 查看页面 **/
 import { useRouter } from 'vue-router';
 import UserImportForm from "@/views/system/user/UserImportForm.vue";
+import {ref} from "vue";
 const router = useRouter();
 const viewDetails=(dataId: number) => {
   router.push({

+ 29 - 56
src/views/museums/specimeninfo/specimenDetails.vue

@@ -156,22 +156,22 @@
           </div>
         </template>
         <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" class="mb-8px">
-          <div class="demo-image__preview" v-if="specimenData ">
+          <div v-if="specimenData.imagePath && specimenData.imagePath.length">
+          <div class="demo-image__preview">
             <el-image
-
               style=" align-items: center"
               :src="specimenData.imagePath[0]"
               :zoom-rate="1.2"
               :max-scale="7"
               :min-scale="0.2"
-              :preview-src-list="specimenData.imagePaths"
+              :preview-src-list="specimenData.imagePath"
               :initial-index="index"
               fit="cover"
             />
           </div>
 
           <div>
-            <el-space style="margin-top: 10px"  v-if="specimenData ">
+            <el-space style="margin-top: 10px" >
               <div class="demo-image__preview" v-for="(url, index) in specimenData.imagePath"
                    :key="index">
                 <el-image
@@ -185,8 +185,10 @@
                   fit="cover"
                 />
               </div>
-      </el-space>
+            </el-space>
+          </div>
           </div>
+            <el-empty v-else  description="暂无图片" />
         </el-col>
 
 
@@ -195,40 +197,23 @@
         <template #header>
           <div class="card-header" >
             <h1 class="text1" style="margin-bottom: 10px">馆藏状态</h1>
-            <span v-if="specimenRecord">{{collectionStatusText}}</span>
           </div>
         </template>
         <el-scrollbar height="600px">
           <el-timeline style="max-width: 600px;margin-left: 15px" >
             <el-timeline-item
-              v-for="(item, index) in specimenData"
-              :key="index"
-              :timestamp="item.outgoingTime"
-              placement="top">
-              <el-card>
-                <p>{{  }}</p>
-                <p>状态:{{  }}</p>
-                <p>申请人或单位:{{item.applicantName }}</p>
-                <p>用途:{{item.applicationUsage}}</p>
-                <p>审批员:{{item.approveUsers}}</p>
-                <p>审批时间:{{}}</p>
-                <p>出库员:{{ item.operator }}</p>
-              </el-card>
-            </el-timeline-item>
-            <el-timeline-item
-              v-for="(item, index) in specimenData"
+              v-for="(item, index) in stustuss"
               :key="index"
-              :timestamp="item.acquisitionTime"
-              placement="top">
+              type="primary"
+              :hollow = "true"
+            >
+              <h4>{{formatDate(item.createTime) }}</h4>
               <el-card>
-                <p>回库</p>
-                <p>退还人:{{ item.operator }}</p>
-                <p>点收人:{{item.applicationUsage}}</p>
-                <p>退还日期:{{item.approveUsers}}</p>
-                <p>标本情况:{{}}</p>
+                <h4>操作状态:{{item.subType}}</h4>
+                <div style="line-height: 30px">操作人:{{ item.userName}}</div>
+                <div style="line-height: 20px">操作内容:{{item.action}}</div>
               </el-card>
             </el-timeline-item>
-
           </el-timeline>
         </el-scrollbar>
       </el-card>
@@ -253,8 +238,10 @@ const router = useRouter() // 路由
 const {query} = useRoute() // 查询参数
 import type {ComponentSize} from 'element-plus'
 import {formatDate} from "@/utils/formatTime";
-
-
+const stustuss = ref()
+const specimenData = ref({
+  imagePath:[]
+}); // 初始化响应式数据
 const size = ref<ComponentSize>('large')
 
 
@@ -265,30 +252,26 @@ const srcList = ref([])
 
 
 
-let specimenData = ref(null); // 初始化响应式数据
+
 const fetchData = async () => {
+  loading.value = true
   try {
     console.log(query.dataId)
     let res: any = await SpecimenInfoApi.getSpecimenInfo(query.dataId)
+    const stutus = await SpecimenInfoApi.getStustusInfo(query.dataId)
+    stustuss.value = stutus
+    console.log('stustuss',stustuss.value)
     console.log(res)
     res.discoveryTime = formatDate(res.discoveryTime)
     res.fallTime = formatDate(res.fallTime)
     res.acquisitionTime = formatDate(res.acquisitionTime)
-
-
     specimenData.value = res
     console.log(specimenData.value)
   }  finally {
+    loading.value = false
   }
 }
 
-// // 在组件加载时获取数据
-onMounted(async () => {
-  console.log(1)
-  await fetchData()
-
-
-})
 
 
 /**标本类型**/
@@ -325,20 +308,6 @@ const preservationTypeText = computed(() => {
       return '';
   }
 });
-/**来源**/
-const collectionStatusText = computed(() => {
-  if (specimenData.value === null) {
-    return '';
-  }
-  switch (specimenData.value.collectionStatus) {
-    case 0:
-      return '在馆';
-    case 1:
-      return '借出';
-    default:
-      return '';
-  }
-});
 /**馆藏状态(在馆、借出)**/
 const sourceText = computed(() => {
   if (specimenData.value === null) {
@@ -356,6 +325,10 @@ const sourceText = computed(() => {
   }
 });
 
+// // 在组件加载时获取数据
+onMounted(async () => {
+  await fetchData()
+})
 
 </script>