From 642ae007fd098f5596d44d79148318ac7914e568 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 29 十一月 2024 09:35:23 +0800
Subject: [PATCH] 开发
---
admin/src/views/operation/device.vue | 146 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 146 insertions(+), 0 deletions(-)
diff --git a/admin/src/views/operation/device.vue b/admin/src/views/operation/device.vue
index e69de29..5c34d4f 100644
--- a/admin/src/views/operation/device.vue
+++ b/admin/src/views/operation/device.vue
@@ -0,0 +1,146 @@
+<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="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) {
+ console.log('---');
+
+ 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