更新后台系统细节

This commit is contained in:
yaooo 2023-11-28 15:20:27 +08:00
parent a424d10d91
commit a9a908f928
6 changed files with 48 additions and 37 deletions

View File

@ -89,37 +89,44 @@
<el-table-column label="用户信息" width="200">
<template #default="{ row }">
<el-tag class="mr-2" type="success">ID: {{ row.user_id }}</el-tag>
<el-tag class="mr-2" type="success">账户: {{ row.user_id }}</el-tag>
<el-tag class="mr-2" type="success">账户: {{ row.account }}</el-tag>
</template>
</el-table-column>
<el-table-column label="产品信息">
<el-table-column label="土地信息" width="200">
<template #default="{ row }">
<el-tag class="mr-2" type="success">{{ row.user_id }}</el-tag>
<el-tag class="mr-2" type="success">ID: {{ row.land_id }}</el-tag>
<el-tag class="mr-2" type="success">名称: {{ row.land_title }}</el-tag>
</template>
</el-table-column>
<el-table-column label="设备编码" prop="code" show-overflow-tooltip />
<el-table-column label="设备名称" prop="name" show-overflow-tooltip />
<el-table-column label="设备类型" prop="type">
<el-table-column label="产品信息" width="200">
<template #default="{ row }">
<el-tag class="mr-2" type="success">ID: {{ row.product_id }}</el-tag>
<el-tag class="mr-2" type="success">名称: {{ row.product_name }}</el-tag>
</template>
</el-table-column>
<el-table-column label="设备编码" width="120" prop="code" show-overflow-tooltip />
<el-table-column label="设备名称" width="200" prop="name" show-overflow-tooltip />
<el-table-column label="设备类型" width="150" prop="type">
<template #default="{ row }">
<dict-value :options="dictData.device_type" :value="row.type" />
</template>
</el-table-column>
<el-table-column label="设备状态" prop="status">
<el-table-column label="设备状态" width="100" align="center" prop="status">
<template #default="{ row }">
<dict-value :options="dictData.device_status" :value="row.status" />
</template>
</el-table-column>
<el-table-column label="是否在线" prop="is_online">
<el-table-column label="是否在线" width="100" align="center" prop="is_online">
<template #default="{ row }">
<dict-value :options="dictData.device_online_status" :value="row.is_online" />
</template>
</el-table-column>
<el-table-column label="是否绑定土地" prop="is_bind">
<el-table-column label="是否绑定土地" width="150" align="center" prop="is_bind">
<template #default="{ row }">
<dict-value :options="dictData.device_bind_status" :value="row.is_bind" />
</template>
</el-table-column>
<el-table-column label="创建时间" width="160" prop="create_time">
<el-table-column label="创建时间" width="160" align="center" prop="create_time">
<template #default="{ row }">
<span>{{ row.create_time ? timeFormat(row.create_time, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
</template>

View File

@ -68,6 +68,22 @@
>
编辑
</el-button>
<el-button
v-perms="['land.product/lists']"
type="primary"
link
>
<router-link
:to="{
path: getRoutePath('land.product/lists'),
query: {
land_id: row.id
}
}"
>
产品信息
</router-link>
</el-button>
<el-button type="primary" link @click="handleDetail(row)"
>
土地图片
@ -88,22 +104,6 @@
种植信息
</router-link>
</el-button>
<el-button
v-perms="['land.product/lists']"
type="primary"
link
>
<router-link
:to="{
path: getRoutePath('land.product/lists'),
query: {
land_id: row.id
}
}"
>
产品信息
</router-link>
</el-button>
<el-button
v-perms="['land.land/delete']"
type="danger"

View File

@ -66,17 +66,17 @@
<el-table-column label="种植品牌" prop="breed" show-overflow-tooltip />
<el-table-column label="种植面积" prop="area" show-overflow-tooltip />
<el-table-column label="种植人员" prop="user" show-overflow-tooltip />
<el-table-column label="生长状态" prop="status">
<el-table-column label="生长状态" align="center" prop="status">
<template #default="{ row }">
<dict-value :options="dictData.plant_status" :value="row.status" />
</template>
</el-table-column>
<el-table-column label="溯源二维码" width="150" prop="qr_code">
<el-table-column label="溯源二维码" width="150" align="center" prop="qr_code">
<template #default="{ row }">
<el-image style="width:50px;height:50px;" :src="row.qr_code" />
</template>
</el-table-column>
<el-table-column label="播种时间" width="180" prop="plant_date">
<el-table-column label="播种时间" width="180" align="center" prop="plant_date">
<template #default="{ row }">
<span>{{ row.plant_date ? timeFormat(row.plant_date, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
</template>

View File

@ -52,14 +52,14 @@
<el-tag class="mr-2" type="success">类型: {{ row.kind }} 品牌: {{ row.breed }}</el-tag>
</template>
</el-table-column>
<el-table-column label="种植操作类型" prop="type">
<el-table-column label="种植操作类型" align="center" prop="type">
<template #default="{ row }">
<dict-value :options="dictData.land_plant_action" :value="row.type" />
</template>
</el-table-column>
<el-table-column label="种植操作" prop="type_text" show-overflow-tooltip />
<el-table-column label="种植操作详情" prop="detail" show-overflow-tooltip />
<el-table-column label="种植操作时间" width="180" prop="plant_date">
<el-table-column label="种植操作时间" width="180" align="center" prop="plant_date">
<template #default="{ row }">
<span>{{ row.create_time ? timeFormat(row.create_time, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
</template>

View File

@ -74,12 +74,12 @@
</el-table-column>
<el-table-column label="产品编号" prop="code" show-overflow-tooltip />
<el-table-column label="产品名称" prop="name" show-overflow-tooltip />
<el-table-column label="产品状态" prop="status">
<el-table-column label="产品状态" align="center" prop="status">
<template #default="{ row }">
<dict-value :options="dictData.product_status" :value="row.status" />
</template>
</el-table-column>
<el-table-column label="创建时间" width="180" prop="create_time">
<el-table-column label="创建时间" width="180" align="center" prop="create_time">
<template #default="{ row }">
<span>{{ row.create_time ? timeFormat(row.create_time, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
</template>

View File

@ -41,7 +41,8 @@ class DeviceLists extends BaseAdminDataLists implements ListsSearchInterface
public function setSearch(): array
{
return [
'=' => ['d.code', 'd.name', 'd.type', 'd.status', 'd.is_online', 'd.is_bind'],
'%like%' => ['d.name'],
'=' => ['d.code', 'd.type', 'd.status', 'd.is_online', 'd.is_bind'],
];
}
@ -72,9 +73,12 @@ class DeviceLists extends BaseAdminDataLists implements ListsSearchInterface
{
return Db::name('device')->alias('d')
->where($this->searchWhere)->where($this->userSearch())
// ->leftJoin('land_device ld','ld.device_id = d.id')
// ->leftJoin('land l','l.id = ld.land_id')
// ->field('d.*, ld.land_id, l.title')
->leftJoin('user u','u.id = d.user_id')
->leftJoin('product_device pd','pd.device_id = d.id')
->leftJoin('product p','p.id = pd.product_id')
->leftJoin('land_product lp','lp.product_id = pd.product_id')
->leftJoin('land l','l.id = lp.land_id')
->field('d.*, u.account, pd.product_id, p.name as product_name, lp.land_id, l.title as land_title')
->limit($this->limitOffset, $this->limitLength)
->order(['d.id' => 'desc'])
->select()