From cb60b30e899aea2db91bd8cc0272df7508e12fa4 Mon Sep 17 00:00:00 2001 From: gaosp <gaosp> Date: 星期二, 16 一月 2024 23:26:42 +0800 Subject: [PATCH] update --- src/container/deviceType/index.vue | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/container/deviceType/index.vue b/src/container/deviceType/index.vue index 3878c1c..48e3937 100644 --- a/src/container/deviceType/index.vue +++ b/src/container/deviceType/index.vue @@ -1,7 +1,7 @@ <!-- * @Date: 2024-01-06 17:40:19 * @LastEditors: Sneed - * @LastEditTime: 2024-01-13 11:35:29 + * @LastEditTime: 2024-01-16 22:26:33 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/deviceType/index.vue --> <template> @@ -14,12 +14,8 @@ <el-input class="item-value" v-model="queryInfo.name"></el-input> </div> - - - <div class="item"> + <div class="item" style="flex: 1 1 auto;justify-content: flex-end;"> <el-button type="primary" size="small" @click="query">鏌ヨ</el-button> - </div> - <div class="item"> <el-button type="primary" size="small" @click="reset">閲嶇疆</el-button> </div> </template> @@ -39,7 +35,12 @@ label="鍚嶇О" width="180"> </el-table-column> - + <el-table-column align="center" label="鎿嶄綔" prop="editor"> + <template slot-scope="scope"> + <el-button size="mini" type="text" @click="editDeviceType(scope.row)">缂栬緫</el-button> + <el-button size="mini" type="text" @click="deleteHandle(scope.row)">鍒犻櫎</el-button> + </template> + </el-table-column> </template> </List> @@ -50,7 +51,7 @@ <script> import List from '../list/index.vue' import ManageAddUpdate from './Manage-add-update' - import { getUrl } from '@/api/Api' + import { getUrl,deviceTypeDelete } from '@/api/Api' export default { components: { List, @@ -84,6 +85,10 @@ this.addOrUpdateVisible = true }, + editDeviceType(row){ + this.row = row; + this.addOrUpdateVisible = true; + }, close() { this.addOrUpdateVisible = false }, @@ -94,6 +99,33 @@ addOrUpdateHandle(row) { this.row = row this.addOrUpdateVisible = true + }, + deleteHandle(row) { + let ids = [] + + ids.push(row.id) + + //ids = ids.join(',') + this.$confirm('纭畾瑕佹案涔呭垹闄ゆ椤�?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + deviceTypeDelete(ids).then(res => { + // if(res.result == ""){} + this.$message({ + type: 'success', + message: '鍒犻櫎鎴愬姛锛�' + }) + this.query (); + //this.submitForm() + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }) + }) } }, -- Gitblit v1.9.3