From eb82684152ffb0acddf67da92e4533a0190eb258 Mon Sep 17 00:00:00 2001 From: MrShi <1878285526@qq.com> Date: 星期五, 10 十月 2025 18:27:31 +0800 Subject: [PATCH] 对接口 --- admin/src/components/business/cabinetDetails.vue | 63 +++++++++++++++++-------------- 1 files changed, 34 insertions(+), 29 deletions(-) diff --git a/admin/src/components/business/cabinetDetails.vue b/admin/src/components/business/cabinetDetails.vue index e858232..8e324d7 100644 --- a/admin/src/components/business/cabinetDetails.vue +++ b/admin/src/components/business/cabinetDetails.vue @@ -38,12 +38,34 @@ :data="list" stripe > - <el-table-column prop="code" label="鏌滄牸缂栧彿" min-width="100px"></el-table-column> + <el-table-column prop="code" label="鏌滄牸缂栫爜" min-width="100px"></el-table-column> <el-table-column prop="cabinetName" label="鎵�灞為挜鍖欐煖" min-width="100px"></el-table-column> - <el-table-column prop="keyId" label="缁戝畾閽ュ寵" min-width="100px"></el-table-column> + <el-table-column prop="keyId" label="缁戝畾閽ュ寵" min-width="100px"> + <template slot-scope="{row}"> + <el-select v-model="row.keyId" placeholder="璇烽�夋嫨"> + <el-option + v-for="item in keysAll" + :key="item.id" + :label="item.name" + :value="item.id"> + </el-option> + </el-select> + </template> + </el-table-column> + <el-table-column label="鏉垮彿" min-width="100px"> + <template slot-scope="{row}"> + <el-input v-model="row.boardCode" placeholder="璇疯緭鍏ユ澘鍙�"></el-input> + </template> + </el-table-column> + <el-table-column label="閫氶亾鍙�" min-width="100px"> + <template slot-scope="{row}"> + <el-input v-model="row.channelCode" placeholder="璇疯緭鍏ラ�氶亾鍙�"></el-input> + </template> + </el-table-column> <el-table-column label="鐘舵��" min-width="100px"> <template slot-scope="{row}"> <el-switch + @change="changeStatus($event, row.id)" v-model="row.status" active-color="#13ce66" inactive-color="#ff4949" @@ -64,33 +86,14 @@ <el-link type="success" v-if="row.bindStatus === 1">宸茬粦瀹�</el-link> </template> </el-table-column> - <el-table-column - label="鎿嶄綔" - min-width="100" - fixed="right" - > - <template slot-scope="{row}"> - <el-button type="text" v-if="row.bindStatus === 0">缁戝畾</el-button> - <el-button type="text" v-if="row.bindStatus === 1">瑙g粦</el-button> - </template> - </el-table-column> </el-table> - <div style="width: 100%; text-align: right; margin-top: 20px"> - <el-pagination - @current-change="handleCurrentChange" - :current-page="page" - :page-size="10" - layout="total, prev, pager, next, jumper" - :total="total"> - </el-pagination> - </div> </GlobalWindow> </template> <script> import BaseOpera from '@/components/base/BaseOpera' import GlobalWindow from '@/components/common/GlobalWindow' - import { fetchList } from '@/api/business/jkCabinetGrid' + import { fetchList, updateStatusById } from '@/api/business/jkCabinetGrid' export default { name: 'cabinetDetails', extends: BaseOpera, @@ -105,8 +108,7 @@ bindStatus: '' }, list: [], - page: 1, - total: 0, + keysAll: [], loading: false } }, @@ -117,6 +119,12 @@ this.getList() this.visible = true }, + changeStatus(status, id) { + updateStatusById({ id, status }) + .then(res => { + this.getList() + }) + }, handleCurrentChange(e) { this.page = e this.getList() @@ -125,14 +133,13 @@ this.searchForm.keyId = '' this.searchForm.status = '' this.searchForm.workingStatus = '' - this.page = 1 this.getList() }, getList() { this.loading = true fetchList({ - capacity: 10, - page: this.page, + capacity: 99999, + page: 1, model: { cabinetId: this.id, keyId: this.searchForm.keyId, @@ -140,9 +147,7 @@ workingStatus: this.searchForm.workingStatus } }).then(res => { - console.log(res) this.list = res.records - this.total = res.total }).finally(() => { this.loading = false }) -- Gitblit v1.9.3