设备类型管理

This commit is contained in:
haozq 2025-04-18 14:22:18 +08:00
parent 10c5b1fb39
commit 599d4a4f5e
1 changed files with 159 additions and 0 deletions

View File

@ -0,0 +1,159 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="关键字" prop="keyWord">
<el-input v-model="queryParams.keyWord" placeholder="请输入关键字(ID/名称/编码)" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['basic:dev:add']">新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['system:post:export']">导出</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="videoDeviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="设备类型名称" align="center" prop="typeName" />
<el-table-column label="设备类型编码" align="center" prop="typeCode" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['basic:dev:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['basic:dev:del']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 新增/编辑 -->
<Devicepop v-if="isflag" :isAdd="isAdd" :rowData="row" @handleQuery="handleQuery" :title="title" @closeDialog="closeDialog"
@showColose="showColose" :dataForm="row" :disabled="loading" :width="600" />
</div>
</template>
<script>
import { getPageList ,deleteData} from "@/api/base-type/dev-type/devType.js";
import Devicepop from "./prop/prop.vue";
export default {
name: "videoDevice",
dicts: ['video_device'],
components: {
Devicepop
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
videoDeviceList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '',
devTypeCode: ''
},
//
form: {},
isflag: false,
row: {},
isAdd: ''
};
},
created() {
this.getList();
},
methods: {
/** 视频设备列表 */
getList() {
this.loading = true;
getPageList(this.queryParams).then(response => {
this.videoDeviceList = response.rows;
this.total = response.total;
this.loading = false;
});
},
closeDialog() {
this.isflag = false;
},
showColose() {
this.isflag = false;
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.title = "新增";
this.isAdd = 'add';
this.isflag = true;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.title = "修改";
this.isAdd = 'edit';
this.row = row;
this.isflag = true;
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id || this.ids;
this.$modal.confirm('是否确认删除id是"' + row.id + '"的数据项?').then(function () {
return deleteData({ id: id });
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('system/post/export', {
...this.queryParams
}, `post_${new Date().getTime()}.xlsx`)
}
}
};
</script>