瀏覽代碼

Merge remote-tracking branch 'origin/master'

lmm 4 月之前
父節點
當前提交
7b39489bf7

+ 1 - 1
.env

@@ -1,5 +1,5 @@
 # 标题
-VITE_APP_TITLE=标本管理系统
+VITE_APP_TITLE=地质博物馆标本管理系统
 
 # 项目本地运行端口号
 VITE_PORT=80

+ 27 - 9
src/api/museums/museumsdocument/index.ts

@@ -1,5 +1,6 @@
 import request from '@/config/axios'
 
+
 // 博物馆文件管理 VO
 export interface DocumentVO {
   id: number // 主键
@@ -13,21 +14,21 @@ export interface DocumentVO {
   uploadedBy: string // 上传者
 }
 
-// 博物馆文件管理 API
+//博物馆文件管理 API
 export const DocumentApi = {
   // 查询博物馆文件管理分页
   getDocumentPage: async (params: any) => {
-    return await request.get({ url: `/museums/document/page`, params })
+    return await request.get({ url: `/infra/file/page/another`, params })
   },
 
   // 查询博物馆文件管理详情
   getDocument: async (id: number) => {
     return await request.get({ url: `/museums/document/get?id=` + id })
   },
-
-  // 新增博物馆文件管理
-  createDocument: async (data: DocumentVO) => {
-    return await request.post({ url: `/museums/document/create`, data })
+  //
+  // // 新增博物馆文件管理
+  createDocument: async (data: any) => {
+    return await request.post({ url: `/infra/file/create`, data })
   },
 
   // 修改博物馆文件管理
@@ -37,11 +38,28 @@ export const DocumentApi = {
 
   // 删除博物馆文件管理
   deleteDocument: async (id: number) => {
-    return await request.delete({ url: `/museums/document/delete?id=` + id })
+    return await request.delete({ url: `/infra/file/delete?id=` + id })
   },
 
   // 导出博物馆文件管理 Excel
   exportDocument: async (params) => {
     return await request.download({ url: `/museums/document/export-excel`, params })
-  }
-}
+  },
+  // 上传博物馆文件
+  updateFile: async (data: any) => {
+    return await request.download({ url: `/infra/file/upload`, data  })
+  },
+}
+// 新增博物馆文件管理
+// export const createDocument = (data: any) => {
+//   return request.post({ url: '/infra/file/create', data })
+// }
+
+
+// 获取文件预签名地址
+export const Document = (path: string) => {
+  return request.get<DocumentVO>({
+    url: '/infra/file/presigned-url',
+    params: { path }
+  })
+}

+ 2 - 0
src/components/UploadFile/src/useUpload.ts

@@ -71,6 +71,8 @@ function createFile(vo: FileApi.FilePresignedUrlRespVO, name: string, file: Uplo
   return fileVo
 }
 
+
+
 /**
  * 生成文件名称(使用算法SHA256)
  * @param file 要上传的文件

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

@@ -19,6 +19,6 @@ const title = computed(() => appStore.getTitle)
     :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"
   >
-    <span class="text-14px">Copyright ©2022-{{ title }}</span>
+    <span class="text-14px">Copyright ©2024-{{ title }} &nbsp;技术支持:桂林壹斗米信息科技有限公司</span>
   </div>
 </template>

+ 1 - 1
src/router/modules/remaining.ts

@@ -636,7 +636,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
           hidden: true,
           canTo: true,
           title: '查看标本详情',
-          activeMenu: '/crm/specimen-info'
+          activeMenu: '/museums/specimen-info'
         }
       },
       {

+ 1 - 1
src/utils/dict.ts

@@ -233,6 +233,6 @@ export enum DICT_TYPE {
   MUSEUMS_COLLECTION_STATUS='museums_collection_status',//标本馆藏状态
   MUSEUMS_SOURCE='museums_source',//博物馆标本来源
   MUSEUMS_SPECIMEN_TYPE='museums_specimen_type',//博物馆标本类型
-  MUSEUMS_APPROAL_STATUS='museums_approal_status',//
+  MUSEUMS_APPROAL_STATUS='museums_approal_status',//博物馆标本审批状态
 
 }

+ 23 - 203
src/views/Home/Index.vue

@@ -61,7 +61,7 @@
       <el-row>
         <!-- 本年标本出库 -->
         <el-col :xl="5" :lg="5" :md="12" :sm="24" :xs="24">
-          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 400px;">
+          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 300px;">
             <div class="title"><img style="width: 25px;height: 25px;" src="/@/assets/imgs/ck5.png"
                 alt="" /><span>本月出库数</span></div>
             <div class="specimen-month">
@@ -72,7 +72,7 @@
                 </div>
               </div>
               <div class="month1">
-                <Echart :options="outRatioOptionsData" :height="300" :width="'140%'" />
+                <Echart :options="outRatioOptionsData" :height="200" :width="'140%'" />
               </div>
             </div>
           </el-card>
@@ -81,7 +81,7 @@
         <!-- 本年标本入库 -->
         <el-col :xl="5" :lg="5" :md="12" :sm="24" :xs="24">
 
-          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 400px;">
+          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 300px;">
             <div class="title"><img style="width: 30px;height: 30px;" src="/@/assets/imgs/rk3.png"
                 alt="" /><span>本月入库数</span></div>
             <div class="specimen-month">
@@ -92,7 +92,7 @@
                 </div>
               </div>
               <div class="month1">
-                <Echart :options="enterRatioOptionsData" :height="300" :width="'140%'" />
+                <Echart :options="enterRatioOptionsData" :height="200" :width="'140%'" />
               </div>
             </div>
           </el-card>
@@ -101,7 +101,7 @@
         <!-- 本年标本回库 -->
         <el-col :xl="5" :lg="5" :md="12" :sm="24" :xs="24">
 
-          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 400px;">
+          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 300px;">
             <div class="title"><img style="width: 25px;height: 25px;" src="/@/assets/imgs/hk2.png"
                 alt="" /><span>本月回库数</span></div>
             <div class="specimen-month">
@@ -112,18 +112,18 @@
                 </div>
               </div>
               <div class="month1">
-                <Echart :options="returnRatioOptionsData" :height="300" :width="'140%'" />
+                <Echart :options="returnRatioOptionsData" :height="200" :width="'140%'" />
               </div>
             </div>
           </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: 400px;">
+          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 300px;">
 
             <div class="title"><img src="/@/assets/imgs/tj3.png" alt="" /><span>本年标本数量统计</span></div>
 
             <el-skeleton :loading="loading" animated>
-              <Echart :options="mouthOptionsData" :height="300" />
+              <Echart :options="mouthOptionsData" :height="230" />
             </el-skeleton>
           </el-card>
           <!-- 历年标本来源增减统计 -->
@@ -136,7 +136,7 @@
       <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: 430px;">
+          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 410px;">
             <div class="title"><img src="/@/assets/imgs/tj3.png" alt="" /><span>历年标本数量统计</span></div>
 
             <el-skeleton :loading="loading" animated>
@@ -147,12 +147,12 @@
 
         </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: 430px;">
+          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 410px;">
 
             <div class="title"><img src="/@/assets/imgs/tj3.png" alt="" /><span>历年标本来源增减统计</span></div>
 
             <el-skeleton :loading="loading" animated>
-              <Echart :options="originOptions111Data" :height="340" />
+              <Echart :options="originOptionsData" :height="340" />
             </el-skeleton>
           </el-card>
           <!-- 历年标本来源增减统计 -->
@@ -161,7 +161,7 @@
         <!-- 本年标本回库 -->
         <el-col :xl="6" :lg="6" :md="24" :sm="24" :xs="24">
 
-          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 430px;">
+          <el-card shadow="hover" class="mr-5px mt-5px" style="height: 410px;">
             <div class="title"><img src="/@/assets/imgs/tj3.png" alt="" /><span>按标本类型统计</span></div>
             <Echart :options="pieOptionsData" :height="340" />
 
@@ -174,17 +174,9 @@
 
 </template>
 <script lang="ts" setup>
-import { set } from 'lodash-es'
 import { EChartsOption } from 'echarts'
-// import { formatTime } from '@/utils'
-import * as echarts from 'echarts';
-import Echarts from '/@/components/Echarts/index.vue';
-
-import { useUserStore } from '@/store/modules/user'
-import { useWatermark } from '@/hooks/web/useWatermark'
-import type { WorkplaceTotal, Project, Shortcut } from './types'
-import { pieOptions, barOptions, barOptions1, outOptions, enterOptions, backOptions, yearOptions, originOptions, enterRatioOptions, originOptions111, mouthOptions, outRatioOptions, returnRatioOptions } from './echarts-data'
-// import MyChart from '/@/components/Echarts/echarts.vue';
+import type { WorkplaceTotal } from './types'
+import { pieOptions,  yearOptions, enterRatioOptions, originOptions, mouthOptions, outRatioOptions, returnRatioOptions } from './echarts-data'
 defineOptions({ name: 'Home' })
 
 
@@ -214,15 +206,13 @@ onMounted(async () => {
   fossilCount.value = samples['化石'];
   meteoriteCount.value = samples['陨石'];
   rockOreCount.value = samples['岩石矿石'];
-
-
+  
   const month = `${new Date().getMonth() + 1}月`
   console.log('month', month);
   const enterSpecimen = ref();
   const outSpecimen = ref();
   const returnSpecimen = ref();
   const year = new Date().getFullYear()
-  // 使用 await 获取数据
   //本月出、入、回库数
   enterSpecimen.value = await WorkbenchApi.getEnterSpecimenList(year);
   outSpecimen.value = await WorkbenchApi.getOutSpecimenList(year);
@@ -242,16 +232,7 @@ onMounted(async () => {
 })
 
 
-
-
-
-const { t } = useI18n()
-const userStore = useUserStore()
-const { setWatermark } = useWatermark()
 const loading = ref(true)
-const avatar = userStore.getUser.avatar
-const username = userStore.getUser.nickname
-const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
 // 获取统计数
 let totalSate = reactive<WorkplaceTotal>({
   project: 0,
@@ -268,187 +249,33 @@ const getCount = async () => {
   totalSate = Object.assign(totalSate, data)
 }
 
-// 获取项目数
-let projects = reactive<Project[]>([])
-const getProject = async () => {
-  const data = [
-    {
-      name: 'ruoyi-vue-pro',
-      icon: 'akar-icons:github-fill',
-      message: 'https://github.com/YunaiV/ruoyi-vue-pro',
-      personal: 'Spring Boot 单体架构',
-      time: new Date()
-    },
-    {
-      name: 'yudao-ui-admin-vue3',
-      icon: 'logos:vue',
-      message: 'https://github.com/yudaocode/yudao-ui-admin-vue3',
-      personal: 'Vue3 + element-plus',
-      time: new Date()
-    },
-    {
-      name: 'yudao-ui-admin-vben',
-      icon: 'logos:vue',
-      message: 'https://github.com/yudaocode/yudao-ui-admin-vben',
-      personal: 'Vue3 + vben(antd)',
-      time: new Date()
-    },
-    {
-      name: 'yudao-cloud',
-      icon: 'akar-icons:github',
-      message: 'https://github.com/YunaiV/yudao-cloud',
-      personal: 'Spring Cloud 微服务架构',
-      time: new Date()
-    },
-    {
-      name: 'yudao-ui-mall-uniapp',
-      icon: 'logos:vue',
-      message: 'https://github.com/yudaocode/yudao-ui-admin-uniapp',
-      personal: 'Vue3 + uniapp',
-      time: new Date()
-    },
-    {
-      name: 'yudao-ui-admin-vue2',
-      icon: 'logos:vue',
-      message: 'https://github.com/yudaocode/yudao-ui-admin-vue2',
-      personal: 'Vue2 + element-ui',
-      time: new Date()
-    }
-  ]
-  projects = Object.assign(projects, data)
-}
-
-
-
-// 获取快捷入口
-let shortcut = reactive<Shortcut[]>([])
-
-const getShortcut = async () => {
-  const data = [
-    {
-      name: 'Github',
-      icon: 'akar-icons:github-fill',
-      url: 'github.io'
-    },
-    {
-      name: 'Vue',
-      icon: 'logos:vue',
-      url: 'vuejs.org'
-    },
-    {
-      name: 'Vite',
-      icon: 'vscode-icons:file-type-vite',
-      url: 'https://vitejs.dev/'
-    },
-    {
-      name: 'Angular',
-      icon: 'logos:angular-icon',
-      url: 'github.io'
-    },
-    {
-      name: 'React',
-      icon: 'logos:react',
-      url: 'github.io'
-    },
-    {
-      name: 'Webpack',
-      icon: 'logos:webpack',
-      url: 'github.io'
-    }
-  ]
-  shortcut = Object.assign(shortcut, data)
-}
-
-const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption
-
-// 周活跃量
-const getWeeklyUserActivity = async () => {
-  const data = [
-    { value: 13253, name: 'analysis.monday' },
-    { value: 34235, name: 'analysis.tuesday' },
-    { value: 26321, name: 'analysis.wednesday' },
-    { value: 12340, name: 'analysis.thursday' },
-    { value: 24643, name: 'analysis.friday' },
-    { value: 1322, name: 'analysis.saturday' },
-    { value: 1324, name: 'analysis.sunday' }
-  ]
-  set(
-    barOptionsData,
-    'xAxis.data',
-    data.map((v) => t(v.name))
-  )
-  set(barOptionsData, 'series', [
-    {
-      name: t('analysis.activeQuantity'),
-      data: data.map((v) => v.value),
-      type: 'bar'
-    }
-  ])
-}
-
-const barOptionsData1 = reactive<EChartsOption>(barOptions1) as EChartsOption
-
-// 周活跃量
-const getWeeklyUserActivity1 = async () => {
-  const data = [
-    { value: 13253, name: 'analysis.monday' },
-    { value: 34235, name: 'analysis.tuesday' },
-    { value: 26321, name: 'analysis.wednesday' },
-    { value: 12340, name: 'analysis.thursday' },
-    { value: 24643, name: 'analysis.friday' },
-    { value: 1322, name: 'analysis.saturday' },
-    { value: 1324, name: 'analysis.sunday' }
-  ]
-  set(
-    barOptionsData1,
-    'xAxis.data',
-    data.map((v) => t(v.name))
-  )
-  set(barOptionsData1, 'series', [
-    {
-      name: t('analysis.activeQuantity'),
-      data: data.map((v) => v.value),
-      type: 'line'
-    }
-  ])
-}
 
 
 const getAllApi = async () => {
   await Promise.all([
     getCount(),
-    getProject(),
-    // getNotice(),
-    getShortcut(),
-    // getUserAccessSource(),
-    getWeeklyUserActivity(),
-    getWeeklyUserActivity1(),
   ])
   loading.value = false
 }
 
 
 
-//出库
-const outOptionsData = reactive<EChartsOption>(outOptions) as EChartsOption
-//入库
-const enterOptionsData = reactive<EChartsOption>(enterOptions) as EChartsOption
-//回库backOptions
-const backOptionsData = reactive<EChartsOption>(backOptions) as EChartsOption
-//历年标本数量统计yearOptions
+
+//历年标本数量统计
 const yearOptionsData = reactive<EChartsOption>(yearOptions) as EChartsOption
-//历年标本来源统计originOptions
-const originOptionsData = reactive<EChartsOption>(originOptions) as EChartsOption
 //本月入库数
 const enterRatioOptionsData = reactive<EChartsOption>(enterRatioOptions) as EChartsOption
 //本月出库数
 const outRatioOptionsData = reactive<EChartsOption>(outRatioOptions) as EChartsOption
 //本月回库数
 const returnRatioOptionsData = reactive<EChartsOption>(returnRatioOptions) as EChartsOption
-//历年来源originOptions111
-const originOptions111Data = reactive<EChartsOption>(originOptions111) as EChartsOption
-//历年来源originOptions111
+//历年标本来源增减统计
+const originOptionsData = reactive<EChartsOption>(originOptions) as EChartsOption
+//本年标本数量统计
 const mouthOptionsData = reactive<EChartsOption>(mouthOptions) as EChartsOption
+//按标本类型统计
+const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
+
 getAllApi()
 
 
@@ -545,9 +372,6 @@ getAllApi()
   /* margin-top: 10%; */
 }
 
-.introduce-text {
-  /* text-align: center; */
-}
 
 .introduce-text div:nth-child(1) {
   font-size: 1.4rem;
@@ -633,8 +457,4 @@ getAllApi()
   }
 }
 
-
-.multiple-text-shadow {
-  /* -webkit-text-stroke: 0.3px #fff; */
-}
 </style>

+ 81 - 884
src/views/Home/echarts-data.ts

@@ -1,14 +1,9 @@
 import { EChartsOption } from 'echarts'
-import * as echarts from 'echarts';
-// import request from '@/config/axios'
 //获取标本类型数
 import * as WorkbenchApi from '@/api/workbench'
 const { samples } = await WorkbenchApi.getSpecimenTypeList();
 
-
 const { t } = useI18n()
-const colorList = ["#9E87FF", '#73DDFF', '#fe9a8b', '#F56948', '#9E87FF']
-// const percentage = 0.3;
 const dataStyle = {
   normal: {
     label: {
@@ -51,8 +46,6 @@ sourceList.value = await WorkbenchApi.getSpecimenSourceList();
 enterSpecimen.value = await WorkbenchApi.getEnterSpecimenList(year);
 outSpecimen.value = await WorkbenchApi.getOutSpecimenList(year);
 returnSpecimen.value = await WorkbenchApi.getReturnSpecimenList(year);
-console.log('Year',year);
-console.log('outSpecimen.value',outSpecimen.value.data);
 
 //获取各类标本数据
 mineralCount.value = samples['矿物'];
@@ -154,720 +147,99 @@ export const lineOptions: EChartsOption = {
     data: [t('analysis.estimate'), t('analysis.actual')],
     top: 50
   },
-  series: [
-    {
-      name: t('analysis.estimate'),
-      smooth: true,
-      type: 'line',
-      data: [100, 120, 161, 134, 105, 160, 165, 114, 163, 185, 118, 123],
-      animationDuration: 2800,
-      animationEasing: 'cubicInOut'
-    },
-    {
-      name: t('analysis.actual'),
-      smooth: true,
-      type: 'line',
-      itemStyle: {},
-      data: [120, 82, 91, 154, 162, 140, 145, 250, 134, 56, 99, 123],
-      animationDuration: 2800,
-      animationEasing: 'quadraticOut'
-    }
-  ]
-}
-
-export const pieOptions: EChartsOption = {
-  // color: ['#1F78B4', '#A6CEE3', '#B2DF8A', '#33A02C', '#FB9A99', '#E31A1C'],
-  // color: ['#fba980', '#fada8b', '#fdf5e1', '#dedede'],
-  color: [ '#90cedd', '#fbf5bf','#fecb70', '#ce6116'],
-    // color: ['rgba(206,97,22,.7)', 'rgba(247,235,182,.7)', 'rgba(162,214,201,.7)', 'rgba(51,143,180,.7)'],
-    // color: ['rgba(206,97,22,.7)', 'rgba(247,235,182,.7)', 'rgba(162,214,201,.7)', 'rgba(51,143,180,.7)'],
-
-  legend: {
-    icon: "circle",
-    top: "2%",
-    textStyle: {
-      color: "#556677",
-    },
-  },
-  
-  tooltip: {
-    trigger: "item",
-    axisPointer: {
-      label: {
-        show: true,
-        backgroundColor: "#fff",
-        color: "#556677",
-        borderColor: "rgba(0,0,0,0)",
-        shadowColor: "rgba(0,0,0,0)",
-        shadowOffsetY: 0,
-      },
-      lineStyle: {
-        width: 0,
-      },
-    },
-    backgroundColor: "#fff",
-    textStyle: {
-      color: "#5c6c7c",
-    },
-    padding: [10, 10],
-    extraCssText: "box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)",
-  },
-  series: [{
-    type: 'pie',
-    radius: ['35%', '66%'],
-    center: ['50%', '55%'],
-    // label: {
-    //     fontSize: 16,
-    //     formatter: '{b} {d}%',
-    // },
-    // startAngle: 180,
-    // endAngle: 360,
-    data: [{
-      value: mineralCount.value,
-      name: '矿物'
-    },
-    {
-      value: rockOreCount.value,
-      name: '岩石矿石'
-    },
-    {
-      value: fossilCount.value,
-      name: '化石'
-    },
-    {
-      value: meteoriteCount.value,
-      name: '陨石'
-    }
-    ],
-  }]
-};
-
-export const barOptions: EChartsOption = {
-  title: {
-    text: t('analysis.weeklyUserActivity'),
-    left: 'center'
-  },
-  tooltip: {
-    trigger: 'axis',
-    axisPointer: {
-      type: 'shadow'
-    }
-  },
-  grid: {
-    left: 50,
-    right: 20,
-    bottom: 20
-  },
-  xAxis: {
-    type: 'category',
-    data: [
-      t('analysis.monday'),
-      t('analysis.tuesday'),
-      t('analysis.wednesday'),
-      t('analysis.thursday'),
-      t('analysis.friday'),
-      t('analysis.saturday'),
-      t('analysis.sunday')
-    ],
-    axisTick: {
-      alignWithLabel: true
-    }
-  },
-  yAxis: {
-    type: 'value'
-  },
-  series: [
-    {
-      name: t('analysis.activeQuantity'),
-      data: [13253, 34235, 26321, 12340, 24643, 1322, 1324],
-      type: 'bar'
-    }
-  ]
-}
-export const barOptions1: EChartsOption = {
-
-  tooltip: {
-    trigger: 'axis',
-    axisPointer: {
-      type: 'shadow'
-    }
-  },
-  grid: {
-    left: 50,
-    right: 20,
-    bottom: 20
-  },
-  xAxis: {
-    type: 'category',
-    data: [
-      t('analysis.monday'),
-      t('analysis.tuesday'),
-      t('analysis.wednesday'),
-      t('analysis.thursday'),
-      t('analysis.friday'),
-      t('analysis.saturday'),
-      t('analysis.sunday')
-    ],
-    axisTick: {
-      alignWithLabel: true
-    }
-  },
-  yAxis: {
-    type: 'value'
-  },
-  series: [
-    {
-      name: t('analysis.activeQuantity'),
-      data: [13, 34235, 26321, 12340, 24643, 1322, 1324],
-      type: 'line'
-    }
-  ]
-}
-export const radarOption: EChartsOption = {
-  legend: {
-    data: [t('workplace.personal'), t('workplace.team')]
-  },
-  radar: {
-    // shape: 'circle',
-    indicator: [
-      { name: t('workplace.quote'), max: 65 },
-      { name: t('workplace.contribution'), max: 160 },
-      { name: t('workplace.hot'), max: 300 },
-      { name: t('workplace.yield'), max: 130 },
-      { name: t('workplace.follow'), max: 100 }
-    ]
-  },
-  series: [
-    {
-      name: `xxx${t('workplace.index')}`,
-      type: 'radar',
-      data: [
-        {
-          value: [42, 30, 20, 35, 80],
-          name: t('workplace.personal')
-        },
-        {
-          value: [50, 140, 290, 100, 90],
-          name: t('workplace.team')
-        }
-      ]
-    }
-  ]
-}
-//出库
-export const outOptions: EChartsOption = {
-  backgroundColor: "#fff",
-  legend: {
-    icon: "circle",
-    // top: "5%",
-    right: "5%",
-    textStyle: {
-      color: "#556677",
-    },
-  },
-  tooltip: {
-    trigger: "axis",
-    axisPointer: {
-      label: {
-        show: true,
-        backgroundColor: "#fff",
-        color: "#556677",
-        borderColor: "rgba(0,0,0,0)",
-        shadowColor: "rgba(0,0,0,0)",
-        shadowOffsetY: 0,
-      },
-      lineStyle: {
-        width: 0,
-      },
-    },
-    backgroundColor: "#fff",
-    textStyle: {
-      color: "#5c6c7c",
-    },
-    padding: [10, 10],
-    extraCssText: "box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)",
-  },
-  grid: {
-    left: '3%',
-    right: '3%',
-    bottom: '0%', // 减少底部边距,让 X 轴更靠近底部
-    containLabel: true
-  },
-  xAxis: [
-    {
-      type: "category",
-      data: outMonth,
-      axisLine: {
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      axisTick: {
-        show: false,
-      },
-      axisLabel: {
-        interval: 0,
-        textStyle: {
-          color: "#556677",
-        },
-        // 默认x轴字体大小
-        fontSize: 12,
-        // margin:文字到x轴的距离
-        margin: 15,
-      },
-      axisPointer: {
-        label: {
-          // padding: [11, 5, 7],
-          padding: [0, 0, 10, 0],
-          margin: 15,
-          // 移入时的字体大小
-          fontSize: 12,
-          backgroundColor: {
-            type: "linear",
-            x: 0,
-            y: 0,
-            x2: 0,
-            y2: 1,
-            colorStops: [
-              {
-                offset: 0,
-                color: "#fff", // 0% 处的颜色
-              },
-              {
-                offset: 0.86,
-                color: "#fff", // 0% 处的颜色
-              },
-              {
-                offset: 0.86,
-                color: "#dcb86b", // 0% 处的颜色
-              },
-              {
-                offset: 1,
-                color: "#dcb86b", // 100% 处的颜色
-              },
-            ],
-            global: false, // 缺省为 false
-          },
-        },
-      },
-      boundaryGap: false,
-    },
-  ],
-  yAxis: [
-    {
-      type: "value",
-      axisTick: {
-        show: false,
-      },
-      axisLine: {
-        show: true,
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      axisLabel: {
-        textStyle: {
-          color: "#556677",
-        },
-      },
-      splitLine: {
-        show: false,
-      },
-    },
-    {
-      type: "value",
-      position: "right",
-      axisTick: {
-        show: false,
-      },
-      axisLabel: {
-        textStyle: {
-          color: "#556677",
-        },
-        formatter: "{value}",
-      },
-      axisLine: {
-        show: true,
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      splitLine: {
-        show: false,
-      },
-    },
-  ],
-  series: [
-    {
-      name: "出库",
-      type: "line",
-      data: outNum,
-      symbolSize: 1,
-      symbol: "circle",
-      smooth: true,
-      yAxisIndex: 0,
-      
-      showSymbol: false,
-      lineStyle: {
-        width: 4,
-        color: "rgba(247, 203, 107, 1)",
-        // shadowColor: "rgba(247, 203, 107, 0.3)",
-        // shadowBlur: 10,
-        // shadowOffsetY: 20,
-      },
-      itemStyle: {
-        normal: {
-          color: "rgba(247, 203, 107, 1)",
-          borderColor: "rgba(247, 203, 107, 1)",
-        },
-      },
-    },
-
-  ],
-};
-//入库
-export const enterOptions: EChartsOption = {
-  backgroundColor: "#fff",
-  legend: {
-    icon: "circle",
-    // top: "5%",
-    right: "5%",
-    textStyle: {
-      color: "#556677",
-    },
-  },
-  tooltip: {
-    trigger: "axis",
-    axisPointer: {
-      label: {
-        show: true,
-        backgroundColor: "#fff",
-        color: "#556677",
-        borderColor: "rgba(0,0,0,0)",
-        shadowColor: "rgba(0,0,0,0)",
-        shadowOffsetY: 0,
-      },
-      lineStyle: {
-        width: 0,
-      },
-    },
-    backgroundColor: "#fff",
-    textStyle: {
-      color: "#5c6c7c",
-    },
-    padding: [10, 10],
-    extraCssText: "box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)",
-  },
-  grid: {
-    left: '3%',
-    right: '3%',
-    bottom: '0%', // 减少底部边距,让 X 轴更靠近底部
-    containLabel: true
-  },
-  xAxis: [
-    {
-      type: "category",
-      data: enterMonth,//['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
-      axisLine: {
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      axisTick: {
-        show: false,
-      },
-      axisLabel: {
-        interval: 0,
-        textStyle: {
-          color: "#556677",
-        },
-        // 默认x轴字体大小
-        fontSize: 12,
-        // margin:文字到x轴的距离
-        margin: 15,
-      },
-      axisPointer: {
-        label: {
-          // padding: [11, 5, 7],
-          padding: [0, 0, 10, 0],
-          margin: 15,
-          // 移入时的字体大小
-          fontSize: 12,
-          backgroundColor: {
-            type: "linear",
-            x: 0,
-            y: 0,
-            x2: 0,
-            y2: 1,
-            colorStops: [
-              {
-                offset: 0,
-                color: "#fff", // 0% 处的颜色
-              },
-              {
-                offset: 0.86,
-                color: "#fff", // 0% 处的颜色
-              },
-              {
-                offset: 0.86,
-                color: "#dcb86b", // 0% 处的颜色
-              },
-              {
-                offset: 1,
-                color: "#dcb86b", // 100% 处的颜色
-              },
-            ],
-            global: false, // 缺省为 false
-          },
-        },
-      },
-      boundaryGap: false,
-    },
-  ],
-  yAxis: [
-    {
-      type: "value",
-      axisTick: {
-        show: false,
-      },
-      axisLine: {
-        show: true,
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      axisLabel: {
-        textStyle: {
-          color: "#556677",
-        },
-      },
-      splitLine: {
-        show: false,
-      },
-    },
-    {
-      type: "value",
-      position: "right",
-      axisTick: {
-        show: false,
-      },
-      axisLabel: {
-        textStyle: {
-          color: "#556677",
-        },
-        formatter: "{value}",
-      },
-      axisLine: {
-        show: true,
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      splitLine: {
-        show: false,
-      },
-    },
-  ],
-  series: [
-
-    {
-      name: "入库",
-      type: "line",
-      data: enterNum,
-      symbolSize: 1,
-      symbol: "circle",
-      smooth: true,
-      yAxisIndex: 0,
-      showSymbol: false,
-      lineStyle: {
-        width: 4,
-        color:" rgba(251, 169, 128, 1)",
-        // shadowColor: "rgba(251, 169, 128, 0.3)",
-        // shadowBlur: 10,
-        // shadowOffsetY: 20,
-      },
-      itemStyle: {
-        normal: {
-          color: "rgba(251, 169, 128, 1)",
-          borderColor: "rgba(251, 169, 128, 1)",
-        },
-      },
-    }
-  ],
-};
-//回库
-export const backOptions: EChartsOption = {
-  backgroundColor: "#fff",
-  legend: {
-    icon: "circle",
-    // top: "5%",
-    right: "5%",
-    textStyle: {
-      color: "#556677",
-    },
-  },
-  tooltip: {
-    trigger: "axis",
-    axisPointer: {
-      label: {
-        show: true,
-        backgroundColor: "#fff",
-        color: "#556677",
-        borderColor: "rgba(0,0,0,0)",
-        shadowColor: "rgba(0,0,0,0)",
-        shadowOffsetY: 0,
-      },
-      lineStyle: {
-        width: 0,
-      },
-    },
-    backgroundColor: "#fff",
-    textStyle: {
-      color: "#5c6c7c",
-    },
-    padding: [10, 10],
-    extraCssText: "box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)",
-  },
-  grid: {
-    left: '3%',
-    right: '3%',
-    bottom: '0%', // 减少底部边距,让 X 轴更靠近底部
-    containLabel: true
-  },
-  xAxis: [
-    {
-      type: "category",
-      data: returnMonth,
-      axisLine: {
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      axisTick: {
-        show: false,
-      },
-      axisLabel: {
-        interval: 0,
-        textStyle: {
-          color: "#556677",
-        },
-        // 默认x轴字体大小
-        fontSize: 12,
-        // margin:文字到x轴的距离
-        margin: 15,
-      },
-      axisPointer: {
-        label: {
-          // padding: [11, 5, 7],
-          padding: [0, 0, 10, 0],
-          margin: 15,
-          // 移入时的字体大小
-          fontSize: 12,
-          backgroundColor: {
-            type: "linear",
-            x: 0,
-            y: 0,
-            x2: 0,
-            y2: 1,
-            colorStops: [
-              {
-                offset: 0,
-                color: "#fff", // 0% 处的颜色
-              },
-              {
-                offset: 0.86,
-
-                color: "#fff", // 0% 处的颜色
-              },
-              {
-                offset: 0.86,
-                color: "#dcb86b", // 0% 处的颜色
-              },
-              {
-                offset: 1,
-                color: "#dcb86b", // 100% 处的颜色
-              },
-            ],
-            global: false, // 缺省为 false
-          },
-        },
-      },
-      boundaryGap: false,
+  series: [
+    {
+      name: t('analysis.estimate'),
+      smooth: true,
+      type: 'line',
+      data: [100, 120, 161, 134, 105, 160, 165, 114, 163, 185, 118, 123],
+      animationDuration: 2800,
+      animationEasing: 'cubicInOut'
     },
-  ],
-  yAxis: [
     {
-      type: "value",
-      axisTick: {
-        show: false,
-      },
-      axisLine: {
+      name: t('analysis.actual'),
+      smooth: true,
+      type: 'line',
+      itemStyle: {},
+      data: [120, 82, 91, 154, 162, 140, 145, 250, 134, 56, 99, 123],
+      animationDuration: 2800,
+      animationEasing: 'quadraticOut'
+    }
+  ]
+}
+//按标本类型统计
+export const pieOptions: EChartsOption = {
+  // color: ['#1F78B4', '#A6CEE3', '#B2DF8A', '#33A02C', '#FB9A99', '#E31A1C'],
+  // color: ['#fba980', '#fada8b', '#fdf5e1', '#dedede'],
+  color: [ '#90cedd', '#fbf5bf','#fecb70', '#ce6116'],
+    // color: ['rgba(206,97,22,.7)', 'rgba(247,235,182,.7)', 'rgba(162,214,201,.7)', 'rgba(51,143,180,.7)'],
+    // color: ['rgba(206,97,22,.7)', 'rgba(247,235,182,.7)', 'rgba(162,214,201,.7)', 'rgba(51,143,180,.7)'],
+
+  legend: {
+    icon: "circle",
+    top: "2%",
+    textStyle: {
+      color: "#556677",
+    },
+  },
+  
+  tooltip: {
+    trigger: "item",
+    axisPointer: {
+      label: {
         show: true,
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      axisLabel: {
-        textStyle: {
-          color: "#556677",
-        },
+        backgroundColor: "#fff",
+        color: "#556677",
+        borderColor: "rgba(0,0,0,0)",
+        shadowColor: "rgba(0,0,0,0)",
+        shadowOffsetY: 0,
       },
-      splitLine: {
-        show: false,
+      lineStyle: {
+        width: 0,
       },
     },
+    backgroundColor: "#fff",
+    textStyle: {
+      color: "#5c6c7c",
+    },
+    padding: [10, 10],
+    extraCssText: "box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)",
+  },
+  series: [{
+    type: 'pie',
+    radius: ['35%', '66%'],
+    center: ['50%', '55%'],
+    // label: {
+    //     fontSize: 16,
+    //     formatter: '{b} {d}%',
+    // },
+    // startAngle: 180,
+    // endAngle: 360,
+    data: [{
+      value: mineralCount.value,
+      name: '矿物'
+    },
     {
-      type: "value",
-      position: "left",
-      axisTick: {
-        show: false,
-      },
-      axisLabel: {
-        textStyle: {
-          color: "#556677",
-        },
-        formatter: "{value}",
-      },
-      axisLine: {
-        show: true,
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      splitLine: {
-        show: false,
-      },
+      value: rockOreCount.value,
+      name: '岩石矿石'
     },
-  ],
-  series: [
-
     {
-      name: "回库",
-      type: "line",
-      data: returnNum,
-      symbolSize: 1,
-      yAxisIndex: 1,
-      symbol: "circle",
-      smooth: true,
-      showSymbol: false,
-      lineStyle: {
-        width: 4,
-        color: "rgba(222,184,135, .9)",
-        // shadowColor: "rgba(222,184,135, 0.3)",
-        // shadowBlur: 10,
-        // shadowOffsetY: 20,
-      },
-      itemStyle: {
-        normal: {
-          color: "rgba(222,184,135, 1)",
-          borderColor: "rgba(222,184,135, 1)",
-        },
-      },
+      value: fossilCount.value,
+      name: '化石'
     },
-  ],
+    {
+      value: meteoriteCount.value,
+      name: '陨石'
+    }
+    ],
+  }]
 };
+
+
+
+
 //历年标本来源增减统计
-export const originOptions111: EChartsOption = {
+export const originOptions: EChartsOption = {
   backgroundColor: 'transparent', // 设置背景色为透明
   legend: {
     icon: "circle",
@@ -1799,178 +1171,3 @@ export const returnRatioOptions: EChartsOption = {
   }]
 }
 
-export const originOptions: EChartsOption = {
-  backgroundColor: '#fff',
-  grid: {
-    left: '3%',
-    right: '3%',
-    top: '0%',
-    bottom: '0%', // 减少底部边距,让 X 轴更靠近底部
-    containLabel: true
-  },
-  legend: {
-    icon: "circle",
-    // top: "5%",
-    right: "5%",
-    textStyle: {
-      color: "#556677",
-    },
-  },
-  // xAxis: {
-  //   type: 'category',
-
-  //   data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
-
-  // },
-  xAxis: {
-    position: 'bottom',
-    type: 'category',
-    //  boundaryGap: false,
-    axisLine: {
-      show: true,
-      lineStyle: {
-        color: '#ECF1F6'
-      }
-    },
-    axisTick: {
-      show: false,
-    },
-    axisLabel: {
-      show: true,
-      rotate: 0,
-      fontSize: 12,
-      color: 'rgba(0, 0, 0, 1)'
-    },
-    splitLine: {
-      show: true,
-      lineStyle: {
-        color: 'rgba(193, 207, 220, 1)',
-        width: 0,
-        type: 'dashed'
-      }
-    },
-    gridIndex: 0,
-    data: ['12', '13', '14', '15', '16', '17', '18日'],
-  },
-  yAxis: [
-    {
-      type: "value",
-      axisTick: {
-        show: false,
-      },
-      axisLine: {
-        show: true,
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      axisLabel: {
-        textStyle: {
-          color: "#556677",
-        },
-      },
-      splitLine: {
-        show: false,
-      },
-    },
-    {
-      type: "value",
-      position: "right",
-      axisTick: {
-        show: false,
-      },
-      axisLabel: {
-        textStyle: {
-          color: "#556677",
-        },
-        formatter: "{value}",
-      },
-      axisLine: {
-        show: true,
-        lineStyle: {
-          color: "#DCE2E8",
-        },
-      },
-      splitLine: {
-        show: false,
-      },
-    },
-  ],
-  series: [
-    {
-      data: [820, 932, 901, 934, 1290, 1330, 1320],
-      type: 'line',
-      areaStyle: {
-        normal: {
-          color: new echarts.graphic.LinearGradient(
-            0,
-            0,
-            0,
-            1,
-            [
-              {
-                offset: 0,
-                color: 'rgba(145, 118, 215,0.5)',
-              },
-              {
-                offset: 1,
-                color: 'rgba(145, 118, 215,0)',
-              },
-            ],
-            false
-          ),
-        },
-      },
-    },
-    {
-      data: [520, 232, 501, 834, 490, 630, 920],
-      type: 'line',
-      areaStyle: {
-        normal: {
-          color: new echarts.graphic.LinearGradient(
-            0,
-            0,
-            0,
-            1,
-            [
-              {
-                offset: 0,
-                color: 'rgba(145, 118, 215,0.5)',
-              },
-              {
-                offset: 1,
-                color: 'rgba(145, 118, 215,0)',
-              },
-            ],
-            false
-          ),
-        },
-      },
-    },
-    {
-      data: [620, 832, 1001, 354, 345, 150, 320],
-      type: 'line',
-      areaStyle: {
-        normal: {
-          color: new echarts.graphic.LinearGradient(
-            0,
-            0,
-            0,
-            1,
-            [
-              {
-                offset: 0,
-                color: 'rgba(145, 118, 215,0.5)',
-              },
-              {
-                offset: 1,
-                color: 'rgba(145, 118, 215,0)',
-              },
-            ],
-            false
-          ),
-        },
-      },
-    }
-  ]
-};

+ 78 - 38
src/views/museums/museumsdocument/DocumentForm.vue

@@ -6,6 +6,10 @@
       :rules="formRules"
       label-width="100px"
       v-loading="formLoading"
+      :on-change="handleFileChange"
+      :on-success="submitFormSuccess"
+      :action="uploadUrl"
+      :http-request="httpRequest"
     >
       <el-form-item label="文件名称" prop="fileName">
         <el-input v-model="formData.fileName" placeholder="请输入文件名称" />
@@ -46,18 +50,20 @@
   </Dialog>
 </template>
 <script setup lang="ts">
-import { DocumentApi, DocumentVO } from '@/api/museums/museumsdocument'
-
+//import { DocumentApi, DocumentVO } from '@/api/museums/museumsdocument'
+import { useUpload } from '@/components/UploadFile/src/useUpload'
 /** 博物馆文件管理 表单 */
 defineOptions({ name: 'DocumentForm' })
-
+const fileList = ref([]) // 文件列表
 const { t } = useI18n() // 国际化
 const message = useMessage() // 消息弹窗
-
+const data = ref({ path: '' })
 const dialogVisible = ref(false) // 弹窗的是否展示
 const dialogTitle = ref('') // 弹窗的标题
 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
-const formType = ref('') // 表单的类型:create - 新增;update - 修改
+// const formType = ref('') // 表单的类型:create - 新增;update - 修改
+const { uploadUrl, httpRequest } = useUpload()
+const uploadRef = ref()
 const formData = ref({
   id: undefined,
   fileName: undefined,
@@ -79,47 +85,81 @@ const formRules = reactive({
 const formRef = ref() // 表单 Ref
 
 /** 打开弹窗 */
-const open = async (type: string, id?: number) => {
+// const open = async (type: string, id?: number) => {
+//   dialogVisible.value = true
+//   dialogTitle.value = t('action.' + type)
+//   formType.value = type
+//   resetForm()
+//   // 修改时,设置数据
+//   if (id) {
+//     formLoading.value = true
+//     try {
+//       formData.value = await DocumentApi.getDocument(id)
+//     } finally {
+//       formLoading.value = false
+//     }
+//   }
+// }
+
+
+/** 打开弹窗 */
+const open = async () => {
   dialogVisible.value = true
-  dialogTitle.value = t('action.' + type)
-  formType.value = type
   resetForm()
-  // 修改时,设置数据
-  if (id) {
-    formLoading.value = true
-    try {
-      formData.value = await DocumentApi.getDocument(id)
-    } finally {
-      formLoading.value = false
-    }
-  }
 }
 defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 
+
+/** 处理上传的文件发生变化 */
+const handleFileChange = (file) => {
+  data.value.path = file.name
+}
+
 /** 提交表单 */
-const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
-const submitForm = async () => {
-  // 校验表单
-  await formRef.value.validate()
-  // 提交请求
-  formLoading.value = true
-  try {
-    const data = formData.value as unknown as DocumentVO
-    if (formType.value === 'create') {
-      await DocumentApi.createDocument(data)
-      message.success(t('common.createSuccess'))
-    } else {
-      await DocumentApi.updateDocument(data)
-      message.success(t('common.updateSuccess'))
-    }
-    dialogVisible.value = false
-    // 发送操作成功的事件
-    emit('success')
-  } finally {
-    formLoading.value = false
+const submitForm = () => {
+  if (fileList.value.length == 0) {
+    message.error('请上传文件')
+    return
   }
+  unref(uploadRef)?.submit()
 }
 
+/** 文件上传成功处理 */
+const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
+const submitFormSuccess = () => {
+  // 清理
+  dialogVisible.value = false
+  formLoading.value = false
+  unref(uploadRef)?.clearFiles()
+  // 提示成功,并刷新
+  message.success(t('common.createSuccess'))
+  emit('success')
+}
+
+// /** 提交表单 */
+// const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
+// const submitForm = async () => {
+//   // 校验表单
+//   await formRef.value.validate()
+//   // 提交请求
+//   formLoading.value = true
+//   try {
+//     const data = formData.value as unknown as DocumentVO
+//     if (formType.value === 'create') {
+//       await DocumentApi.createDocument(data)
+//       message.success(t('common.createSuccess'))
+//     } else {
+//       await DocumentApi.updateDocument(data)
+//       message.success(t('common.updateSuccess'))
+//     }
+//     dialogVisible.value = false
+//     // 发送操作成功的事件
+//     emit('success')
+//   } finally {
+//     formLoading.value = false
+//   }
+// }
+
 /** 重置表单 */
 const resetForm = () => {
   formData.value = {
@@ -135,4 +175,4 @@ const resetForm = () => {
   }
   formRef.value?.resetFields()
 }
-</script>
+</script>

+ 55 - 30
src/views/museums/museumsdocument/index.vue

@@ -26,24 +26,24 @@
           class="!w-240px"
         />
       </el-form-item>
-      <el-form-item label="路径" prop="path">
-        <el-input
-          v-model="queryParams.path"
-          placeholder="请输入路径"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
-      <el-form-item label="文件大小(字节)" prop="fileSize">
-        <el-input
-          v-model="queryParams.fileSize"
-          placeholder="请输入文件大小(字节)"
-          clearable
-          @keyup.enter="handleQuery"
-          class="!w-240px"
-        />
-      </el-form-item>
+<!--      <el-form-item label="路径" prop="path">-->
+<!--        <el-input-->
+<!--          v-model="queryParams.path"-->
+<!--          placeholder="请输入路径"-->
+<!--          clearable-->
+<!--          @keyup.enter="handleQuery"-->
+<!--          class="!w-240px"-->
+<!--        />-->
+<!--      </el-form-item>-->
+<!--      <el-form-item label="文件大小(字节)" prop="fileSize">-->
+<!--        <el-input-->
+<!--          v-model="queryParams.fileSize"-->
+<!--          placeholder="请输入文件大小(字节)"-->
+<!--          clearable-->
+<!--          @keyup.enter="handleQuery"-->
+<!--          class="!w-240px"-->
+<!--        />-->
+<!--      </el-form-item>-->
       <el-form-item label="文件类型" prop="fileType">
         <el-select
           v-model="queryParams.fileType"
@@ -74,7 +74,7 @@
           class="!w-240px"
         />
       </el-form-item>
-      <el-form-item label="创建时间"prop="createTime">
+      <el-form-item label="创建时间" prop="createTime">
         <el-date-picker
           v-model="queryParams.createTime"
           value-format="YYYY-MM-DD HH:mm:ss"
@@ -112,21 +112,45 @@
   <!-- 列表 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
-      <el-table-column label="主键" align="center" prop="id" />
+      <el-table-column label="序号" align="center" prop="id" />
       <el-table-column label="文件名称" align="center" prop="fileName" />
-      <el-table-column label="配置编号" align="center" prop="configId" />
+<!--      <el-table-column label="配置编号" align="center" prop="configId" />-->
       <el-table-column label="路径" align="center" prop="path" />
       <el-table-column label="文件 URL" align="center" prop="url" />
-      <el-table-column label="文件大小(字节)" align="center" prop="fileSize" />
+      <el-table-column label="文件大小" align="center" prop="fileSize" />
       <el-table-column label="文件类型" align="center" prop="fileType" />
-      <el-table-column
-        label="上传时间"
-        align="center"
-        prop="uploadDate"
-        :formatter="dateFormatter"
-        width="180px"
-      />
-      <el-table-column label="上传者" align="center" prop="uploadedBy" />
+      <el-table-column label="文件内容" align="center" prop="url" >
+        <template #default="{ row }">
+          <el-image
+            v-if="row.type.includes('image')"
+            class="h-80px w-80px"
+            lazy
+            :src="row.url"
+            :preview-src-list="[row.url]"
+            preview-teleported
+            fit="cover"
+          />
+          <el-link
+            v-else-if="row.type.includes('pdf')"
+            type="primary"
+            :href="row.url"
+            :underline="false"
+            target="_blank"
+          >预览</el-link
+          >
+          <el-link v-else type="primary" download :href="row.url" :underline="false" target="_blank"
+          >下载</el-link
+          >
+        </template>
+      </el-table-column>
+<!--      <el-table-column-->
+<!--        label="上传时间"-->
+<!--        align="center"-->
+<!--        prop="uploadDate"-->
+<!--        :formatter="dateFormatter"-->
+<!--        width="180px"-->
+<!--      />-->
+<!--      <el-table-column label="上传者" align="center" prop="uploadedBy" />-->
       <el-table-column
         label="创建时间"
         align="center"
@@ -206,6 +230,7 @@ const getList = async () => {
     const data = await DocumentApi.getDocumentPage(queryParams)
     list.value = data.list
     total.value = data.total
+    console.log(queryParams)
   } finally {
     loading.value = false
   }

+ 1 - 1
src/views/museums/photogroup/index.vue

@@ -84,7 +84,7 @@
   <!-- 列表 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
-      <el-table-column label="主键" align="center" prop="id" />
+      <el-table-column label="序号" align="center" prop="id" />
       <el-table-column label="照片组名称" align="center" prop="groupName" />
       <el-table-column
         label="照片组时间"

+ 1 - 1
src/views/museums/photos/index.vue

@@ -183,7 +183,7 @@ const loading = ref(true) // 列表的加载中
 const list = ref<any>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
 const queryParams = reactive({
-  id: 1 ,
+  id: undefined ,
   pageNo: 1,
   pageSize: 10,
   groupId: query.groupId,

+ 6 - 6
src/views/museums/specimeninfo/SpecimenInfoForm.vue

@@ -7,9 +7,9 @@
       label-width="100px"
       v-loading="formLoading"
     >
-      <el-form-item label="标本类型" prop="specimenType">
+      <el-form-item label="标本类型" prop="specimenType">
         <el-select v-model="formData.specimenType"
-                   placeholder="请选择标本类型(矿物、岩石矿石、化石、陨石)">
+                   placeholder="请选择标本类型">
           <el-option
             v-for="dict in getIntDictOptions(DICT_TYPE.MUSEUMS_SPECIMEN_TYPE)"
             :key="dict.value"
@@ -69,7 +69,7 @@
       </el-form-item>
       <el-form-item label="保存类型" prop="preservationType">
         <el-select v-model="formData.preservationType"
-                   placeholder="请选择保存类型(标本、光片、薄片模型及其他)">
+                   placeholder="请选择保存类型">
           <el-option
             v-for="dict in getIntDictOptions(DICT_TYPE.MUSEUMS_SPECIMEN_INFO)"
             :key="dict.value"
@@ -85,7 +85,7 @@
         <el-input v-model="formData.weight" placeholder="请输入重量"/>
       </el-form-item>
       <el-form-item label="来源" prop="source">
-        <el-select v-model="formData.source" placeholder="请选择来源(采购、捐赠、采集)">
+        <el-select v-model="formData.source" placeholder="请选择来源">
           <el-option
             v-for="dict in getIntDictOptions(DICT_TYPE.MUSEUMS_SOURCE)"
             :key="dict.value"
@@ -95,14 +95,14 @@
         </el-select>
       </el-form-item>
       <el-form-item label="标本提供者" prop="provider">
-        <el-input v-model="formData.provider" placeholder="请输入标本提供者(供应商、捐赠人、采集人)"/>
+        <el-input v-model="formData.provider" placeholder="请输入标本提供者"/>
       </el-form-item>
       <el-form-item label="入藏时间" prop="acquisitionTime">
         <el-date-picker
           v-model="formData.acquisitionTime"
           type="date"
           value-format="x"
-          placeholder="选择入藏时间(购买、捐赠、采集时间)"
+          placeholder="选择入藏时间"
         />
       </el-form-item>
       <el-form-item label="用途" prop="purpose">

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

@@ -375,7 +375,7 @@
         </template>
       </el-table-column>
 <!--      <el-table-column label="标本提供者(供应商、捐赠人、采集人)" align="center" prop="provider" />-->
-      <el-table-column label="入藏时间" align="center" prop="acquisitionTime" />
+      <el-table-column label="入藏时间" align="center" prop="acquisitionTime"  :formatter="dateFormatter"/>
       <el-table-column label="用途" align="center" prop="purpose" />
 <!--      <el-table-column label="描述" align="center" prop="description" />-->
       <el-table-column label="馆藏状态" align="center" prop="collectionStatus">
@@ -387,6 +387,7 @@
 <!--      <el-table-column label="图片名称" align="center" prop="imageName" />-->
       <el-table-column label="图片" align="center" prop="url" width="110px">
         <template #default="{ row }">
+        <div class="demo-image__preview" v-if="queryParams">
           <el-image
 
             style="width: 40px; height:40px"
@@ -397,6 +398,7 @@
             preview-teleported
             fit="cover"
           />
+        </div>
         </template>
       </el-table-column>
 <!--      <el-table-column label="创建时间" align="center" prop="createTime" />-->
@@ -455,12 +457,13 @@
 
 <script setup lang="ts">
 import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
-import { dateFormatter } from '@/utils/formatTime'
+import {dateFormatter, formatDate} from '@/utils/formatTime'
 import download from '@/utils/download'
 import { SpecimenInfoApi, SpecimenInfoVO } from '@/api/museums/specimeninfo'
 import SpecimenInfoForm from './SpecimenInfoForm.vue'
 import SpecimenImportForm from './SpecimenImportForm.vue'
-import  ImageImportForm from './imageImportForm.vue'
+
+
 /** 标本管理 列表 */
 defineOptions({ name: 'SpecimenInfo' })
 
@@ -506,15 +509,23 @@ const queryParams = reactive({
 })
 const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出的加载中
-
+// const url = ref()
+// const srcList = ref([])
 /** 查询列表 */
 const getList = async () => {
   loading.value = true
   try {
     const data = await SpecimenInfoApi.getSpecimenInfoPage(queryParams)
+
     list.value = data.list
     total.value = data.total
     console.log(data )
+   // data.acquisitionTime = formatDate(data.acquisitionTime)
+    // if (queryParams.value.imagePath) {
+    //   srcList.value = queryParams.value.imagePath.split(',');
+    //   url.value = srcList.value[0];
+    //   console.log(srcList.value);
+    // }
   } finally {
     loading.value = false
   }
@@ -584,6 +595,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({

+ 21 - 15
src/views/museums/specimeninfo/specimenDetails.vue

@@ -1,13 +1,11 @@
 <template>
-
-
-
+  <el-skeleton :loading="loading" animated>
   <el-row :gutter="8" justify="space-between">
     <el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24">
       <div>
         <el-row>
           <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" style="margin-outside: 0px">
-            <el-card style="margin-bottom: 5px">
+            <el-card style="margin-bottom: 5px" >
               <template #header>
                 <div class="card-header" style="text-align: center">
                   <h1 class="text1">标本基本信息</h1>
@@ -104,7 +102,7 @@
                     specimenData.provider
                   }}
                 </el-descriptions-item>
-                <el-descriptions-item label="发现时间">{{
+                <el-descriptions-item label="发现时间">  {{
                     specimenData.discoveryTime
                   }}
                 </el-descriptions-item>
@@ -121,7 +119,6 @@
                 </div>
               </template>
               <el-descriptions
-
                 v-if="specimenData"
                 :column="2"
                 :size="size"
@@ -162,11 +159,11 @@
           <div class="demo-image__preview" v-if="specimenData ">
             <el-image
               style=" align-items: center"
-              :src="url"
+              :src="specimenData.imagePath"
               :zoom-rate="1.2"
               :max-scale="7"
               :min-scale="0.2"
-              :preview-src-list="srcList"
+              :preview-src-list="specimenData.imagePath"
               :initial-index="4"
               fit="cover"
             />
@@ -236,7 +233,7 @@
 
     </el-col>
   </el-row>
-
+  </el-skeleton>
 
 
 
@@ -249,10 +246,11 @@ import {ref, onMounted, computed} from "vue";
 import {useRouter} from 'vue-router';
 import  {SpecimenInfoApi} from "@/api/museums/specimeninfo";
 import {ElCol, ElImage} from 'element-plus';
-
+const loading = ref(false)
 const router = useRouter() // 路由
 const {query} = useRoute() // 查询参数
 import type {ComponentSize} from 'element-plus'
+import {formatDate} from "@/utils/formatTime";
 
 
 const size = ref<ComponentSize>('large')
@@ -271,11 +269,19 @@ const fetchData = async () => {
     console.log(query.dataId)
     let res: any = await SpecimenInfoApi.getSpecimenInfo(query.dataId)
     console.log(res)
+    res.discoveryTime = formatDate(res.discoveryTime)
+    res.fallTime = formatDate(res.fallTime)
+    res.acquisitionTime = formatDate(res.acquisitionTime)
+
+
     specimenData.value = res
-    console.log('tj',specimenData.value)
-    srcList.value = specimenData.value.imagePath.split(',')
-    url.value = srcList.value[0]
-    console.log('tj',srcList.value)
+    console.log(specimenData.value)
+    // 假设res中的图片路径是以逗号分隔的字符串
+    // if (res && res.imagePath) {
+    //   srcList.value = res.imagePath.split(',');
+    //   url.value = srcList.value[0]; // 如果需要,可以设置默认图片URL
+    //   console.log(srcList.value);
+    // }
   }  finally {
   }
 }
@@ -284,7 +290,7 @@ const fetchData = async () => {
 onMounted(async () => {
   console.log(1)
   await fetchData()
-  await fetchRecord()
+
 
 })
 

+ 14 - 4
src/views/museums/specimenoutbound/ApproalProcess.vue

@@ -52,7 +52,8 @@
           clearable
           class="!w-240px"
         >
-          <el-option label="请选择字典生成"  v-for="dict in getIntDictOptions(DICT_TYPE.MUSEUMS_SPECIMEN_INFO)"
+          <el-option
+                     v-for="dict in getIntDictOptions(DICT_TYPE. MUSEUMS_APPROAL_STATUS)"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value" />
@@ -98,7 +99,11 @@
         width="180px"
       />
       <el-table-column label="用途" align="center" prop="applicationUsage" />
-      <el-table-column label="审批状态" align="center" prop="status" />
+<!--      <el-table-column label="审批状态" align="center" prop="status" >-->
+<!--        <template #default="scope">-->
+<!--          <dict-tag :type="DICT_TYPE.MUSEUMS_APPROAL_STATUS" :value="scope.row.status" />-->
+<!--        </template>-->
+<!--      </el-table-column>-->
       <el-table-column
         label="出库时间"
         align="center"
@@ -113,8 +118,12 @@
         :formatter="dateFormatter"
         width="180px"
       />
-      <el-table-column label="标本情况" align="center" prop="specimenCondition" />
-      <el-table-column label="标本状态" align="center" prop="sampleStatus" />
+<!--      <el-table-column label="标本情况" align="center" prop="specimenCondition" />-->
+      <el-table-column label="审批状态" align="center" prop="sampleStatus" >
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.MUSEUMS_APPROAL_STATUS" :value="scope.row.status" />
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" min-width="150px">
         <template #default="scope" >
           <el-button
@@ -144,6 +153,7 @@ import download from '@/utils/download'
 import { SpecimenOutboundApi, SpecimenOutboundVO } from '@/api/museums/specimenoutbound'
 import {dateFormatter} from "@/utils/formatTime";
 import {ref} from "vue";
+import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
 
 defineOptions({ name: 'ApproalProcess' })
 const message = useMessage() // 消息弹窗

+ 13 - 4
src/views/museums/specimenoutbound/OutboundApplication.vue

@@ -52,7 +52,11 @@
         clearable
         class="!w-240px"
       >
-        <el-option label="请选择字典生成" value="" />
+        <el-option
+        v-for="dict in getIntDictOptions(DICT_TYPE. MUSEUMS_APPROAL_STATUS)"
+        :key="dict.value"
+        :label="dict.label"
+        :value="dict.value" />
       </el-select>
     </el-form-item>
     <el-form-item label="标本状态" prop="sampleStatus">
@@ -105,7 +109,7 @@
         width="180px"
       />
       <el-table-column label="用途" align="center" prop="applicationUsage" />
-      <el-table-column label="审批状态" align="center" prop="status" />
+<!--      <el-table-column label="审批状态" align="center" prop="status" />-->
       <el-table-column
         label="出库时间"
         align="center"
@@ -121,10 +125,14 @@
         width="180px"
       />
       <el-table-column label="标本情况" align="center" prop="specimenCondition" />
-      <el-table-column label="标本状态" align="center" prop="sampleStatus" />
+      <el-table-column label="标本状态" align="center" prop="sampleStatus"/>
+        <el-table-column label="审批状态" align="center" prop="sampleStatus" >
+          <template #default="scope">
+            <dict-tag :type="DICT_TYPE.MUSEUMS_APPROAL_STATUS" :value="scope.row.status" />
+          </template>
+        </el-table-column>
       <el-table-column label="操作" align="center" min-width="150px">
         <template #default="scope" >
-
           <el-button
             link
             type="primary"
@@ -169,6 +177,7 @@ import Approval from "@/views/museums/specimenoutbound/approval.vue";
 import SpecimenOutboundForm from "@/views/museums/specimenoutbound/SpecimenOutboundForm.vue";
 import {ref} from "vue";
 defineOptions({ name: 'OutboundApplication' })
+import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 

+ 112 - 44
src/views/museums/specimenoutbound/OutboundForm/outboundDetail.vue

@@ -20,73 +20,109 @@
 
 
             >
-              <el-descriptions-item label="序号:"    label-align="right" >{{ outboundData.id }}</el-descriptions-item>
+              <el-descriptions-item label="标本ID:"    label-align="right" >{{ outboundData.infoId }}</el-descriptions-item>
               <el-descriptions-item label="标本编号"    label-align="right">{{
                   outboundData.number
                 }}
               </el-descriptions-item>
-              <el-descriptions-item label="申请人或申请单位:" >{{
+              <el-descriptions-item label="申请人或申请单位:" label-align="right" >{{
                   outboundData.applicantName
                 }}
               </el-descriptions-item>
-              <el-descriptions-item label="申请日期:" >{{
+              <el-descriptions-item label="申请日期:" label-align="right" >{{
                   outboundData.applicationDate
                 }}
               </el-descriptions-item>
-              <el-descriptions-item label="申请出库的用途:" >{{
+              <el-descriptions-item label="申请出库的用途:" label-align="right" >{{
                   outboundData.applicationUsage
                 }}
               </el-descriptions-item>
-              <el-descriptions-item label="审批状态:" >{{
+              <el-descriptions-item label="审批状态:" label-align="right" >{{
                   outboundData.status
                 }}
               </el-descriptions-item>
-              <el-descriptions-item label="审批员:">{{
+              <el-descriptions-item label="审批员:" label-align="right" >{{
                   outboundData.approveUsers
                 }}
               </el-descriptions-item>
-              <el-descriptions-item label="审批时间:">{{
+              <el-descriptions-item label="审批时间:" label-align="right" >{{
                   outboundData.approvalTime
                 }}
               </el-descriptions-item>
-              <el-descriptions-item label="备注信息:" >{{outboundData.remarks}}
+              <el-descriptions-item label="备注信息:" label-align="right" >{{outboundData.remarks}}
               </el-descriptions-item>
-            </el-descriptions>
-          </el-card>
-          <el-card >
-              <template #header>
-                <div class="card-header" style="text-align: center">
-                  <h1 class="text1">标本出库入库详情</h1>
-                </div>
-              </template>
-            <el-descriptions
-              v-if="outboundData"
-              :column="3"
-              :size="small"
-              border
-            >
               <div >
-              <el-descriptions-item label="出库时间:">{{ outboundData.outgoingTime }}</el-descriptions-item>
-              <el-descriptions-item label="出库员:">{{  outboundData.operator}}
-              </el-descriptions-item>
-
-              <el-descriptions-item label="退还日期">{{
-                  outboundData.returnDate
-                }}
-              </el-descriptions-item>
-              <el-descriptions-item label="点收人:">{{
-                  outboundData.receiver
-                }}
-              </el-descriptions-item>
-
-
-              <el-descriptions-item label="退还人">{{
-                  outboundData.returner
-                }}
-              </el-descriptions-item>
+                <el-descriptions-item label="出库时间:" label-align="right" >{{ outboundData.outgoingTime }}</el-descriptions-item>
+                <el-descriptions-item label="出库员:" label-align="right">{{  outboundData.operator}}
+                </el-descriptions-item>
+
+                <el-descriptions-item label="退还日期" label-align="right" >{{
+                    outboundData.returnDate
+                  }}
+                </el-descriptions-item>
+                <el-descriptions-item label="点收人:" label-align="right" >{{
+                    outboundData.receiver
+                  }}
+                </el-descriptions-item>
+
+
+                <el-descriptions-item label="退还人" label-align="right">{{
+                    outboundData.returner
+                  }}
+                </el-descriptions-item>
               </div>
             </el-descriptions>
-            </el-card>
+          </el-card>
+<!--          <el-card >-->
+<!--              <template #header>-->
+<!--                <div class="card-header" style="text-align: center">-->
+<!--                  <h1 class="text1">标本出库入库详情</h1>-->
+<!--                </div>-->
+<!--              </template>-->
+<!--            <el-descriptions-->
+<!--              v-if="outboundData"-->
+<!--              :column="3"-->
+<!--              :size="small"-->
+<!--              border-->
+<!--            >-->
+<!--              <div >-->
+<!--              <el-descriptions-item label="出库时间:" label-align="right" >{{ outboundData.outgoingTime }}</el-descriptions-item>-->
+<!--              <el-descriptions-item label="出库员:">{{  outboundData.operator}}-->
+<!--              </el-descriptions-item>-->
+
+<!--              <el-descriptions-item label="退还日期" label-align="right" >{{-->
+<!--                  outboundData.returnDate-->
+<!--                }}-->
+<!--              </el-descriptions-item>-->
+<!--              <el-descriptions-item label="点收人:" label-align="right" >{{-->
+<!--                  outboundData.receiver-->
+<!--                }}-->
+<!--              </el-descriptions-item>-->
+
+
+<!--              <el-descriptions-item label="退还人" label-align="right">{{-->
+<!--                  outboundData.returner-->
+<!--                }}-->
+<!--              </el-descriptions-item>-->
+<!--              </div>-->
+<!--            </el-descriptions>-->
+<!--            </el-card>-->
+
+            <ContentWrap>
+              <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
+                <el-table-column label="标本ID" align="center" prop="infoId" />
+                <el-table-column label="中文名称" align="center" prop="chineseName" />
+                <el-table-column label="标本编号" align="center" prop="specimenNumber" />
+                <el-table-column label="标本图片" align="center" prop="imagePath" />
+              </el-table>
+              <!-- 分页 -->
+              <Pagination
+                :total="total"
+                v-model:page="queryParams.pageNo"
+                v-model:limit="queryParams.pageSize"
+                @pagination="getList"
+              />
+            </ContentWrap>
 
         </el-col>
       </div>
@@ -98,13 +134,39 @@
 import {ElCol} from "element-plus";
 import {ref} from "vue";
 
-import {SpecimenOutboundApi} from "@/api/museums/specimenoutbound";
+import {SpecimenOutboundApi, SpecimenOutboundVO} from "@/api/museums/specimenoutbound";
+import {dateFormatter, formatDate} from "@/utils/formatTime";
+defineOptions({ name: 'outboundDetail' })
 const {query} = useRoute() // 查询参数
+const loading = ref(true) // 列表的加载中
+const list = ref<SpecimenOutboundVO[]>([]) // 列表的数据
+const total = ref(0) // 列表的总页数
 
+let outboundData = ref(null); // 初始化响应式数据
+const queryParams = reactive({
+  pageNo: 1,
+  pageSize: 10,
+  infoId: undefined,
+  chineseName: undefined,
+  specimenNumber: undefined,
+  attachments: undefined,
+  processInstanceId: undefined,
+  specimenCondition: undefined,
+  imagePath:undefined
+})
 
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    const data = await SpecimenOutboundApi.getSpecimenOutbound(queryParams)
+    list.value = data.list
+    total.value = data.total
 
-
-let outboundData = ref(null); // 初始化响应式数据
+  } finally {
+    loading.value = false
+  }
+}
 const fetchData = async () => {
   try {
     console.log(query.dataId)
@@ -112,6 +174,11 @@ const fetchData = async () => {
     console.log(res)
     outboundData.value = res
     console.log(outboundData.value)
+    res.applicationDate = formatDate(res.applicationDate)
+    res.approvalTime = formatDate(res.approvalTime)
+    res.outgoingTime = formatDate(res.outgoingTime)
+    res.returnDate = formatDate(res.returnDate)
+
   }  finally {
   }
 }
@@ -119,6 +186,7 @@ const fetchData = async () => {
 // // 在组件加载时获取数据
 onMounted(async () => {
   await fetchData()
+  await getList()
 })
 
 </script>

+ 34 - 4
src/views/museums/specimenoutbound/OutboundForm/ReturnForm.vue → src/views/museums/specimenoutbound/OutboundForm/specimenReturnForm.vue

@@ -1,5 +1,5 @@
 <template>
-  <Dialog :title="dialogTitle" v-model="dialogVisible">
+  <Dialog :title="dialogTitle" v-model="dialogVisible" ref="formRef" >
     <el-form
       ref="formRef"
       :model="formData"
@@ -24,18 +24,22 @@
         <el-input v-model="formData.specimenCondition" placeholder="请输入标本情况"/>
       </el-form-item>
     </el-form>
-
+    <template #footer>
+      <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
+      <el-button @click="dialogVisible = false">取 消</el-button>
+    </template>
   </Dialog>
 </template>
 
 <script setup lang="ts">
-import { SpecimenOutboundApi } from '@/api/museums/specimenoutbound'
+import {SpecimenOutboundApi, SpecimenOutboundVO} from '@/api/museums/specimenoutbound'
 import {ref,reactive} from "vue"
 /** 标本出库回库信息 表单 */
 defineOptions({ name: 'ReturnForm' })
-
+const {t} = useI18n() // 国际化
 const dialogVisible = ref(false) // 弹窗的是否展示
 const dialogTitle = ref('') // 弹窗的标题
+const message = useMessage() // 消息弹窗
 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
 const formType = ref('') // 表单的类型:create - 新增;update - 修改
 const formData = ref({
@@ -70,6 +74,7 @@ const formRef = ref() // 表单 Ref
 /** 打开弹窗 */
 const open = async (type: string, id?: number) => {
   dialogVisible.value = true
+  dialogTitle.value = t('回库表单')
   formType.value = type
   resetForm()
   if (id) {
@@ -107,4 +112,29 @@ const resetForm = () => {
   }
   formRef.value?.resetFields()
 }
+
+/** 提交回库表单 */
+const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
+const submitForm = async () => {
+
+  // 提交请求
+  formLoading.value = true
+  try {
+    const data = formData.value as unknown as SpecimenOutboundVO
+    if (formType.value === 'create') {
+      await SpecimenOutboundApi.updateSpecimenOutbound(data)
+      message.success(t('common.createSuccess'))
+    } else {
+      await SpecimenOutboundApi.updateSpecimenOutbound(data)
+      message.success(t('common.updateSuccess'))
+    }
+    dialogVisible.value = false
+    // 发送操作成功的事件
+    emit('success')
+  } finally {
+    formLoading.value = false
+  }
+}
+
+
 </script>

+ 26 - 8
src/views/museums/specimenoutbound/OutboundManagement.vue

@@ -52,7 +52,11 @@
           clearable
           class="!w-240px"
         >
-          <el-option label="请选择字典生成" value="" />
+          <el-option
+            v-for="dict in getIntDictOptions(DICT_TYPE. MUSEUMS_APPROAL_STATUS)"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value" />
         </el-select>
       </el-form-item>
       <el-form-item label="标本状态" prop="sampleStatus">
@@ -98,7 +102,11 @@
         width="180px"
       />
       <el-table-column label="用途" align="center" prop="applicationUsage" />
-      <el-table-column label="审批状态" align="center" prop="status" />
+      <el-table-column label="审批状态" align="center" prop="status"  >
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.MUSEUMS_APPROAL_STATUS" :value="scope.row.status" />
+        </template>
+      </el-table-column>
       <el-table-column
         label="出库时间"
         align="center"
@@ -134,7 +142,7 @@
           <el-button
             link
             type="success"
-            @click="handleReturn(scope.row.id)"
+            @click=" openForm(scope.row.id)"
           >
             回库
           </el-button>
@@ -151,13 +159,15 @@
   </ContentWrap>
 
   <!-- 表单弹窗:回库 -->
-  <ReturnForm ref="returnFormRef" @success="getList" />
+  <specimenReturnForm ref="formRef" @success="getList" />
 </template>
 
 <script setup lang="ts">
+import download from '@/utils/download'
+import { dateFormatter } from '@/utils/formatTime'
 import {defineComponent, ref} from "vue";
 import { SpecimenOutboundApi, SpecimenOutboundVO } from '@/api/museums/specimenoutbound'
-
+import specimenReturnForm from '@/views/museums/specimenoutbound/OutboundForm/specimenReturnForm.vue'
  defineComponent({name:'OutboundManagement'})
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
@@ -208,6 +218,13 @@ const handleQuery = () => {
   getList()
 }
 
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+
 /** 导出按钮操作 */
 const handleExport = async () => {
   try {
@@ -227,6 +244,7 @@ const handleExport = async () => {
 
 /** 查看详情页面 **/
 import { useRouter } from 'vue-router';
+import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
 const router = useRouter();
 const detail=(dataId: number) => {
   router.push({
@@ -251,9 +269,9 @@ const handleOutbound = async (id: number) => {
 }
 
 /** 回库 */
-const returnFormRef = ref()
-const handleReturn= (type: string, id?: number) => {
-  returnFormRef.value.open(type, id)
+const formRef = ref
+const openForm = (type: string, id?: number) => {
+  formRef.value.open(type, id)
 }
 
 

+ 18 - 15
src/views/museums/specimenoutbound/SpecimenOutboundForm.vue

@@ -4,7 +4,7 @@
       ref="formRef"
       :model="formData"
       :rules="formRules"
-      label-width="100px"
+      label-width="140px"
       v-loading="formLoading"
     >
       <el-form-item label="标本ID" prop="infoId">
@@ -16,7 +16,7 @@
       <el-form-item label="标本编号" prop="specimenNumber">
         <el-input v-model="formData.specimenNumber" placeholder="请输入标本编号" />
       </el-form-item>
-      <el-form-item label="申请人或申请单位" prop="applicantName">
+      <el-form-item label="申请人或申请单位"  prop="applicantName">
         <el-input v-model="formData.applicantName" placeholder="请输入申请人或申请单位" />
       </el-form-item>
       <el-form-item label="申请日期" prop="applicationDate">
@@ -31,7 +31,10 @@
         <el-input v-model="formData.applicationUsage" placeholder="请输入申请出库的用途" />
       </el-form-item>
       <el-form-item label="附件上传" prop="attachments">
-        <el-input v-model="formData.attachments" placeholder="请输入附件上传" />
+        <el-upload v-model="formData.attachments" placeholder="请输入附件上传" >
+          <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+          <div class="el-upload__text"> 将文件拖到此处,或 <em>点击上传</em></div>
+        </el-upload>
       </el-form-item>
 <!--      <el-form-item label="审批状态" prop="status">-->
 <!--        <el-select v-model="formData.status" placeholder="请选择审批状态">-->
@@ -44,17 +47,17 @@
 <!--      <el-form-item label="流程实例的编号" prop="processInstanceId">-->
 <!--        <el-input v-model="formData.processInstanceId" placeholder="请输入流程实例的编号" />-->
 <!--      </el-form-item>-->
-      <el-form-item label="出库员" prop="operator">
-        <el-input v-model="formData.operator" placeholder="请输入出库员" />
-      </el-form-item>
-      <el-form-item label="出库时间" prop="outgoingTime">
-        <el-date-picker
-          v-model="formData.outgoingTime"
-          type="date"
-          value-format="x"
-          placeholder="选择出库时间"
-        />
-      </el-form-item>
+<!--      <el-form-item label="出库员" prop="operator">-->
+<!--        <el-input v-model="formData.operator" placeholder="请输入出库员" />-->
+<!--      </el-form-item>-->
+<!--      <el-form-item label="出库时间" prop="outgoingTime">-->
+<!--        <el-date-picker-->
+<!--          v-model="formData.outgoingTime"-->
+<!--          type="date"-->
+<!--          value-format="x"-->
+<!--          placeholder="选择出库时间"-->
+<!--        />-->
+<!--      </el-form-item>-->
 <!--      <el-form-item label="退还人" prop="returner">-->
 <!--        <el-input v-model="formData.returner" placeholder="请输入退还人" />-->
 <!--      </el-form-item>-->
@@ -86,7 +89,7 @@
 </template>
 <script setup lang="ts">
 import { SpecimenOutboundApi, SpecimenOutboundVO } from '@/api/museums/specimenoutbound'
-
+import { UploadFilled } from '@element-plus/icons-vue'
 /** 标本出库回库信息 表单 */
 defineOptions({ name: 'SpecimenOutboundForm' })
 

+ 3 - 1
src/views/museums/specimenoutbound/approval.vue

@@ -18,8 +18,10 @@
           v-model="chkRemarks"
           style="width:800px ;height: 200px"
           placeholder="请输入驳回原因"
-
+          type="textarea"
+          autosize
         />
+
       </el-form-item>
     </el-form>