eight
2024-10-17 b725be02f462d138c6d4589657be47cda2667808
update
已修改2个文件
36 ■■■■ 文件已修改
src/utils/statusFormatter.ts 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/ecg/devmanage/index.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/statusFormatter.ts
@@ -1,4 +1,18 @@
// copy to vben-admin
const DevStateOptions = [
  {label: "空闲", value: 0},
  {label: "已领用", value: 5},
  {label: "已装机", value: 10},
  {label: "已遗失", value: 20},
  {label: "待维修", value: 30},
  {label: "维修中", value: 40},
  {label: "已报废", value: 50}
]
export const tranlateDevState = (state) => {
  const stateOption = DevStateOptions.find(obj => obj.value === state)
  return  undefined !== stateOption ? stateOption.label : ''
}
export const queueStatusConvert = (status: number) => {
  if (5 === status)
src/views/ecg/devmanage/index.vue
@@ -136,6 +136,8 @@
        </template>
      </el-table-column>
      <el-table-column label="采购日期" align="center" prop="purchaseDate" :formatter="dateFormatter2" width="120px"/>
      <el-table-column label="状态日期" align="center" prop="stateDate" :formatter="dateFormatter2" width="120px"/>
<!--
      <el-table-column
          label="创建时间"
          align="center"
@@ -143,6 +145,7 @@
          :formatter="dateFormatter2"
          width="180px"
      />
-->
      <el-table-column label="操作" align="center" min-width="120px">
        <template #default="scope">
          <el-button
@@ -188,6 +191,7 @@
<script setup lang="ts">
import {getStrDictOptions, DICT_TYPE, DictDataType} from '@/utils/dict'
import {dateFormatter2} from '@/utils/formatTime'
import {tranlateDevState} from "@/utils/statusFormatter";
import download from '@/utils/download'
import {DeviceApi, DeviceVO, DevModelApi, OptionsVO} from '@/api/ecg/devmanage'
import DeviceForm from './DeviceForm.vue'
@@ -275,22 +279,6 @@
  } finally {
    exportLoading.value = false
  }
}
const stateOptions = [
    {label: "空闲", value: 0},
    {label: "已领用", value: 5},
    {label: "已装机", value: 10},
    {label: "已遗失", value: 20},
    {label: "待维修", value: 30},
    {label: "维修中", value: 40},
    {label: "已报废", value: 50}
    ]
const tranlateDevState = (state) => {
  const stateOption = stateOptions.find(obj => obj.value === state)
  console.info( stateOption )
  return  undefined !== stateOption ? stateOption.label : ''
}
const categoryChanged = async () => {