MrShi
21 小时以前 39fc2d6754953e41a7334a2166347baacfcfb40a
admin/src/views/business/jkCabinet.vue
@@ -31,7 +31,7 @@
    <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 @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:jkcabinet:delete']">删除</el-button></li>
        <li><el-button type="warning" @click="$refs.alcoholTest.open('新建酒精检测配置', form)">酒精检测配置</el-button></li>
      </ul>
      <el-table
        :height="tableHeightNew"
@@ -52,8 +52,8 @@
        </el-table-column>
        <el-table-column label="运行状态" min-width="100px">
          <template slot-scope="{row}">
            <el-link type="success" v-if="row.runStatus === 0">在线</el-link>
            <el-link type="danger" v-if="row.runStatus === 1">离线</el-link>
            <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">
@@ -75,8 +75,7 @@
          fixed="right"
        >
          <template slot-scope="{row}">
            <el-button type="text">日志</el-button>
            <el-button type="text">绑定钥匙</el-button>
            <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>
@@ -93,6 +92,8 @@
    <OperaJkCabinetWindow ref="operaJkCabinetWindow" @success="handlePageChange"/>
    <!-- 柜子详情 -->
    <CabinetDetails ref="cabinetDetails" />
    <!-- 新增酒精检测 -->
    <AlcoholTest ref="alcoholTest" @success="GetCabinetConfig" />
  </TableLayout>
</template>
@@ -102,11 +103,12 @@
import Pagination from '@/components/common/Pagination'
import OperaJkCabinetWindow from '@/components/business/OperaJkCabinetWindow'
import CabinetDetails from '@/components/business/cabinetDetails'
import { updateStatusById } from '@/api/business/jkCabinet'
import AlcoholTest from '@/components/business/alcoholTest'
import { updateStatusById, getCabinetConfig } from '@/api/business/jkCabinet'
export default {
  name: 'JkCabinet',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaJkCabinetWindow, CabinetDetails },
  components: { TableLayout, Pagination, OperaJkCabinetWindow, CabinetDetails, AlcoholTest},
  data () {
    return {
      // 搜索
@@ -115,7 +117,8 @@
        name: '',
        status: '',
        rumStatus: ''
      }
      },
      form: null
    }
  },
  created () {
@@ -126,6 +129,7 @@
      'field.main': 'id'
    })
    this.search()
    this.GetCabinetConfig()
  },
  methods: {
    changeStatus(status, id) {
@@ -133,6 +137,12 @@
        .then(res => {
          this.search()
        })
    },
    GetCabinetConfig() {
      getCabinetConfig()
        .then(res => {
          this.form = res
        })
    }
  }
}