|
|
@@ -1,7 +1,14 @@
|
|
|
<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="设备ID" prop="deviceId">
|
|
|
+ <el-form
|
|
|
+ :model="queryParams"
|
|
|
+ ref="queryForm"
|
|
|
+ size="small"
|
|
|
+ :inline="true"
|
|
|
+ v-show="showSearch"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <!-- <el-form-item label="设备ID" prop="deviceId">
|
|
|
<el-input
|
|
|
v-model="queryParams.deviceId"
|
|
|
placeholder="请输入设备ID"
|
|
|
@@ -32,7 +39,7 @@
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="蓝牙名称" prop="name">
|
|
|
<el-input
|
|
|
v-model="queryParams.name"
|
|
|
@@ -49,16 +56,20 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="文件地址" prop="filePath">
|
|
|
+ <!-- <el-form-item label="文件地址" prop="filePath">
|
|
|
<el-input
|
|
|
v-model="queryParams.filePath"
|
|
|
placeholder="请输入文件地址"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="是否非法" prop="isIllegal">
|
|
|
- <el-select v-model="queryParams.isIllegal" placeholder="请选择是否非法" clearable>
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.isIllegal"
|
|
|
+ placeholder="请选择是否非法"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="dict in dict.type.sys_yes_no"
|
|
|
:key="dict.value"
|
|
|
@@ -68,16 +79,29 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="数据采集时间" prop="time">
|
|
|
- <el-date-picker clearable
|
|
|
- v-model="queryParams.time"
|
|
|
- type="date"
|
|
|
+ <el-date-picker
|
|
|
+ clearable
|
|
|
+ v-model="daterangeRegisterTime"
|
|
|
+ style="width: 240px"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
- placeholder="请选择数据采集时间">
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</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-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>
|
|
|
|
|
|
@@ -90,7 +114,8 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['biz:bluetoothINfo:add']"
|
|
|
- >新增</el-button>
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
@@ -101,7 +126,8 @@
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
v-hasPermi="['biz:bluetoothINfo:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
@@ -112,7 +138,8 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['biz:bluetoothINfo:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
@@ -122,12 +149,20 @@
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['biz:bluetoothINfo:export']"
|
|
|
- >导出</el-button>
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <right-toolbar
|
|
|
+ :showSearch.sync="showSearch"
|
|
|
+ @queryTable="getList"
|
|
|
+ ></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="bluetoothINfoList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="bluetoothINfoList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="信息ID" align="center" prop="bInfoId" />
|
|
|
<el-table-column label="设备ID" align="center" prop="deviceId" />
|
|
|
@@ -139,16 +174,28 @@
|
|
|
<el-table-column label="文件地址" align="center" prop="filePath" />
|
|
|
<el-table-column label="是否非法" align="center" prop="isIllegal">
|
|
|
<template slot-scope="scope">
|
|
|
- <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isIllegal"/>
|
|
|
+ <dict-tag
|
|
|
+ :options="dict.type.sys_yes_no"
|
|
|
+ :value="scope.row.isIllegal"
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="关键字类型" align="center" prop="keyType" />
|
|
|
- <el-table-column label="数据采集时间" align="center" prop="time" width="180">
|
|
|
+ <el-table-column
|
|
|
+ label="数据采集时间"
|
|
|
+ align="center"
|
|
|
+ prop="time"
|
|
|
+ width="180"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.time, '{y}-{m}-{d}') }}</span>
|
|
|
+ <span>{{ parseTime(scope.row.time, "{y}-{m}-{d}") }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
@@ -156,20 +203,22 @@
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['biz:bluetoothINfo:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['biz:bluetoothINfo:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
+
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
+ v-show="total > 0"
|
|
|
:total="total"
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@@ -211,11 +260,13 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="数据采集时间" prop="time">
|
|
|
- <el-date-picker clearable
|
|
|
+ <el-date-picker
|
|
|
+ clearable
|
|
|
v-model="form.time"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
- placeholder="请选择数据采集时间">
|
|
|
+ placeholder="请选择数据采集时间"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
@@ -228,17 +279,24 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listBluetoothINfo, getBluetoothINfo, delBluetoothINfo, addBluetoothINfo, updateBluetoothINfo } from "@/api/biz/bluetoothINfo";
|
|
|
+import {
|
|
|
+ listBluetoothINfo,
|
|
|
+ getBluetoothINfo,
|
|
|
+ delBluetoothINfo,
|
|
|
+ addBluetoothINfo,
|
|
|
+ updateBluetoothINfo,
|
|
|
+} from "@/api/biz/bluetoothINfo";
|
|
|
|
|
|
export default {
|
|
|
name: "BluetoothINfo",
|
|
|
- dicts: ['sys_yes_no'],
|
|
|
+ dicts: ["sys_yes_no"],
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
+ daterangeRegisterTime: [],
|
|
|
// 非单个禁用
|
|
|
single: true,
|
|
|
// 非多个禁用
|
|
|
@@ -266,26 +324,36 @@ export default {
|
|
|
filePath: null,
|
|
|
isIllegal: null,
|
|
|
keyType: null,
|
|
|
- time: null
|
|
|
+ time: null,
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- mac: [
|
|
|
- { required: true, message: "MAC地址不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
- }
|
|
|
+ mac: [{ required: true, message: "MAC地址不能为空", trigger: "blur" }],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
+ console.log('first',this.dicts)
|
|
|
+ // this.queryParams.isIllegal=this.dict.type.sys_yes_no[0].value
|
|
|
},
|
|
|
methods: {
|
|
|
/** 查询蓝牙信息列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listBluetoothINfo(this.queryParams).then(response => {
|
|
|
+ this.queryParams.params = {};
|
|
|
+ if (
|
|
|
+ null != this.daterangeRegisterTime &&
|
|
|
+ "" != this.daterangeRegisterTime
|
|
|
+ ) {
|
|
|
+ this.queryParams.params["beginRegisterTime"] =
|
|
|
+ this.daterangeRegisterTime[0];
|
|
|
+ this.queryParams.params["endRegisterTime"] =
|
|
|
+ this.daterangeRegisterTime[1];
|
|
|
+ }
|
|
|
+ listBluetoothINfo(this.queryParams).then((response) => {
|
|
|
this.bluetoothINfoList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
@@ -309,7 +377,7 @@ export default {
|
|
|
filePath: null,
|
|
|
isIllegal: null,
|
|
|
keyType: null,
|
|
|
- time: null
|
|
|
+ time: null,
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
@@ -320,14 +388,15 @@ export default {
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
+ this.daterangeRegisterTime = [];
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.bInfoId)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
+ this.ids = selection.map((item) => item.bInfoId);
|
|
|
+ this.single = selection.length !== 1;
|
|
|
+ this.multiple = !selection.length;
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
@@ -338,8 +407,8 @@ export default {
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
- const bInfoId = row.bInfoId || this.ids
|
|
|
- getBluetoothINfo(bInfoId).then(response => {
|
|
|
+ const bInfoId = row.bInfoId || this.ids;
|
|
|
+ getBluetoothINfo(bInfoId).then((response) => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改蓝牙信息";
|
|
|
@@ -347,16 +416,16 @@ export default {
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.bInfoId != null) {
|
|
|
- updateBluetoothINfo(this.form).then(response => {
|
|
|
+ updateBluetoothINfo(this.form).then((response) => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- addBluetoothINfo(this.form).then(response => {
|
|
|
+ addBluetoothINfo(this.form).then((response) => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
@@ -368,19 +437,27 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const bInfoIds = row.bInfoId || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除蓝牙信息编号为"' + bInfoIds + '"的数据项?').then(function() {
|
|
|
- return delBluetoothINfo(bInfoIds);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ this.$modal
|
|
|
+ .confirm('是否确认删除蓝牙信息编号为"' + bInfoIds + '"的数据项?')
|
|
|
+ .then(function () {
|
|
|
+ return delBluetoothINfo(bInfoIds);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
- this.download('biz/bluetoothINfo/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `bluetoothINfo_${new Date().getTime()}.xlsx`)
|
|
|
- }
|
|
|
- }
|
|
|
+ this.download(
|
|
|
+ "biz/bluetoothINfo/export",
|
|
|
+ {
|
|
|
+ ...this.queryParams,
|
|
|
+ },
|
|
|
+ `bluetoothINfo_${new Date().getTime()}.xlsx`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|