更新种植面积
This commit is contained in:
parent
51c3ff56da
commit
0d613a3a10
|
@ -1,17 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card class="!border-none mb-4" shadow="never">
|
<el-card class="!border-none mb-4" shadow="never">
|
||||||
<el-form
|
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||||
class="mb-[-16px]"
|
>
|
||||||
:model="queryParams"
|
<el-form-item label="用户ID" prop="user_id">
|
||||||
inline
|
<el-input
|
||||||
>
|
class="w-[280px]"
|
||||||
<el-form-item label="用户ID" prop="user_id">
|
v-model="queryParams.user_id"
|
||||||
<el-input class="w-[280px]" v-model="queryParams.user_id" clearable placeholder="请输入用户ID" />
|
clearable
|
||||||
</el-form-item>
|
placeholder="请输入用户ID"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="土地ID" prop="land_id">
|
<el-form-item label="土地ID" prop="land_id">
|
||||||
<el-input class="w-[280px]" v-model="queryParams.land_id" clearable placeholder="请输入土地ID" />
|
<el-input
|
||||||
</el-form-item>
|
class="w-[280px]"
|
||||||
|
v-model="queryParams.land_id"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入土地ID"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="产品ID" prop="product_id">
|
<el-form-item label="产品ID" prop="product_id">
|
||||||
<el-input
|
<el-input
|
||||||
class="w-[280px]"
|
class="w-[280px]"
|
||||||
|
@ -19,46 +26,71 @@
|
||||||
clearable
|
clearable
|
||||||
placeholder="请输入产品ID"
|
placeholder="请输入产品ID"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备编码" prop="code">
|
<el-form-item label="设备编码" prop="code">
|
||||||
<el-input class="w-[280px]" v-model="queryParams.code" clearable placeholder="请输入设备编码" />
|
<el-input
|
||||||
</el-form-item>
|
class="w-[280px]"
|
||||||
|
v-model="queryParams.code"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入设备编码"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="设备名称" prop="name">
|
<el-form-item label="设备名称" prop="name">
|
||||||
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入设备名称" />
|
<el-input
|
||||||
</el-form-item>
|
class="w-[280px]"
|
||||||
|
v-model="queryParams.name"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入设备名称"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="设备类型" prop="type">
|
<el-form-item label="设备类型" prop="type">
|
||||||
<el-select class="w-[280px]" v-model="queryParams.type" clearable placeholder="请选择设备类型">
|
<el-select
|
||||||
<el-option label="全部" value=""></el-option>
|
class="w-[280px]"
|
||||||
<el-option
|
v-model="queryParams.type"
|
||||||
v-for="(item, index) in dictData.device_type"
|
clearable
|
||||||
:key="index"
|
placeholder="请选择设备类型"
|
||||||
:label="item.name"
|
>
|
||||||
:value="item.value"
|
<el-option label="全部" value=""></el-option>
|
||||||
/>
|
<el-option
|
||||||
</el-select>
|
v-for="(item, index) in dictData.device_type"
|
||||||
</el-form-item>
|
:key="index"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="设备状态" prop="status">
|
<el-form-item label="设备状态" prop="status">
|
||||||
<el-select class="w-[280px]" v-model="queryParams.status" clearable placeholder="请选择设备状态">
|
<el-select
|
||||||
<el-option label="全部" value=""></el-option>
|
class="w-[280px]"
|
||||||
<el-option
|
v-model="queryParams.status"
|
||||||
v-for="(item, index) in dictData.device_status"
|
clearable
|
||||||
:key="index"
|
placeholder="请选择设备状态"
|
||||||
:label="item.name"
|
>
|
||||||
:value="item.value"
|
<el-option label="全部" value=""></el-option>
|
||||||
/>
|
<el-option
|
||||||
</el-select>
|
v-for="(item, index) in dictData.device_status"
|
||||||
</el-form-item>
|
:key="index"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="是否在线" prop="is_online">
|
<el-form-item label="是否在线" prop="is_online">
|
||||||
<el-select class="w-[280px]" v-model="queryParams.is_online" clearable placeholder="请选择是否在线">
|
<el-select
|
||||||
<el-option label="全部" value=""></el-option>
|
class="w-[280px]"
|
||||||
<el-option
|
v-model="queryParams.is_online"
|
||||||
v-for="(item, index) in dictData.device_online_status"
|
clearable
|
||||||
:key="index"
|
placeholder="请选择是否在线"
|
||||||
:label="item.name"
|
>
|
||||||
:value="item.value"
|
<el-option label="全部" value=""></el-option>
|
||||||
/>
|
<el-option
|
||||||
</el-select>
|
v-for="(item, index) in dictData.device_online_status"
|
||||||
</el-form-item>
|
:key="index"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||||
<el-button @click="resetParams">重置</el-button>
|
<el-button @click="resetParams">重置</el-button>
|
||||||
|
@ -80,7 +112,11 @@
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange" style="width: 100%">
|
<el-table
|
||||||
|
:data="pager.lists"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column label="ID" prop="id" width="80" show-overflow-tooltip />
|
<el-table-column label="ID" prop="id" width="80" show-overflow-tooltip />
|
||||||
<!-- <el-table-column label="用户信息" width="200">
|
<!-- <el-table-column label="用户信息" width="200">
|
||||||
|
@ -89,7 +125,12 @@
|
||||||
<el-tag class="mr-2" type="info">账户: {{ row.account }}</el-tag>
|
<el-tag class="mr-2" type="info">账户: {{ row.account }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column label="设备名称" width="200" prop="name" show-overflow-tooltip />
|
<el-table-column
|
||||||
|
label="设备名称"
|
||||||
|
width="200"
|
||||||
|
prop="name"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
<el-table-column label="设备类型" width="150" prop="type">
|
<el-table-column label="设备类型" width="150" prop="type">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<dict-value :options="dictData.device_type" :value="row.type" />
|
<dict-value :options="dictData.device_type" :value="row.type" />
|
||||||
|
@ -97,32 +138,52 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所属土地" width="200">
|
<el-table-column label="所属土地" width="200">
|
||||||
<template #default="{ row }">
|
<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.land_id != null" type="info"
|
||||||
<el-tag class="mr-2" v-if="row.land_title != null" type="info">名称: {{ row.land_title }}</el-tag>
|
>ID: {{ row.land_id }}</el-tag
|
||||||
|
>
|
||||||
|
<el-tag class="mr-2" v-if="row.land_title != null" type="info"
|
||||||
|
>名称: {{ row.land_title }}</el-tag
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所属产品" width="200">
|
<el-table-column label="所属产品" width="200">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag class="mr-2" v-if="row.product_id != null" type="info">ID: {{ row.product_id }}</el-tag>
|
<el-tag class="mr-2" v-if="row.product_id != null" type="info"
|
||||||
<el-tag class="mr-2" v-if="row.product_name != null" type="info">名称: {{ row.product_name }}</el-tag>
|
>ID: {{ row.product_id }}</el-tag
|
||||||
|
>
|
||||||
|
<el-tag class="mr-2" v-if="row.product_name != null" type="info"
|
||||||
|
>名称: {{ row.product_name }}</el-tag
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="设备编码" width="120" prop="code" show-overflow-tooltip />
|
<el-table-column
|
||||||
|
label="设备编码"
|
||||||
|
width="120"
|
||||||
|
prop="code"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
<el-table-column label="设备状态" width="100" align="center" prop="status">
|
<el-table-column label="设备状态" width="100" align="center" prop="status">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<dict-value :options="dictData.device_status" :value="row.status" />
|
<dict-value :options="dictData.device_status" :value="row.status" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="是否在线" width="100" align="center" prop="is_online">
|
<el-table-column label="是否在线" width="100" align="center" prop="is_online">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<dict-value :options="dictData.device_online_status" :value="row.is_online" />
|
<dict-value
|
||||||
</template>
|
:options="dictData.device_online_status"
|
||||||
</el-table-column>
|
:value="row.is_online"
|
||||||
<el-table-column label="创建时间" width="160" align="center" prop="create_time">
|
/>
|
||||||
<template #default="{ row }">
|
</template>
|
||||||
<span>{{ row.create_time ? timeFormat(row.create_time, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="创建时间" width="160" align="center" prop="create_time">
|
||||||
</el-table-column>
|
<template #default="{ row }">
|
||||||
|
<span>{{
|
||||||
|
row.create_time
|
||||||
|
? timeFormat(row.create_time, 'yyyy-mm-dd hh:MM:ss')
|
||||||
|
: ''
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="260" align="center" fixed="right">
|
<el-table-column label="操作" width="260" align="center" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -133,11 +194,7 @@
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button v-perms="['device.device/detail']" type="primary" link>
|
||||||
v-perms="['device.device/detail']"
|
|
||||||
type="primary"
|
|
||||||
link
|
|
||||||
>
|
|
||||||
<router-link
|
<router-link
|
||||||
:to="{
|
:to="{
|
||||||
path: getRoutePath('device.device/detail'),
|
path: getRoutePath('device.device/detail'),
|
||||||
|
@ -146,14 +203,10 @@
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
详情
|
详情
|
||||||
</router-link>
|
</router-link>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button v-perms="['device.monitor_alarm/lists']" type="primary" link>
|
||||||
v-perms="['device.monitor_alarm/lists']"
|
|
||||||
type="primary"
|
|
||||||
link
|
|
||||||
>
|
|
||||||
<router-link
|
<router-link
|
||||||
:to="{
|
:to="{
|
||||||
path: getRoutePath('device.monitor_alarm/lists'),
|
path: getRoutePath('device.monitor_alarm/lists'),
|
||||||
|
@ -162,7 +215,7 @@
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
报警
|
报警
|
||||||
</router-link>
|
</router-link>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -181,7 +234,13 @@
|
||||||
<pagination v-model="pager" @change="getLists" />
|
<pagination v-model="pager" @change="getLists" />
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
<edit-popup
|
||||||
|
v-if="showEdit"
|
||||||
|
ref="editRef"
|
||||||
|
:dict-data="dictData"
|
||||||
|
@success="getLists"
|
||||||
|
@close="showEdit = false"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -225,7 +284,9 @@ const handleSelectionChange = (val: any[]) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取字典数据
|
// 获取字典数据
|
||||||
const { dictData } = useDictData('device_type,device_status,device_online_status,device_bind_status,monitor_item')
|
const { dictData } = useDictData(
|
||||||
|
'device_type,device_status,device_online_status,device_bind_status,monitor_item'
|
||||||
|
)
|
||||||
|
|
||||||
// 分页相关
|
// 分页相关
|
||||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||||
|
@ -257,4 +318,3 @@ const handleDelete = async (id: number | any[]) => {
|
||||||
|
|
||||||
getLists()
|
getLists()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -112,6 +112,8 @@ class LandPlantLogic extends BaseLogic
|
||||||
*/
|
*/
|
||||||
public static function delete(array $params): bool
|
public static function delete(array $params): bool
|
||||||
{
|
{
|
||||||
|
$landPlant = LandPlant::findOrEmpty($params['id'])->toArray();
|
||||||
|
Land::where('id', $landPlant['land_id'])->inc('score', $landPlant['area'])->update();
|
||||||
Db::name('land_plant_action')->where('plant_id', $params['id'])->delete();
|
Db::name('land_plant_action')->where('plant_id', $params['id'])->delete();
|
||||||
return LandPlant::destroy($params['id']);
|
return LandPlant::destroy($params['id']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue