更新图片展示
This commit is contained in:
parent
9f8ee351ed
commit
7eec3bb829
|
@ -83,6 +83,9 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="负责人电话" prop="master_phone">
|
<el-form-item label="负责人电话" prop="master_phone">
|
||||||
<el-input v-model="formData.master_phone" clearable placeholder="请输入负责人电话" />
|
<el-input v-model="formData.master_phone" clearable placeholder="请输入负责人电话" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="土地图片" prop="pic">
|
||||||
|
<material-picker v-model="formData.pic" :limit="4" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</popup>
|
</popup>
|
||||||
|
@ -134,6 +137,7 @@ const formData = reactive({
|
||||||
latitude: '',
|
latitude: '',
|
||||||
master_name: '',
|
master_name: '',
|
||||||
master_phone: '',
|
master_phone: '',
|
||||||
|
pic: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
// 表单验证
|
// 表单验证
|
||||||
|
@ -167,10 +171,11 @@ const setFormData = async (data: Record<any, any>) => {
|
||||||
if (data[key] != null && data[key] != undefined) {
|
if (data[key] != null && data[key] != undefined) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
formData[key] = data[key]
|
formData[key] = data[key]
|
||||||
|
if (key == 'pic') {
|
||||||
|
formData[key] = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDetail = async (row: Record<string, any>) => {
|
const getDetail = async (row: Record<string, any>) => {
|
||||||
|
|
|
@ -45,16 +45,20 @@
|
||||||
<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">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag class="ml-2" type="success">ID: {{ row.user_id }}</el-tag>
|
<el-tag class="mr-2" type="success">ID: {{ row.user_id }}</el-tag>
|
||||||
<el-tag class="ml-2" type="success">账户: {{ row.user.account }}</el-tag>
|
<el-tag class="mr-2" type="success">账户: {{ row.user.account }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="土地名称" prop="title" show-overflow-tooltip />
|
<el-table-column label="土地名称">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-tag class="mr-2" type="success">{{ row.title }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="土地面积" prop="total_area" show-overflow-tooltip />
|
<el-table-column label="土地面积" prop="total_area" show-overflow-tooltip />
|
||||||
<el-table-column label="剩余面积" prop="residual_area" show-overflow-tooltip />
|
<el-table-column label="剩余面积" prop="residual_area" show-overflow-tooltip />
|
||||||
<el-table-column label="土地负责人" prop="master_name" show-overflow-tooltip />
|
<el-table-column label="土地负责人" prop="master_name" show-overflow-tooltip />
|
||||||
<el-table-column label="负责人电话" prop="master_phone" show-overflow-tooltip />
|
<el-table-column label="负责人电话" prop="master_phone" show-overflow-tooltip />
|
||||||
<el-table-column label="操作" width="280" align="center" fixed="right">
|
<el-table-column label="操作" width="350" align="center" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button
|
||||||
v-perms="['land.land/edit']"
|
v-perms="['land.land/edit']"
|
||||||
|
@ -64,6 +68,10 @@
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button type="primary" link @click="handleDetail(row)"
|
||||||
|
>
|
||||||
|
土地图片
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-perms="['land.land_plant/lists']"
|
v-perms="['land.land_plant/lists']"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@ -114,6 +122,22 @@
|
||||||
</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>
|
||||||
|
|
||||||
|
<el-dialog v-model="dialogPicVisible" title="土地图片" center>
|
||||||
|
<div style="display: inline-block; margin: 12px" v-for="img in detailData.picData" :key="img">
|
||||||
|
<el-image
|
||||||
|
style="width: 200px; height: 200px"
|
||||||
|
:src="img"
|
||||||
|
:zoom-rate="1.2"
|
||||||
|
:max-scale="5"
|
||||||
|
:min-scale="0.2"
|
||||||
|
:preview-src-list="detailData.picData"
|
||||||
|
:initial-index="4"
|
||||||
|
fit="cover"
|
||||||
|
center
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="landLists">
|
<script lang="ts" setup name="landLists">
|
||||||
|
@ -160,6 +184,22 @@ const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||||
params: queryParams
|
params: queryParams
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const dialogPicVisible = ref(false)
|
||||||
|
const detailData = reactive({
|
||||||
|
picData: [] as any[]
|
||||||
|
})
|
||||||
|
|
||||||
|
// 详情
|
||||||
|
const handleDetail = (data: any) => {
|
||||||
|
detailData.picData = []
|
||||||
|
const picList = JSON.parse(data.pic)
|
||||||
|
for (const key in picList) {
|
||||||
|
detailData.picData.unshift(picList[key])
|
||||||
|
}
|
||||||
|
console.log(detailData.picData)
|
||||||
|
dialogPicVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
// 添加
|
// 添加
|
||||||
const handleAdd = async () => {
|
const handleAdd = async () => {
|
||||||
showEdit.value = true
|
showEdit.value = true
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="种植图片" prop="pic">
|
<el-form-item label="种植图片" prop="pic">
|
||||||
<material-picker :limit="4" />
|
<material-picker v-model="formData.pic" :limit="4" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="播种时间" prop="plant_date">
|
<el-form-item label="播种时间" prop="plant_date">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
@ -126,7 +126,7 @@ const formData = reactive({
|
||||||
status: '',
|
status: '',
|
||||||
pic: '',
|
pic: '',
|
||||||
qr_code: '',
|
qr_code: '',
|
||||||
plant_date: '',
|
plant_date: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,6 +176,9 @@ const setFormData = async (data: Record<any, any>) => {
|
||||||
if (data[key] != null && data[key] != undefined) {
|
if (data[key] != null && data[key] != undefined) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
formData[key] = data[key]
|
formData[key] = data[key]
|
||||||
|
if (key == 'pic') {
|
||||||
|
formData[key] = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,14 +52,14 @@
|
||||||
<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">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag class="ml-2" type="success">ID: {{ row.user_id }}</el-tag>
|
<el-tag class="mr-2" type="success">ID: {{ row.user_id }}</el-tag>
|
||||||
<el-tag class="ml-2" type="success">账户: {{ row.account }}</el-tag>
|
<el-tag class="mr-2" type="success">账户: {{ row.account }}</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="ml-2" type="success">ID: {{ row.land_id }}</el-tag>
|
<el-tag class="mr-2" type="success">ID: {{ row.land_id }}</el-tag>
|
||||||
<el-tag class="ml-2" type="success">名称: {{ row.title }}</el-tag>
|
<el-tag class="mr-2" type="success">名称: {{ row.title }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="种植种类" prop="kind" show-overflow-tooltip />
|
<el-table-column label="种植种类" prop="kind" show-overflow-tooltip />
|
||||||
|
|
|
@ -42,14 +42,14 @@
|
||||||
<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">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag class="ml-2" type="success">ID: {{ row.user_id }}</el-tag>
|
<el-tag class="mr-2" type="success">ID: {{ row.user_id }}</el-tag>
|
||||||
<el-tag class="ml-2" type="success">账户: {{ row.account }}</el-tag>
|
<el-tag class="mr-2" type="success">账户: {{ row.account }}</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="ml-2" type="success">ID: {{ row.plant_id }}</el-tag>
|
<el-tag class="mr-2" type="success">ID: {{ row.plant_id }}</el-tag>
|
||||||
<el-tag class="ml-2" type="success">类型: {{ row.kind }} 品牌: {{ row.breed }}</el-tag>
|
<el-tag class="mr-2" type="success">类型: {{ row.kind }} 品牌: {{ row.breed }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="种植操作类型" prop="type">
|
<el-table-column label="种植操作类型" prop="type">
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
/>
|
/>
|
||||||
<el-table-column label="部门状态" prop="status" min-width="100">
|
<el-table-column label="部门状态" prop="status" min-width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag class="ml-2" :type="row.status ? '' : 'danger'">{{
|
<el-tag class="mr-2" :type="row.status ? '' : 'danger'">{{
|
||||||
row.status_desc
|
row.status_desc
|
||||||
}}</el-tag>
|
}}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
<el-table-column label="添加时间" prop="create_time" min-width="180" />
|
<el-table-column label="添加时间" prop="create_time" min-width="180" />
|
||||||
<el-table-column label="状态" prop="status" min-width="100">
|
<el-table-column label="状态" prop="status" min-width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag class="ml-2" :type="row.status ? '' : 'danger'">
|
<el-tag class="mr-2" :type="row.status ? '' : 'danger'">
|
||||||
{{ row.status_desc }}
|
{{ row.status_desc }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -62,14 +62,14 @@
|
||||||
<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">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag class="ml-2" type="success">ID: {{ row.user_id }}</el-tag>
|
<el-tag class="mr-2" type="success">ID: {{ row.user_id }}</el-tag>
|
||||||
<el-tag class="ml-2" type="success">账户: {{ row.account }}</el-tag>
|
<el-tag class="mr-2" type="success">账户: {{ row.account }}</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="ml-2" type="success">ID: {{ row.land_id }}</el-tag>
|
<el-tag class="mr-2" type="success">ID: {{ row.land_id }}</el-tag>
|
||||||
<el-tag class="ml-2" type="success">名称: {{ row.title }}</el-tag>
|
<el-tag class="mr-2" type="success">名称: {{ row.title }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="产品编号" prop="code" show-overflow-tooltip />
|
<el-table-column label="产品编号" prop="code" show-overflow-tooltip />
|
||||||
|
|
|
@ -69,7 +69,7 @@ class LandLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
return Land::where($this->searchWhere)->where($this->userSearch())->with('user')
|
return Land::where($this->searchWhere)->where($this->userSearch())->with('user')
|
||||||
->field(['id', 'user_id', 'title', 'total_area', 'residual_area', 'province_code', 'province_name', 'city_code', 'city_name', 'county_code', 'county_name', 'town_code', 'town_name', 'village_code', 'village_name', 'group_code', 'group_name', 'longitude', 'latitude', 'master_name', 'master_phone'])
|
->field(['id', 'user_id', 'title', 'total_area', 'residual_area', 'province_code', 'province_name', 'city_code', 'city_name', 'county_code', 'county_name', 'town_code', 'town_name', 'village_code', 'village_name', 'group_code', 'group_name', 'longitude', 'latitude', 'master_name', 'master_phone', 'pic'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()
|
->select()
|
||||||
|
|
|
@ -61,6 +61,7 @@ class LandLogic extends BaseLogic
|
||||||
'latitude' => $params['latitude'],
|
'latitude' => $params['latitude'],
|
||||||
'master_name' => $params['master_name'],
|
'master_name' => $params['master_name'],
|
||||||
'master_phone' => $params['master_phone'],
|
'master_phone' => $params['master_phone'],
|
||||||
|
'pic' => json_encode($params['pic']),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
|
@ -105,6 +106,7 @@ class LandLogic extends BaseLogic
|
||||||
'latitude' => $params['latitude'],
|
'latitude' => $params['latitude'],
|
||||||
'master_name' => $params['master_name'],
|
'master_name' => $params['master_name'],
|
||||||
'master_phone' => $params['master_phone'],
|
'master_phone' => $params['master_phone'],
|
||||||
|
'pic' => json_encode($params['pic']),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
|
|
|
@ -82,6 +82,7 @@ class LandValidate extends BaseValidate
|
||||||
'master_name' => '土地负责人',
|
'master_name' => '土地负责人',
|
||||||
'master_phone' => '负责人电话',
|
'master_phone' => '负责人电话',
|
||||||
'status' => '土地状态1-未种植 2-部分种植 3-全部种植',
|
'status' => '土地状态1-未种植 2-部分种植 3-全部种植',
|
||||||
|
'pic' => '土地图片',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue