代码调试
This commit is contained in:
parent
315b097635
commit
d2e5a2269c
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
|
|
@ -1,18 +1,37 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container" v-if="props.isShow">
|
<div class="app-container" v-if="props.isShow">
|
||||||
<PageHeader :pageContent="pageContent" @goBack="goBack" />
|
<PageHeader :pageContent="pageContent" @goBack="goBack" />
|
||||||
<el-form :model="queryForm" ref="queryForm" size="small" :inline="true" label-width="68px" v-show="showSearch">
|
<el-form
|
||||||
|
:model="queryForm"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
v-show="showSearch"
|
||||||
|
>
|
||||||
<el-form-item label="关键字" prop="keyWord">
|
<el-form-item label="关键字" prop="keyWord">
|
||||||
<el-input v-model="queryForm.keyWord" clearable placeholder="请输入关键字" @keyup.enter.native="handleQuery" />
|
<el-input
|
||||||
|
v-model="queryForm.keyWord"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" size="small" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" size="small" @click="handleQuery"
|
||||||
<el-button type="primary" size="small" @click="bindNewIOT">绑定新设备</el-button>
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" size="small" @click="bindNewIOT"
|
||||||
|
>绑定新设备</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table :data="tableData" style="width: 100%">
|
<el-table :data="tableData" style="width: 100%">
|
||||||
|
|
@ -21,14 +40,22 @@
|
||||||
label="序号"
|
label="序号"
|
||||||
align="center"
|
align="center"
|
||||||
width="55"
|
width="55"
|
||||||
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
|
:index="
|
||||||
|
indexContinuation(queryParams.pageNum, queryParams.pageSize)
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="设备类型"
|
||||||
|
prop="iotTypeName"
|
||||||
|
align="center"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="设备类型" prop="iotTypeName" align="center" />
|
|
||||||
<el-table-column label="设备编号" prop="iotCode" align="center" />
|
<el-table-column label="设备编号" prop="iotCode" align="center" />
|
||||||
<el-table-column label="设备状态" prop="iotStatus" align="center">
|
<el-table-column label="设备状态" prop="iotStatus" align="center">
|
||||||
<!-- iotStatus 0 在线 1 掉线 -->
|
<!-- iotStatus 0 在线 1 掉线 -->
|
||||||
<template v-slot="{ row }">
|
<template v-slot="{ row }">
|
||||||
<el-tag v-if="row.iotStatus == 0" type="success">在线</el-tag>
|
<el-tag v-if="row.iotStatus == 0" type="success"
|
||||||
|
>在线</el-tag
|
||||||
|
>
|
||||||
<el-tag v-else type="danger">掉线</el-tag>
|
<el-tag v-else type="danger">掉线</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -36,7 +63,14 @@
|
||||||
|
|
||||||
<el-table-column label="操作" align="center">
|
<el-table-column label="操作" align="center">
|
||||||
<template v-slot="{ row }">
|
<template v-slot="{ row }">
|
||||||
<el-button type="text" size="small" @click="handleUnbind(row)" style="color: red" icon="el-icon-connection">解绑</el-button>
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="handleUnbind(row)"
|
||||||
|
style="color: red"
|
||||||
|
icon="el-icon-connection"
|
||||||
|
>解绑</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -50,8 +84,20 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 绑定设备 -->
|
<!-- 绑定设备 -->
|
||||||
<el-dialog title="绑定设备" :visible.sync="IOTOpen" width="500px" append-to-body :rules="rules">
|
<el-dialog
|
||||||
<el-form :model="IOTForm" ref="IOTForm" label-width="120px" size="small" :rules="rules">
|
title="绑定设备"
|
||||||
|
:visible.sync="IOTOpen"
|
||||||
|
width="500px"
|
||||||
|
append-to-body
|
||||||
|
:rules="rules"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
:model="IOTForm"
|
||||||
|
ref="IOTForm"
|
||||||
|
label-width="120px"
|
||||||
|
size="small"
|
||||||
|
:rules="rules"
|
||||||
|
>
|
||||||
<el-form-item label="设备类型" prop="iotType">
|
<el-form-item label="设备类型" prop="iotType">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="IOTForm.iotType"
|
v-model="IOTForm.iotType"
|
||||||
|
|
@ -70,14 +116,27 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备编号" prop="iotId">
|
<el-form-item label="设备编号" prop="iotId">
|
||||||
<el-select v-model="IOTForm.iotId" filterable clearable placeholder="请选择" style="width: 280px">
|
<el-select
|
||||||
<el-option v-for="item in codeOptions" :key="item.iotId" :label="item.iotCode" :value="item.iotId" />
|
v-model="IOTForm.iotId"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 280px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in codeOptions"
|
||||||
|
:key="item.iotId"
|
||||||
|
:label="item.iotCode"
|
||||||
|
:value="item.iotId"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="IOTOpen = false">取 消</el-button>
|
<el-button @click="IOTOpen = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="submit" :loading="loading">确 定</el-button>
|
<el-button type="primary" @click="submit" :loading="loading"
|
||||||
|
>确 定</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -85,7 +144,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import PageHeader from '@/components/pageHeader'
|
import PageHeader from '@/components/pageHeader'
|
||||||
import { selectList, bindIot, getTypeList, unbindIot } from '@/api/store/iotManagement'
|
import { selectList, bindIot, getTypeList, unbindIot } from '@/api/iotDevice'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BindIOT',
|
name: 'BindIOT',
|
||||||
|
|
@ -120,8 +179,20 @@ export default {
|
||||||
typeOptions: [], // 设备类型下拉
|
typeOptions: [], // 设备类型下拉
|
||||||
codeOptions: [], // 设备编号下拉
|
codeOptions: [], // 设备编号下拉
|
||||||
rules: {
|
rules: {
|
||||||
iotType: [{ required: true, message: '请选择设备类型', trigger: 'change' }],
|
iotType: [
|
||||||
iotId: [{ required: true, message: '请选择设备编号', trigger: 'change' }],
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择设备类型',
|
||||||
|
trigger: 'change',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
iotId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择设备编号',
|
||||||
|
trigger: 'change',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -196,7 +267,7 @@ export default {
|
||||||
submit() {
|
submit() {
|
||||||
try {
|
try {
|
||||||
// 校验
|
// 校验
|
||||||
this.$refs.IOTForm.validate(async valid => {
|
this.$refs.IOTForm.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const params = {
|
const params = {
|
||||||
|
|
@ -205,7 +276,11 @@ export default {
|
||||||
maCode: this.props.maCode,
|
maCode: this.props.maCode,
|
||||||
typeId: this.props.typeId,
|
typeId: this.props.typeId,
|
||||||
}
|
}
|
||||||
console.log('🚀 ~ submit ~ 提交绑定设备', params, this.props)
|
console.log(
|
||||||
|
'🚀 ~ submit ~ 提交绑定设备',
|
||||||
|
params,
|
||||||
|
this.props,
|
||||||
|
)
|
||||||
await bindIot(params)
|
await bindIot(params)
|
||||||
this.$message.success('绑定成功')
|
this.$message.success('绑定成功')
|
||||||
this.IOTOpen = false
|
this.IOTOpen = false
|
||||||
|
|
|
||||||
|
|
@ -206,11 +206,13 @@
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column align="center" label="IOT设备"> </el-table-column>
|
||||||
|
<el-table-column align="center" label="位置信息"></el-table-column>
|
||||||
|
<!-- <el-table-column
|
||||||
label="所在仓库"
|
label="所在仓库"
|
||||||
align="center"
|
align="center"
|
||||||
prop="ownHouseName"
|
prop="ownHouseName"
|
||||||
/>
|
/> -->
|
||||||
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
|
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
|
||||||
<!-- <template slot-scope="scope">-->
|
<!-- <template slot-scope="scope">-->
|
||||||
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
|
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue