This commit is contained in:
chenbo 2024-01-10 17:56:08 +08:00
parent 00830de89a
commit ec023ecfc0
4 changed files with 99 additions and 208 deletions

View File

@ -11,7 +11,7 @@
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-form-item label="设备名称" prop="name">
<el-input v-model="formData.name" clearable placeholder="请输入设备名称" />
</el-form-item>
</el-form-item>
<el-form-item label="设备类型" prop="type">
<el-select class="flex-1" v-model="formData.type" clearable placeholder="请选择设备类型">
<el-option
@ -21,8 +21,8 @@
:value="parseInt(item.value)"
/>
</el-select>
</el-form-item>
<el-form-item label="所属产品" prop="product_id">
</el-form-item>
<el-form-item label="所属产品" prop="product_id">
<el-select
v-model="formData.product_id"
remote
@ -38,11 +38,11 @@
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item label="设备编码" prop="code">
<el-form-item label="设备编码" prop="code">
<el-input v-model="formData.code" clearable placeholder="请输入设备编码" />
</el-form-item>
</el-form-item>
<el-form-item label="产品图" prop="image">
<el-upload
class="avatar-uploader"
@ -67,7 +67,7 @@
</el-upload>
</el-form-item>
<el-form-item label="监测项" prop="monitor_item">
<el-form-item label="监测项" prop="monitor_item">
<el-select class="flex-1" v-model="formData.monitor_item" multiple clearable placeholder="请选择设备监测项">
<el-option
v-for="(item, index) in dictData.monitor_item"
@ -76,10 +76,10 @@
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="视频地址" prop="video_url">
</el-form-item>
<el-form-item label="视频地址" prop="video_url">
<el-input v-model="formData.video_url" clearable placeholder="请输入视频地址" />
</el-form-item>
</el-form-item>
<el-form-item label="设备状态" prop="status">
<el-select class="flex-1" v-model="formData.status" clearable placeholder="请选择设备状态">
<el-option
@ -89,7 +89,7 @@
:value="parseInt(item.value)"
/>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item label="是否在线" prop="is_online">
<el-select class="flex-1" v-model="formData.is_online" clearable placeholder="请选择是否在线">
<el-option
@ -99,7 +99,7 @@
:value="parseInt(item.value)"
/>
</el-select>
</el-form-item>
</el-form-item>
</el-form>
</popup>
</div>

View File

@ -2,38 +2,6 @@
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="用户ID" prop="user_id">
<el-input
class="w-[280px]"
v-model="queryParams.user_id"
clearable
placeholder="请输入用户ID"
/>
</el-form-item>
<el-form-item label="土地ID" prop="land_id">
<el-input
class="w-[280px]"
v-model="queryParams.land_id"
clearable
placeholder="请输入土地ID"
/>
</el-form-item>
<el-form-item label="产品ID" prop="product_id">
<el-input
class="w-[280px]"
v-model="queryParams.product_id"
clearable
placeholder="请输入产品ID"
/>
</el-form-item>
<el-form-item label="设备编码" prop="code">
<el-input
class="w-[280px]"
v-model="queryParams.code"
clearable
placeholder="请输入设备编码"
/>
</el-form-item>
<el-form-item label="设备名称" prop="name">
<el-input
class="w-[280px]"
@ -42,54 +10,7 @@
placeholder="请输入设备名称"
/>
</el-form-item>
<el-form-item label="设备类型" prop="type">
<el-select
class="w-[280px]"
v-model="queryParams.type"
clearable
placeholder="请选择设备类型"
>
<el-option label="全部" value=""></el-option>
<el-option
v-for="(item, index) in dictData.device_type"
:key="index"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="设备状态" prop="status">
<el-select
class="w-[280px]"
v-model="queryParams.status"
clearable
placeholder="请选择设备状态"
>
<el-option label="全部" value=""></el-option>
<el-option
v-for="(item, index) in dictData.device_status"
:key="index"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否在线" prop="is_online">
<el-select
class="w-[280px]"
v-model="queryParams.is_online"
clearable
placeholder="请选择是否在线"
>
<el-option label="全部" value=""></el-option>
<el-option
v-for="(item, index) in dictData.device_online_status"
:key="index"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
@ -130,18 +51,14 @@
prop="name"
show-overflow-tooltip
/>
<el-table-column label="设备类型" width="150" prop="type">
<el-table-column label="所属养殖基地" width="200">
<template #default="{ row }">
<dict-value :options="dictData.device_type" :value="row.type" />
</template>
</el-table-column>
<el-table-column label="所属土地" width="200">
<template #default="{ row }">
<el-tag class="mr-2" v-if="row.land_id != null" type="info"
>ID: {{ row.land_id }}</el-tag
<el-tag class="mr-2" v-if="row.farm_id != null" type="info"
>ID: {{ row.farm_id }}</el-tag
>
<el-tag class="mr-2" v-if="row.land_title != null" type="info"
>名称: {{ row.land_title }}</el-tag
<el-tag class="mr-2" v-if="row.farm_name != null" type="info"
>名称: {{ row.farm_name }}</el-tag
>
</template>
</el-table-column>
@ -266,7 +183,7 @@ if (typeof product_id == 'undefined') {
//
const queryParams = reactive({
user_id: '',
land_id: '',
farm_id: '',
product_id: product_id,
code: '',
name: '',

View File

@ -62,12 +62,12 @@
</el-select>
</el-form-item>
<el-form-item label="所属土地" prop="land_id">
<el-form-item label="所属养殖基地" prop="farm_id">
<el-select
v-model="formData.land_id"
v-model="formData.farm_id"
remote
filterable
placeholder="请输入土地信息"
placeholder="请选择"
:remote-method="queryLand"
:loading="loading"
>
@ -131,7 +131,7 @@ const formData = reactive({
id: '',
user_id: '',
root: 0,
land_id: '',
farm_id: '',
code: '',
name: '',
desc: '',

View File

@ -6,35 +6,9 @@
:model="queryParams"
inline
>
<el-form-item label="用户ID" prop="user_id">
<el-input class="w-[280px]" v-model="queryParams.user_id" clearable placeholder="请输入用户ID" />
</el-form-item>
<el-form-item label="土地ID" prop="land_id">
<el-input class="w-[280px]" v-model="queryParams.land_id" clearable placeholder="请输入土地ID" />
</el-form-item>
<el-form-item label="产品编号" prop="code">
<el-input class="w-[280px]" v-model="queryParams.code" clearable placeholder="请输入产品编号" />
</el-form-item>
<el-form-item label="产品名称" prop="name">
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入产品名称" />
</el-form-item>
<el-form-item label="产品状态" prop="status">
<el-select class="w-[280px]" v-model="queryParams.status" clearable placeholder="请选择产品状态">
<el-option label="全部" value=""></el-option>
<el-option
v-for="(item, index) in dictData.product_status"
:key="index"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="create_time">
<daterange-picker
v-model:startTime="queryParams.start_time"
v-model:endTime="queryParams.end_time"
/>
</el-form-item>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>