From 947ab096af42fc827b82f38a8c2be6e7e7cdaccb Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 08 一月 2025 16:05:09 +0800
Subject: [PATCH] 页面
---
admin/src/views/operation/device.vue | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 154 insertions(+), 0 deletions(-)
diff --git a/admin/src/views/operation/device.vue b/admin/src/views/operation/device.vue
index e69de29..9025984 100644
--- a/admin/src/views/operation/device.vue
+++ b/admin/src/views/operation/device.vue
@@ -0,0 +1,154 @@
+<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="categoryName" 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="supplier" label="璁惧渚涘簲鍟�" min-width="100" show-overflow-tooltip />
+ <el-table-column prop="status" label="璁惧鐘舵��" min-width="100" show-overflow-tooltip>
+ <template slot-scope="{row}">
+ <span v-if="row.status == 0">姝e父</span>
+ <span v-if="row.status == 1">鎹熷潖</span>
+ <span v-if="row.status == 2">鎶ュ簾</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" min-width="130" fixed="right">
+ <template slot-scope="{row}">
+ <el-button type="text" @click="handleDetail(row)" v-permissions="['business:category:update']">鏌ョ湅璇︽儏</el-button>
+ <el-button type="text" @click="handleEdit(row)" icon="el-icon-edit"
+ v-permissions="['business:category:update']">缂栬緫</el-button>
+ <el-button type="text" @click="handleDel(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" />
+ <Detail ref="DetailRef" />
+ </div>
+</template>
+
+<script>
+import Pagination from '@/components/common/Pagination'
+import QueryForm from '@/components/common/QueryForm'
+import Edit from './components/deviceEdit'
+import Detail from './components/deviceDetail'
+import { fetchList, deleteById } from '@/api/Inspection/device'
+export default {
+ components: {
+ Pagination,
+ QueryForm,
+ Edit,
+ Detail
+ },
+ 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
+ })
+ },
+ handleDetail(row) {
+ this.$refs.DetailRef.visible = true
+ this.$refs.DetailRef.id = row.id
+ this.$refs.DetailRef.getDetail()
+ },
+ handleEdit(row) {
+ this.showEdit = true
+ this.$nextTick(() => {
+ this.$refs.EditRef.isShowModal = true
+ if (row && row.id) {
+ console.log('---')
+
+ this.$refs.EditRef.getDetail(row.id)
+ }
+ })
+
+ },
+ handleDel(row) {
+ let message = `纭鍒犻櫎璇ヨ褰曞悧?`
+ this.$dialog.deleteConfirm(message)
+ .then(() => {
+ 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