From 8bd7f196d5ce4486da7d4b087e9a1038ac164503 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期日, 29 九月 2024 15:51:19 +0800
Subject: [PATCH] 设备查询 - 支持状态
---
src/views/ecg/devmanage/index.vue | 49 ++++++++++++++++++++++++++++++-------------------
1 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/src/views/ecg/devmanage/index.vue b/src/views/ecg/devmanage/index.vue
index d2eb6c7..bb1db29 100644
--- a/src/views/ecg/devmanage/index.vue
+++ b/src/views/ecg/devmanage/index.vue
@@ -19,17 +19,6 @@
class="!w-220px"
/>
</el-form-item>
- <el-form-item label="鍒涘缓鏃堕棿" prop="createTime">
- <el-date-picker
- v-model="queryParams.createTime"
- value-format="YYYY-MM-DD HH:mm:ss"
- type="daterange"
- start-placeholder="寮�濮嬫棩鏈�"
- end-placeholder="缁撴潫鏃ユ湡"
- :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
- class="!w-220px"
- />
- </el-form-item>
<el-form-item label="璁惧缂栧彿" prop="devId">
<el-input
v-model="queryParams.devId"
@@ -38,6 +27,21 @@
@keyup.enter="handleQuery"
class="!w-240px"
/>
+ </el-form-item>
+ <el-form-item label="鐘舵��" prop="state">
+ <el-select
+ v-model="queryParams.state"
+ placeholder="璇烽�夋嫨鐘舵��"
+ clearable
+ class="!w-240px"
+ >
+ <el-option
+ v-for="dict in stateOptions"
+ :key="dict.value"
+ :label="dict.label"
+ :value="dict.value"
+ />
+ </el-select>
</el-form-item>
<el-form-item label="鍒嗙被鍚�" prop="category">
<el-select
@@ -126,7 +130,7 @@
</template>
</el-table-column>
<el-table-column label="鍨嬪彿" align="center" prop="model" />
- <el-table-column label="浣跨敤鎯呭喌" align="center" prop="lost" >
+ <el-table-column label="鐘舵��" align="center" prop="lost" >
<template #default="scope">
<span>{{tranlateDevState(scope.row.state)}}</span>
</template>
@@ -183,7 +187,7 @@
<script setup lang="ts">
import {getStrDictOptions, DICT_TYPE, DictDataType} from '@/utils/dict'
-import {dateFormatter, dateFormatter2} from '@/utils/formatTime'
+import {dateFormatter2} from '@/utils/formatTime'
import download from '@/utils/download'
import {DeviceApi, DeviceVO, DevModelApi, OptionsVO} from '@/api/ecg/devmanage'
import DeviceForm from './DeviceForm.vue'
@@ -203,6 +207,7 @@
purchaseDate: [],
createTime: [],
devId: undefined,
+ state: undefined,
category: undefined,
brand: undefined,
model: undefined
@@ -272,13 +277,19 @@
}
}
+const stateOptions = [
+ {label: "绌洪棽", value: 0},
+ {label: "宸查鐢�", value: 5},
+ {label: "宸茶鏈�", value: 10},
+ {label: "宸查仐澶�", value: 20},
+ {label: "缁翠慨涓�", value: 30},
+ {label: "宸叉姤搴�", value: 40}
+ ]
+
const tranlateDevState = (state) => {
- if (state === 0) return "绌洪棽";
- else if (state=== 5) return "宸查鐢�";
- else if (state=== 10) return "宸茶鏈�";
- else if (state=== 20) return "宸查仐澶�";
- else if (state=== 30) return "缁翠慨涓�";
- else if (state=== 40) return "宸叉姤搴�";
+ const stateOption = stateOptions.find(obj => obj.value === state)
+ console.info( stateOption )
+ return undefined !== stateOption ? stateOption.label : ''
}
const categoryChanged = async () => {
--
Gitblit v1.9.3