From 3a154bdb0a5aaa2c0ac3eac95a6ba747068bd454 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 13 一月 2026 10:00:37 +0800
Subject: [PATCH] 优化

---
 admin/src/views/business/jkCabinet.vue |  149 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 149 insertions(+), 0 deletions(-)

diff --git a/admin/src/views/business/jkCabinet.vue b/admin/src/views/business/jkCabinet.vue
new file mode 100644
index 0000000..8383506
--- /dev/null
+++ b/admin/src/views/business/jkCabinet.vue
@@ -0,0 +1,149 @@
+<template>
+  <TableLayout :permissions="['business:jkcabinet:query']">
+    <!-- 鎼滅储琛ㄥ崟 -->
+    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
+      <el-form-item label="璁惧缂栧彿" prop="code">
+        <el-input v-model="searchForm.code" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" @keypress.enter.native="search"></el-input>
+      </el-form-item>
+      <el-form-item label="璁惧鍚嶇О" prop="name">
+        <el-input v-model="searchForm.name" placeholder="璇疯緭鍏ヨ澶囧悕绉�" @keypress.enter.native="search"></el-input>
+      </el-form-item>
+      <el-form-item label="杩愯鐘舵��" prop="runStatus">
+        <el-select v-model="searchForm.runStatus" placeholder="璇烽�夋嫨" @change="search">
+          <el-option label="鍏ㄩ儴" value=""></el-option>
+          <el-option label="鍦ㄧ嚎" :value="0"></el-option>
+          <el-option label="绂荤嚎" :value="1"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="鐘舵��" prop="status">
+        <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨" @change="search">
+          <el-option label="鍏ㄩ儴" value=""></el-option>
+          <el-option label="鍚敤" :value="0"></el-option>
+          <el-option label="绂佺敤" :value="1"></el-option>
+        </el-select>
+      </el-form-item>
+      <section>
+        <el-button type="primary" @click="search">鎼滅储</el-button>
+        <el-button @click="reset">閲嶇疆</el-button>
+      </section>
+    </el-form>
+    <!-- 琛ㄦ牸鍜屽垎椤� -->
+    <template v-slot:table-wrap>
+      <ul class="toolbar" v-permissions="['business:jkcabinet:create', 'business:jkcabinet:delete']">
+        <li><el-button type="primary" @click="$refs.operaJkCabinetWindow.open('鏂板缓璁惧')" icon="el-icon-plus" v-permissions="['business:jkcabinet:create']">鏂板缓</el-button></li>
+        <li><el-button type="warning" @click="$refs.alcoholTest.open('鏂板缓閰掔簿妫�娴嬮厤缃�', form)">閰掔簿妫�娴嬮厤缃�</el-button></li>
+      </ul>
+      <el-table
+        :height="tableHeightNew"
+        v-loading="isWorking.search"
+        :data="tableData.list"
+        stripe
+      >
+        <el-table-column prop="code" label="璁惧缂栧彿" min-width="100px"></el-table-column>
+        <el-table-column prop="name" label="璁惧鍚嶇О" min-width="100px"></el-table-column>
+        <el-table-column prop="devId" label="璁惧ID" min-width="100px"></el-table-column>
+        <el-table-column prop="linkAddr" label="閫氳鍦板潃" min-width="100px"></el-table-column>
+        <el-table-column prop="port" label="绔彛鍙�" min-width="100px"></el-table-column>
+        <el-table-column prop="location" label="鎵�鍦ㄤ綅缃�" min-width="100px"></el-table-column>
+        <el-table-column label="鏌滄牸鏁伴噺" min-width="100px">
+          <template slot-scope="{row}">
+            <el-button @click="$refs.cabinetDetails.open(row.name + '-鏌滄牸淇℃伅', row.id)">{{row.gridNum}}</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column label="杩愯鐘舵��" min-width="100px">
+          <template slot-scope="{row}">
+            <el-link type="success" :underline="false" v-if="row.runStatus === 0">鍦ㄧ嚎</el-link>
+            <el-link type="danger" :underline="false" v-if="row.runStatus === 1">绂荤嚎</el-link>
+          </template>
+        </el-table-column>
+        <el-table-column label="鐘舵��" min-width="100px">
+          <template slot-scope="{row}">
+            <el-switch
+              v-model="row.status"
+              @change="changeStatus($event, row.id)"
+              active-color="#13ce66"
+              inactive-color="#ff4949"
+              :active-value="0"
+              :inactive-value="1">
+            </el-switch>
+          </template>
+        </el-table-column>
+        <el-table-column
+          v-if="containPermissions(['business:jkcabinet:update', 'business:jkcabinet:delete'])"
+          label="鎿嶄綔"
+          min-width="200"
+          fixed="right"
+        >
+          <template slot-scope="{row}">
+            <el-button type="text" @click="$refs.cabinetDetails.open(row.name + '-鏌滄牸淇℃伅', row.id)">缁戝畾閽ュ寵</el-button>
+            <el-button type="text" @click="$refs.operaJkCabinetWindow.open('缂栬緫閽ュ寵鏌滃熀鏈俊鎭〃', row)" v-permissions="['business:jkcabinet:update']">缂栬緫</el-button>
+            <el-button type="text" @click="deleteById(row)" v-permissions="['business:jkcabinet:delete']">鍒犻櫎</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        @size-change="handleSizeChange"
+        @current-change="handlePageChange"
+        :pagination="tableData.pagination"
+      >
+      </pagination>
+    </template>
+    <!-- 鏂板缓/淇敼 -->
+    <OperaJkCabinetWindow ref="operaJkCabinetWindow" @success="handlePageChange"/>
+    <!-- 鏌滃瓙璇︽儏 -->
+    <CabinetDetails ref="cabinetDetails" />
+    <!-- 鏂板閰掔簿妫�娴� -->
+    <AlcoholTest ref="alcoholTest" @success="GetCabinetConfig" />
+  </TableLayout>
+</template>
+
+<script>
+import BaseTable from '@/components/base/BaseTable'
+import TableLayout from '@/layouts/TableLayout'
+import Pagination from '@/components/common/Pagination'
+import OperaJkCabinetWindow from '@/components/business/OperaJkCabinetWindow'
+import CabinetDetails from '@/components/business/cabinetDetails'
+import AlcoholTest from '@/components/business/alcoholTest'
+import { updateStatusById, getCabinetConfig } from '@/api/business/jkCabinet'
+export default {
+  name: 'JkCabinet',
+  extends: BaseTable,
+  components: { TableLayout, Pagination, OperaJkCabinetWindow, CabinetDetails, AlcoholTest},
+  data () {
+    return {
+      // 鎼滅储
+      searchForm: {
+        code: '',
+        name: '',
+        status: '',
+        runStatus: ''
+      },
+      form: null
+    }
+  },
+  created () {
+    this.config({
+      module: '閽ュ寵鏌滃熀鏈俊鎭〃',
+      api: '/business/jkCabinet',
+      'field.id': 'id',
+      'field.main': 'id'
+    })
+    this.search()
+    this.GetCabinetConfig()
+  },
+  methods: {
+    changeStatus(status, id) {
+      updateStatusById({ id, status })
+        .then(res => {
+          this.search()
+        })
+    },
+    GetCabinetConfig() {
+      getCabinetConfig()
+        .then(res => {
+          this.form = res
+        })
+    }
+  }
+}
+</script>

--
Gitblit v1.9.3