<template>
|
<div class="app-container">
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form-item label="外设代码" prop="code">
|
<el-input
|
v-model="queryParams.code"
|
placeholder="请输入外设代码"
|
clearable
|
size="small"
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="外设名称" prop="name">
|
<el-input
|
v-model="queryParams.name"
|
placeholder="请输入外设名称"
|
clearable
|
size="small"
|
@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-table v-loading="loading" :data="peripheralUnitList" highlight-current-row
|
@current-change="handleCurrentChange">
|
<el-table-column label="序号" align="center" width="50">
|
<template slot-scope="scope">
|
<span>{{ scope.$index + (queryParams.pageNum - 1) * queryParams.pageSize + 1 }} </span>
|
</template>
|
</el-table-column>
|
<el-table-column label="外设代码" width="80" align="center" prop="code"/>
|
<el-table-column label="外设名称" align="center" prop="name" show-overflow-tooltip/>
|
<el-table-column label="规格型号" align="center" prop="model" min-width="60"/>
|
<el-table-column label="生产厂商" align="center" prop="manufacturer_dictText"/>
|
<el-table-column label="厂商代码" width="100" align="center" prop="vendorCode_dictText"/>
|
<el-table-column label="波特率" width="100" align="center" prop="baudRate">
|
<template slot-scope="scope">
|
<dict-tag :options="dict.type.DICT103" :value="scope.row.baudRate"/>
|
</template>
|
</el-table-column>
|
<el-table-column label="问询指令" align="center" width="220" prop="readInstruction"/>
|
<el-table-column label="指令长度" width="80" align="center" prop="orderLength"/>
|
<el-table-column label="返回长度" width="80" align="center" prop="loopLength"/>
|
</el-table>
|
|
<pagination
|
v-show="total>0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</div>
|
</template>
|
|
<script>
|
import { listPeripheralUnit} from "@/api/oa/peripheralUnit";
|
|
export default {
|
name: "PeripheralUnit",
|
dicts: ['DICT103'],
|
data() {
|
return {
|
// 按钮loading
|
buttonLoading: false,
|
// 遮罩层
|
loading: true,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 外设单元表格数据
|
peripheralUnitList: [],
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
code: undefined,
|
name: undefined
|
},
|
currentRow: undefined
|
};
|
},
|
created() {
|
this.getList();
|
|
},
|
methods: {
|
/** 查询外设单元列表 */
|
getList() {
|
this.loading = true;
|
listPeripheralUnit(this.queryParams).then(response => {
|
this.peripheralUnitList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
handleCurrentChange(v) {
|
this.currentRow = v;
|
}
|
}
|
};
|
</script>
|