Commit 0d6f13796b5ef3a4be753ba5e95eeb86be676560
1 parent
16839a52
设备和场地
Showing
3 changed files
with
396 additions
and
10 deletions
src/api/system/venueInfo.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +// 分页查询列表 | ||
| 5 | +export function listLimitOfVenueInfo(params,page,limit) { | ||
| 6 | + return request({ | ||
| 7 | + url: '/linggang/venue/info/list/limit/'+page+'/'+limit, | ||
| 8 | + method: 'post', | ||
| 9 | + refreshTip:false, | ||
| 10 | + params | ||
| 11 | + }) | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +// 选择列表 | ||
| 15 | +export function selectListOfVenueInfo(params) { | ||
| 16 | + return request({ | ||
| 17 | + url: '/linggang/venue/info/list/select', | ||
| 18 | + method: 'post', | ||
| 19 | + params | ||
| 20 | + }) | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +// 导出报表列表 | ||
| 24 | +export function exportReportList(params) { | ||
| 25 | + return request({ | ||
| 26 | + url: '/linggang/venue/info/export', | ||
| 27 | + method: 'get', | ||
| 28 | + params | ||
| 29 | + }) | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +//查询列表详情 | ||
| 33 | +export function viewOfVenueInfo(id) { | ||
| 34 | + return request({ | ||
| 35 | + url: '/linggang/venue/info/view/'+id, | ||
| 36 | + method: 'get' | ||
| 37 | + }) | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +// 添加数据 | ||
| 41 | +export function addOfVenueInfo(params) { | ||
| 42 | + return request({ | ||
| 43 | + url: '/linggang/venue/info/add', | ||
| 44 | + method: 'post', | ||
| 45 | + params | ||
| 46 | + }) | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | +//修改数据 | ||
| 50 | +export function updateOfVenueInfo(params) { | ||
| 51 | + return request({ | ||
| 52 | + url: "/linggang/venue/info/update", | ||
| 53 | + method: "post", | ||
| 54 | + params | ||
| 55 | + }) | ||
| 56 | +} | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + //修改状态 | ||
| 60 | +export function updateStatusOfVenueInfo(params) { | ||
| 61 | + return request({ | ||
| 62 | + url: "/linggang/venue/info/update/status", | ||
| 63 | + method: "post", | ||
| 64 | + params | ||
| 65 | + }) | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | + //删除数据 | ||
| 69 | +export function deleteOfVenueInfo(id) { | ||
| 70 | + return request({ | ||
| 71 | + url: "/linggang/venue/info/del/"+id, | ||
| 72 | + method: "get" | ||
| 73 | + }) | ||
| 74 | +} |
src/views/equipment/equipment/index.vue
| 1 | <template> | 1 | <template> |
| 2 | <div class="app-container"> | 2 | <div class="app-container"> |
| 3 | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px"> | 3 | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px"> |
| 4 | - <el-form-item label="场地名称" prop="siteName"> | ||
| 5 | - <el-input v-model="queryParams.siteName" placeholder="请输入场地名称" clearable @keyup.enter="handleQuery" /> | 4 | + <el-form-item label="设备名称" prop="name"> |
| 5 | + <el-input v-model="queryParams.name" placeholder="请输入场地名称" clearable @keyup.enter="handleQuery" /> | ||
| 6 | </el-form-item> | 6 | </el-form-item> |
| 7 | <el-form-item label="安置地址" prop="address"> | 7 | <el-form-item label="安置地址" prop="address"> |
| 8 | <el-input v-model="queryParams.address" placeholder="请输入安置地址" clearable @keyup.enter="handleQuery" /> | 8 | <el-input v-model="queryParams.address" placeholder="请输入安置地址" clearable @keyup.enter="handleQuery" /> |
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }} | 50 | {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }} |
| 51 | </template> | 51 | </template> |
| 52 | </el-table-column> | 52 | </el-table-column> |
| 53 | - <el-table-column label="场地名称" align="center" prop="siteName" width="200" /> | 53 | + <el-table-column label="设备名称" align="center" prop="name" width="200" /> |
| 54 | <el-table-column label="安置地址" align="center" prop="address" width="300" /> | 54 | <el-table-column label="安置地址" align="center" prop="address" width="300" /> |
| 55 | <el-table-column label="设备状态" align="center" prop="status"> | 55 | <el-table-column label="设备状态" align="center" prop="status"> |
| 56 | <template #default="scope"> | 56 | <template #default="scope"> |
| @@ -88,8 +88,8 @@ | @@ -88,8 +88,8 @@ | ||
| 88 | <!-- 添加或修改设备信息对话框 --> | 88 | <!-- 添加或修改设备信息对话框 --> |
| 89 | <el-dialog :title="title" v-model="open" width="500px" append-to-body> | 89 | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| 90 | <el-form ref="equipmentRef" :model="form" :rules="rules" label-width="80px"> | 90 | <el-form ref="equipmentRef" :model="form" :rules="rules" label-width="80px"> |
| 91 | - <el-form-item label="场地名称" prop="siteName"> | ||
| 92 | - <el-input v-model="form.siteName" placeholder="请输入场地名称" /> | 91 | + <el-form-item label="设备名称" prop="name"> |
| 92 | + <el-input v-model="form.name" placeholder="请输入场地名称" /> | ||
| 93 | </el-form-item> | 93 | </el-form-item> |
| 94 | <el-form-item label="安置地址" prop="address"> | 94 | <el-form-item label="安置地址" prop="address"> |
| 95 | <el-input v-model="form.address" placeholder="请输入安置地址" /> | 95 | <el-input v-model="form.address" placeholder="请输入安置地址" /> |
| @@ -103,6 +103,12 @@ | @@ -103,6 +103,12 @@ | ||
| 103 | }}</el-radio> | 103 | }}</el-radio> |
| 104 | </el-radio-group> | 104 | </el-radio-group> |
| 105 | </el-form-item> | 105 | </el-form-item> |
| 106 | + <el-form-item label="安置场地" prop="yardId"> | ||
| 107 | + <el-select v-model="form.yardId" placeholder="场地名称" style="width: 380px;"> | ||
| 108 | + <el-option v-for="venue in venues" :key="venue.id" :label="venue.name" :value="venue.id"></el-option> | ||
| 109 | + </el-select> | ||
| 110 | + </el-form-item> | ||
| 111 | + | ||
| 106 | <el-form-item label="设备权限 " prop="promise"> | 112 | <el-form-item label="设备权限 " prop="promise"> |
| 107 | <el-checkbox-group v-model="form.promise"> | 113 | <el-checkbox-group v-model="form.promise"> |
| 108 | <el-checkbox v-for="dict in sys_status" :key="dict.value" :label="dict.value"> | 114 | <el-checkbox v-for="dict in sys_status" :key="dict.value" :label="dict.value"> |
| @@ -160,6 +166,7 @@ | @@ -160,6 +166,7 @@ | ||
| 160 | </template> | 166 | </template> |
| 161 | 167 | ||
| 162 | <script setup name="Equipment"> | 168 | <script setup name="Equipment"> |
| 169 | +import { selectListOfVenueInfo } from "@/api/system/venueInfo"; | ||
| 163 | import { addEquipment, delEquipment, getEquipment, getLog, listEquipment, updateEquipment } from "@/api/equipment/equipment"; | 170 | import { addEquipment, delEquipment, getEquipment, getLog, listEquipment, updateEquipment } from "@/api/equipment/equipment"; |
| 164 | 171 | ||
| 165 | const { proxy } = getCurrentInstance(); | 172 | const { proxy } = getCurrentInstance(); |
| @@ -183,6 +190,7 @@ const logTotal = ref(0); //总条目数 | @@ -183,6 +190,7 @@ const logTotal = ref(0); //总条目数 | ||
| 183 | const pageSizes = [5, 10, 20, 50]; //每页显示多少条 | 190 | const pageSizes = [5, 10, 20, 50]; //每页显示多少条 |
| 184 | const currentPage = ref(1) // 当前页 | 191 | const currentPage = ref(1) // 当前页 |
| 185 | const globalRow = ref(null) // 当前行数据 | 192 | const globalRow = ref(null) // 当前行数据 |
| 193 | +const venues=ref([]) | ||
| 186 | 194 | ||
| 187 | const changeFlag = ref(true) | 195 | const changeFlag = ref(true) |
| 188 | 196 | ||
| @@ -191,7 +199,7 @@ const data = reactive({ | @@ -191,7 +199,7 @@ const data = reactive({ | ||
| 191 | queryParams: { | 199 | queryParams: { |
| 192 | pageNum: 1, | 200 | pageNum: 1, |
| 193 | pageSize: 10, | 201 | pageSize: 10, |
| 194 | - siteName: null, | 202 | + name: null, |
| 195 | address: null, | 203 | address: null, |
| 196 | ip: null, | 204 | ip: null, |
| 197 | status: null, | 205 | status: null, |
| @@ -200,8 +208,8 @@ const data = reactive({ | @@ -200,8 +208,8 @@ const data = reactive({ | ||
| 200 | deviceId: null, | 208 | deviceId: null, |
| 201 | }, | 209 | }, |
| 202 | rules: { | 210 | rules: { |
| 203 | - siteName: [ | ||
| 204 | - { required: true, message: "场地名称不能为空", trigger: "blur" } | 211 | + name: [ |
| 212 | + { required: true, message: "设备名称不能为空", trigger: "blur" } | ||
| 205 | ], | 213 | ], |
| 206 | address: [ | 214 | address: [ |
| 207 | { required: true, message: "安置地址不能为空", trigger: "blur" } | 215 | { required: true, message: "安置地址不能为空", trigger: "blur" } |
| @@ -214,6 +222,9 @@ const data = reactive({ | @@ -214,6 +222,9 @@ const data = reactive({ | ||
| 214 | ], | 222 | ], |
| 215 | promise: [ | 223 | promise: [ |
| 216 | { required: true, message: "设备权限 不能为空", trigger: "blur" } | 224 | { required: true, message: "设备权限 不能为空", trigger: "blur" } |
| 225 | + ], | ||
| 226 | + yardId: [ | ||
| 227 | + { required: true, message: "安置场地 不能为空", trigger: "blur" } | ||
| 217 | ], | 228 | ], |
| 218 | } | 229 | } |
| 219 | }); | 230 | }); |
| @@ -226,7 +237,12 @@ function getList() { | @@ -226,7 +237,12 @@ function getList() { | ||
| 226 | listEquipment(queryParams.value).then(response => { | 237 | listEquipment(queryParams.value).then(response => { |
| 227 | equipmentList.value = response.rows; | 238 | equipmentList.value = response.rows; |
| 228 | total.value = response.total; | 239 | total.value = response.total; |
| 229 | - loading.value = false; | 240 | + |
| 241 | + selectListOfVenueInfo().then(response=>{ | ||
| 242 | + venues.value = response.data; | ||
| 243 | + loading.value = false; | ||
| 244 | + }) | ||
| 245 | + | ||
| 230 | }); | 246 | }); |
| 231 | } | 247 | } |
| 232 | 248 | ||
| @@ -265,7 +281,7 @@ const handleCurrentChange = (val) => { | @@ -265,7 +281,7 @@ const handleCurrentChange = (val) => { | ||
| 265 | function reset() { | 281 | function reset() { |
| 266 | form.value = { | 282 | form.value = { |
| 267 | id: null, | 283 | id: null, |
| 268 | - siteName: null, | 284 | + name: null, |
| 269 | address: null, | 285 | address: null, |
| 270 | ip: null, | 286 | ip: null, |
| 271 | status: null, | 287 | status: null, |
src/views/system/venueInfo/venueInfo.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="app-container"> | ||
| 3 | + <div class="query-from"> | ||
| 4 | + <el-form :inline="true" :model="queryParamsOfVenueInfo" class="demo-form-inline"> | ||
| 5 | + <el-form-item label="场站编号" props="parkCode"> | ||
| 6 | + <el-input style="width: 120px;" v-model="queryParamsOfVenueInfo.parkCode" placeholder="请输入场站编号" clearable @keyup.enter="handleQueryOfVenueInfo" /> | ||
| 7 | + </el-form-item> | ||
| 8 | + | ||
| 9 | + | ||
| 10 | + <el-form-item label="场站名称" props="name"> | ||
| 11 | + <el-form-item label="场站名称" props="name"> | ||
| 12 | + <el-input style="width: 120px;" v-model="queryParamsOfVenueInfo.name" placeholder="请输入场站名称" clearable @keyup.enter="handleQueryOfVenueInfo" /> | ||
| 13 | + </el-form-item> | ||
| 14 | + </el-form-item> | ||
| 15 | + | ||
| 16 | + <el-form-item> | ||
| 17 | + <el-button type="primary" icon="Search" @click="handleQueryOfVenueInfo">搜索</el-button> | ||
| 18 | + <el-button icon="Refresh" @click="resetQueryOfVenueInfo">重置</el-button> | ||
| 19 | + </el-form-item> | ||
| 20 | + </el-form> | ||
| 21 | + | ||
| 22 | + <el-row :gutter="10" class="mb8"> | ||
| 23 | + <el-col :span="1.5"> | ||
| 24 | + <el-button type="primary" plain icon="Plus" @click="handleAddOfVenueInfo" v-hasPermi="['venue:info:add']">新增</el-button> | ||
| 25 | + </el-col> | ||
| 26 | + | ||
| 27 | + <el-col :span="1.5"> | ||
| 28 | + <el-button type="success" plain icon="Edit" :disabled="singleVenueInfo" @click="handleUpdateOfVenueInfo" v-hasPermi="['venue:info:update']">修改</el-button> | ||
| 29 | + </el-col> | ||
| 30 | + | ||
| 31 | + <right-toolbar v-model:showSearch="showSearchOfVenueInfo" @queryTable="getListOfVenueInfo"></right-toolbar> | ||
| 32 | + </el-row> | ||
| 33 | + </div> | ||
| 34 | + | ||
| 35 | + <el-table v-loading="loadingOfVenueInfo" :data="listOfVenueInfo" @selection-change="handleSelectionChangeOfVenueInfo" border max-height="600" | ||
| 36 | + :default-expand-all="false" :row-class-name="tableRowClassName" @sort-change="sortChangeOfVenueInfo"> | ||
| 37 | + <el-table-column type="selection" width="50" align="center" /> | ||
| 38 | + <el-table-column label="序号" type="index" width="60" align="center"> | ||
| 39 | + <template #default="scope"> | ||
| 40 | + {{ (queryParamsOfVenueInfo.pageNum - 1) * queryParamsOfVenueInfo.pageSize + scope.$index + 1 }} | ||
| 41 | + </template> | ||
| 42 | + </el-table-column> | ||
| 43 | + | ||
| 44 | + <el-table-column label="场站编号" align="center" prop="parkCode" sortable /> | ||
| 45 | + <el-table-column label="场站名称" align="center" prop="name" sortable /> | ||
| 46 | + <el-table-column label="地址" align="center" prop="parkAddr" sortable /> | ||
| 47 | + <el-table-column label="是否删除" align="center" prop="deleteFlagStr" sortable /> | ||
| 48 | + | ||
| 49 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="160"> | ||
| 50 | + <template #default="scope"> | ||
| 51 | + <el-button type="success" plain icon="Edit" :disabled="singleVenueInfo" @click="handleUpdateOfVenueInfo(scope.row)" v-hasPermi="['venue:info:update']">修改</el-button> | ||
| 52 | + | ||
| 53 | + </template> | ||
| 54 | + </el-table-column> | ||
| 55 | + </el-table> | ||
| 56 | + | ||
| 57 | + <pagination v-show="totalOfVenueInfo > 0" :total="totalOfVenueInfo" v-model:pageOfVenueInfo="queryParamsOfVenueInfo.pageNum" v-model:limit="queryParamsOfVenueInfo.pageSize" | ||
| 58 | + @pagination="getListOfVenueInfo" /> | ||
| 59 | + | ||
| 60 | + <el-dialog :title="titleOfVenueInfo" v-model="openOfVenueInfo" width="500px" append-to-body> | ||
| 61 | + <el-form :model="formOfVenueInfo" ref="rulesOfVenueInfo" label-width="80px" :rules="checkRulesOfVenueInfo"> | ||
| 62 | + | ||
| 63 | + <el-form-item label="场站编号" prop="parkCode"> | ||
| 64 | + <el-input el-input="input" v-model="formOfVenueInfo.parkCode" placeholder="请输入场站编号" /> | ||
| 65 | + </el-form-item> | ||
| 66 | + <el-form-item label="场站名称" prop="name"> | ||
| 67 | + <el-input el-input="input" v-model="formOfVenueInfo.name" placeholder="请输入场站名称" /> | ||
| 68 | + </el-form-item> | ||
| 69 | + | ||
| 70 | + <el-form-item label="地址" prop="parkAddr"> | ||
| 71 | + <el-input el-input="input" v-model="formOfVenueInfo.parkAddr" placeholder="请输入地址" /> | ||
| 72 | + </el-form-item> | ||
| 73 | + <el-form-item label="是否删除" prop="delFlag"> | ||
| 74 | + <el-select v-model="formOfVenueInfo.delFlag" placeholder="请选择" style="width: 380px;"> | ||
| 75 | + <el-option v-for="dict in deleteFlagsOfVenueInfo" :key="dict.value" :label="dict.dictLabel" :value="dict.dictValue"></el-option> | ||
| 76 | + </el-select> | ||
| 77 | + </el-form-item> | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + </el-form> | ||
| 81 | + | ||
| 82 | + <template #footer> | ||
| 83 | + <div class="dialog-footer"> | ||
| 84 | + <el-button type="primary" @click="submitFormOfVenueInfo">确 定</el-button> | ||
| 85 | + <el-button @click="cancelOfVenueInfo">取 消</el-button> | ||
| 86 | + </div> | ||
| 87 | + </template> | ||
| 88 | + </el-dialog> | ||
| 89 | + </div> | ||
| 90 | +</template> | ||
| 91 | + | ||
| 92 | + | ||
| 93 | +<script setup name="VenueInfo"> | ||
| 94 | + import { getDicts,getDictsDelFlag } from '@/api/system/dict/data'; | ||
| 95 | + import { listLimitOfVenueInfo, viewOfVenueInfo, addOfVenueInfo, updateOfVenueInfo,updateStatusOfVenueInfo,deleteOfVenueInfo } from "@/api/system/venueInfo"; | ||
| 96 | + const { proxy } = getCurrentInstance(); | ||
| 97 | + | ||
| 98 | + const listOfVenueInfo = ref([]); | ||
| 99 | + const openOfVenueInfo = ref(false); | ||
| 100 | + const titleOfVenueInfo = ref(""); | ||
| 101 | + const loadingOfVenueInfo = ref(true); | ||
| 102 | + const showSearchOfVenueInfo = ref(true); | ||
| 103 | + const idsOfVenueInfo = ref([]); | ||
| 104 | + const singleVenueInfo = ref(true); | ||
| 105 | + const multipleVenueInfo = ref(true); | ||
| 106 | + | ||
| 107 | + | ||
| 108 | + const pageOfVenueInfo = ref(1) //第几页 | ||
| 109 | + const sizeOfVenueInfo = ref(10) //一页多少条 | ||
| 110 | + const totalOfVenueInfo = ref(0); | ||
| 111 | + const pageSizesOfVenueInfo = [5, 10, 20, 50]; //每页显示多少条 | ||
| 112 | + const currentPageOfVenueInfo = ref(1) // 当前页 | ||
| 113 | + const globalRowOfVenueInfo = ref(null) // 当前行数据 | ||
| 114 | + | ||
| 115 | + const changeFlagOfVenueInfo = ref(true) | ||
| 116 | + const deleteFlagsOfVenueInfo = ref([]) | ||
| 117 | + | ||
| 118 | + | ||
| 119 | + const dataOfVenueInfo = reactive({ | ||
| 120 | + formOfVenueInfo: {}, | ||
| 121 | + queryParamsOfVenueInfo: { | ||
| 122 | + pageNum: 1, | ||
| 123 | + pageSize: 10, | ||
| 124 | + id : null, | ||
| 125 | + parkCode : null, | ||
| 126 | + parkAddr : null, | ||
| 127 | + delFlag : null, | ||
| 128 | + createBy : null, | ||
| 129 | + crateTime : null, | ||
| 130 | + updateBy : null, | ||
| 131 | + updateTime : null, | ||
| 132 | + name : null, | ||
| 133 | + | ||
| 134 | + }, | ||
| 135 | + checkRulesOfVenueInfo: { | ||
| 136 | + id : [ | ||
| 137 | + { required: true, message: "", trigger: "blur" } | ||
| 138 | + ], | ||
| 139 | + parkCode : [ | ||
| 140 | + { required: true, message: "场站编号", trigger: "blur" } | ||
| 141 | + ], | ||
| 142 | + parkAddr : [ | ||
| 143 | + { required: true, message: "地址", trigger: "blur" } | ||
| 144 | + ], | ||
| 145 | + delFlag : [ | ||
| 146 | + { required: true, message: "是否删除", trigger: "blur" } | ||
| 147 | + ], | ||
| 148 | + name : [ | ||
| 149 | + { required: true, message: "场站名称", trigger: "blur" } | ||
| 150 | + ], | ||
| 151 | + } | ||
| 152 | + }); | ||
| 153 | + | ||
| 154 | + const { queryParamsOfVenueInfo, formOfVenueInfo, checkRulesOfVenueInfo } = toRefs(dataOfVenueInfo ); | ||
| 155 | + | ||
| 156 | + /** 查询设备信息列表 */ | ||
| 157 | + function getListOfVenueInfo() { | ||
| 158 | + loadingOfVenueInfo.value = true; | ||
| 159 | + listLimitOfVenueInfo(queryParamsOfVenueInfo.value,queryParamsOfVenueInfo.value.pageNum,queryParamsOfVenueInfo.value.pageSize).then(response => { | ||
| 160 | + listOfVenueInfo.value = response.records; | ||
| 161 | + totalOfVenueInfo.value = response.total; | ||
| 162 | + deleteFlagsOfVenueInfoFunction(function (){ | ||
| 163 | + loadingOfVenueInfo.value = false; | ||
| 164 | + }) | ||
| 165 | + }); | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + | ||
| 169 | + function deleteFlagsOfVenueInfoFunction(fun){ | ||
| 170 | + getDictsDelFlag().then(response=>{ | ||
| 171 | + deleteFlagsOfVenueInfo.value = response.data; | ||
| 172 | + | ||
| 173 | + | ||
| 174 | + if(fun){ | ||
| 175 | + fun(response); | ||
| 176 | + } | ||
| 177 | + }); | ||
| 178 | + } | ||
| 179 | + /**排序*/ | ||
| 180 | + function sortChangeOfVenueInfo(data){ | ||
| 181 | + queryParamsOfVenueInfo.value.order=data.order; | ||
| 182 | + queryParamsOfVenueInfo.value.prop=data.prop; | ||
| 183 | + getListOfVenueInfo(); | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + // 取消按钮 | ||
| 187 | + function cancelOfVenueInfo() { | ||
| 188 | + openOfVenueInfo.value = false; | ||
| 189 | + globalRowOfVenueInfo.value = null | ||
| 190 | + resetOfVenueInfo(); | ||
| 191 | + } | ||
| 192 | + | ||
| 193 | + const handleSizeChange = (val) => { | ||
| 194 | + sizeOfVenueInfo.value = val; | ||
| 195 | + } | ||
| 196 | + const handleCurrentChange = (val) => { | ||
| 197 | + pageOfVenueInfo.value = val; | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + | ||
| 201 | + // 表单重置 | ||
| 202 | + function resetOfVenueInfo() { | ||
| 203 | + formOfVenueInfo.value = { | ||
| 204 | + id : null, | ||
| 205 | + parkCode : null, | ||
| 206 | + parkAddr : null, | ||
| 207 | + delFlag : null, | ||
| 208 | + createBy : null, | ||
| 209 | + crateTime : null, | ||
| 210 | + updateBy : null, | ||
| 211 | + updateTime : null, | ||
| 212 | + name : null, | ||
| 213 | + }; | ||
| 214 | + proxy.resetForm("rulesOfVenueInfo"); | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + /** 搜索按钮操作 */ | ||
| 218 | + function handleQueryOfVenueInfo() { | ||
| 219 | + queryParamsOfVenueInfo.value.pageNum = 1; | ||
| 220 | + getListOfVenueInfo(); | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + /** 重置按钮操作 */ | ||
| 224 | + function resetQueryOfVenueInfo() { | ||
| 225 | + proxy.resetForm("queryOfVenueInfo"); | ||
| 226 | + handleQueryOfVenueInfo(); | ||
| 227 | + } | ||
| 228 | + | ||
| 229 | + // 多选框选中数据 | ||
| 230 | + function handleSelectionChangeOfVenueInfo(selection) { | ||
| 231 | + idsOfVenueInfo.value = selection.map(item => item.id); | ||
| 232 | + singleVenueInfo.value = selection.length != 1; | ||
| 233 | + multipleVenueInfo.value = !selection.length; | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + /** 新增按钮操作 */ | ||
| 237 | + function handleAddOfVenueInfo() { | ||
| 238 | + resetOfVenueInfo(); | ||
| 239 | + changeFlagOfVenueInfo.value = true; | ||
| 240 | + openOfVenueInfo.value = true; | ||
| 241 | + titleOfVenueInfo.value = "添加"; | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + /** 修改按钮操作 */ | ||
| 245 | + function handleUpdateOfVenueInfo(row) { | ||
| 246 | + resetOfVenueInfo(); | ||
| 247 | + const _id = row.id || idsOfVenueInfo.value | ||
| 248 | + viewOfVenueInfo(_id).then(response => { | ||
| 249 | + formOfVenueInfo.value = response.data; | ||
| 250 | + openOfVenueInfo.value = true; | ||
| 251 | + titleOfVenueInfo.value = "修改"; | ||
| 252 | + }); | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + /** 提交按钮 */ | ||
| 256 | + function submitFormOfVenueInfo() { | ||
| 257 | + proxy.$refs["rulesOfVenueInfo"].validate(valid => { | ||
| 258 | + if (valid) { | ||
| 259 | + if (formOfVenueInfo.value.id != null) { | ||
| 260 | + updateOfVenueInfo(formOfVenueInfo.value).then(response => { | ||
| 261 | + proxy.$modal.msgSuccess("修改成功"); | ||
| 262 | + openOfVenueInfo.value = false; | ||
| 263 | + getListOfVenueInfo(); | ||
| 264 | + }); | ||
| 265 | + } else { | ||
| 266 | + addOfVenueInfo(formOfVenueInfo.value).then(response => { | ||
| 267 | + proxy.$modal.msgSuccess("新增成功"); | ||
| 268 | + openOfVenueInfo.value = false; | ||
| 269 | + getListOfVenueInfo(); | ||
| 270 | + }); | ||
| 271 | + } | ||
| 272 | + } | ||
| 273 | + }); | ||
| 274 | + } | ||
| 275 | + | ||
| 276 | + /** 删除按钮操作 */ | ||
| 277 | + function handleDeleteOfVenueInfo(row) { | ||
| 278 | + const _idsOfVenueInfo = row.id || idsOfVenueInfo.value; | ||
| 279 | + proxy.$modal.confirm('是否确认删除 为"' + _idsOfVenueInfo + '"的数据项?').then(function () { | ||
| 280 | + return deleteOfVenueInfo(_idsOfVenueInfo); | ||
| 281 | + }).then(() => { | ||
| 282 | + getListOfVenueInfo(); | ||
| 283 | + proxy.$modal.msgSuccess("删除成功"); | ||
| 284 | + }).catch(() => { }); | ||
| 285 | + } | ||
| 286 | + | ||
| 287 | + /** 导出按钮操作 */ | ||
| 288 | + function handleExportOfVenueInfo() { | ||
| 289 | + proxy.download('venue/info/export', { | ||
| 290 | + ...queryParamsOfVenueInfo.value | ||
| 291 | + }, `VenueInfo_${new Date().getTime()}.xlsx`) | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + | ||
| 295 | + getListOfVenueInfo(); | ||
| 296 | +</script> | ||
| 0 | \ No newline at end of file | 297 | \ No newline at end of file |