更新后台管理系统

This commit is contained in:
yaooo 2023-11-30 17:35:01 +08:00
parent 74c96d591d
commit 1748e7abe1
2 changed files with 83 additions and 4 deletions

View File

@ -2,8 +2,8 @@ const config = {
terminal: 1, //终端 terminal: 1, //终端
title: '后台管理系统', //网站默认标题 title: '后台管理系统', //网站默认标题
version: '1.6.0', //版本号 version: '1.6.0', //版本号
baseUrl: `${import.meta.env.VITE_APP_BASE_URL || ''}/`, //请求接口域名 // baseUrl: `${import.meta.env.VITE_APP_BASE_URL || ''}/`, //请求接口域名
// baseUrl: 'http://127.0.0.1:30005/', baseUrl: 'http://127.0.0.1:30005/',
urlPrefix: 'adminapi', //请求默认前缀 urlPrefix: 'adminapi', //请求默认前缀
timeout: 10 * 1000 //请求超时时长 timeout: 10 * 1000 //请求超时时长
} }

View File

@ -58,13 +58,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="种植操作" prop="type_text" show-overflow-tooltip /> <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" align="center" prop="plant_date"> <el-table-column label="种植操作时间" width="180" align="center" prop="plant_date">
<template #default="{ row }"> <template #default="{ row }">
<span>{{ row.create_time ? timeFormat(row.create_time, 'yyyy-mm-dd hh:MM:ss') : '' }}</span> <span>{{ row.create_time ? timeFormat(row.create_time, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="120" align="center" fixed="right"> <el-table-column label="操作" width="200" align="center" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button
v-perms="['land.land_plant_action/edit']" v-perms="['land.land_plant_action/edit']"
@ -74,6 +73,10 @@
> >
编辑 编辑
</el-button> </el-button>
<el-button type="primary" link @click="handleDetail(row)"
>
操作详情
</el-button>
<el-button <el-button
v-perms="['land.land_plant_action/delete']" v-perms="['land.land_plant_action/delete']"
type="danger" type="danger"
@ -92,6 +95,13 @@
</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="dialogTableVisible" title="种植操作详情">
<el-table :data="detailData.gridData">
<el-table-column property="item" label="操作项" width="150" />
<el-table-column property="value" label="操作内容" />
</el-table>
</el-dialog>
</template> </template>
<script lang="ts" setup name="landPlantActionLists"> <script lang="ts" setup name="landPlantActionLists">
@ -121,6 +131,56 @@ const queryParams = reactive({
end_time: '', end_time: '',
}) })
const actionMap = reactive({
'1': {
kind: '肥料种类',
breed: '肥料品牌',
dosage: '肥料用量',
start_date: '开始日期',
end_date: '结束日期',
area: '施肥面积',
user: '参与人',
pic: '施肥图片',
remark: '备注信息'
},
'2': {
kind: '除草剂种类',
breed: '除草剂品牌',
dosage: '除草剂用量',
start_date: '开始日期',
end_date: '结束日期',
area: '作业面积',
user: '参与人',
pic: '除草图片',
remark: '备注信息'
},
'3': {
type: '灌溉类型',
start_date: '开始日期',
end_date: '结束日期',
area: '灌溉面积',
user: '参与人',
pic: '灌溉图片',
remark: '备注信息'
},
'4': {
type: '杀虫剂种类',
breed: '杀虫剂品牌',
dosage: '杀虫剂用量',
start_date: '开始日期',
end_date: '结束日期',
area: '作业面积',
user: '参与人',
pic: '杀虫图片',
remark: '备注信息'
},
'5': {
user: '参与人',
pic: '收获图片',
remark: '备注信息'
}
})
// //
const selectData = ref<any[]>([]) const selectData = ref<any[]>([])
@ -138,6 +198,25 @@ const { pager, getLists, resetParams, resetPage } = usePaging({
params: queryParams params: queryParams
}) })
const dialogTableVisible = ref(false)
const detailData = reactive({
gridData : [{}]
})
//
const handleDetail = (data: any) => {
const action = JSON.parse(data.detail)
detailData.gridData = [{}]
for (const key in action) {
let item = actionMap[data.type][key]
detailData.gridData.unshift({
item: item,
value: action[key]
})
}
dialogTableVisible.value = true
}
// //
const handleAdd = async () => { const handleAdd = async () => {
showEdit.value = true showEdit.value = true