From 8ac30411bb33e406e0ed5a2b6e2edaf7ab59f11f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期六, 23 十一月 2024 17:10:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 admin/src/views/operation/device.vue |  138 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 138 insertions(+), 0 deletions(-)

diff --git a/admin/src/views/operation/device.vue b/admin/src/views/operation/device.vue
index e69de29..202eccd 100644
--- a/admin/src/views/operation/device.vue
+++ b/admin/src/views/operation/device.vue
@@ -0,0 +1,138 @@
+<template>
+  <div class="main_app">
+    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
+    <div class="mt20">
+      <el-button type="primary" @click="handleEdit()" icon="el-icon-plus"
+        v-permissions="['business:ywpatrolline:create']">鏂板缓</el-button>
+    </div>
+    <el-table v-loading="loading" :data="list" stripe>
+      <el-table-column prop="code" label="璁惧缂栧彿" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="name" label="璁惧鍚嶇О" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="" label="璁惧鍒嗙被" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="modelNo" label="璁惧鍨嬪彿" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="realName" label="绠$悊鍛�" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="company" label="璁惧渚涘簲鍟�" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="status" label="璁惧鐘舵��" min-width="100" show-overflow-tooltip />
+      <el-table-column label="鎿嶄綔" min-width="120" fixed="right">
+        <template slot-scope="{row}">
+          <el-button type="text" @click="handleEdit(row)" icon="el-icon-edit"
+            v-permissions="['business:category:update']">缂栬緫</el-button>
+          <el-button type="text" @click="deleteById(row)" icon="el-icon-delete"
+            v-permissions="['business:category:delete']">鍒犻櫎</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="mt20">
+      <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
+    </div>
+    <Edit v-if="showEdit" ref="EditRef" @success="getList" @close="showEdit = false" />
+  </div>
+</template>
+
+<script>
+import Pagination from '@/components/common/Pagination'
+import QueryForm from '@/components/common/QueryForm'
+import Edit from './components/deviceEdit'
+import { fetchList, deleteById } from '@/api/Inspection/device'
+export default {
+  components: {
+    Pagination,
+    QueryForm,
+    Edit
+  },
+  data() {
+    return {
+      loading: false,
+      showEdit: false,
+      pagination: {
+        pageSize: 10,
+        page: 1,
+        total: 0
+      },
+      filters: {},
+      list: [],
+      total: 0,
+      queryFormConfig: {
+        formItems: [
+          {
+            filed: 'name',
+            type: 'input',
+            label: '璁惧鍚嶇О',
+            placeholder: '璇疯緭鍏ヨ澶囧悕绉�/缂栫爜'
+          },
+          {
+            filed: 'status',
+            type: 'select',
+            label: '璁惧鐘舵��',
+            options: [
+              { value: 0, label: '姝e父' },
+              { value: 1, label: '鎹熷潖' },
+              { value: 2, label: '鎶ュ簾' },
+            ]
+          },
+        ],
+        online: true
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    getList(page) {
+      const { pagination, filters } = this
+      this.loading = true
+      fetchList({
+        model: {
+          ...filters,
+        },
+        capacity: pagination.pageSize,
+        page: page || pagination.page,
+      }).then(res => {
+        this.loading = false
+        this.list = res.records || []
+        this.list.forEach(item => {
+          item.stautsName = item.status == 0 ? '姝e父' : item.status == 1 ? '鎹熷潖' : '鎶ュ簾'
+        })
+        this.pagination.total = res.total || 0
+      }, () => {
+        this.loading = false
+      })
+    },
+    handleEdit(row) {
+      this.showEdit = true
+      this.$nextTick(() => {
+        this.$refs.EditRef.isShowModal = true
+        if (row && row.id) {
+          this.$refs.EditRef.getDetail(row.id)
+        }
+      })
+
+    },
+    handleDel(row) {
+      let message = `纭鍒犻櫎璇ヨ褰曞悧?`
+      this.$dialog.deleteConfirm(message)
+        .then(() => {
+          this.isWorking.delete = true
+          deleteById(row.id)
+            .then(() => {
+              this.$tip.apiSuccess('鍒犻櫎鎴愬姛')
+              this.getList()
+            })
+        })
+        .catch(() => { })
+    },
+    clear() {
+      this.filters = {}
+      this.pagination.pageSize = 10
+      this.pagination.page = 1
+      this.getList()
+    },
+    handleSizeChange(capacity) {
+      this.pagination.pageSize = capacity
+    }
+  }
+}
+</script>
+
+<style></style>

--
Gitblit v1.9.3