pull/163/head
sunmeng 2024-08-23 15:10:19 +08:00
parent 376808563f
commit c87d0560ac
4 changed files with 42 additions and 4 deletions

View File

@ -12,6 +12,10 @@
<img src="../../assets/manageImg/manage-btn-icon1.png" alt=""> <img src="../../assets/manageImg/manage-btn-icon1.png" alt="">
控制器 控制器
</div> </div>
<div class="manage-btn" @click="active = 2" :class="active == 2 ? 'active' : ''">
<img src="../../assets/manageImg/manage-btn-icon1.png" alt="">
智能控制器
</div>
</div> </div>
<div class="table-view" v-if="active == 0"> <div class="table-view" v-if="active == 0">
<el-table :data="tableData" :row-class-name="tableRowClassName" height="620" style="width: 100%"> <el-table :data="tableData" :row-class-name="tableRowClassName" height="620" style="width: 100%">
@ -40,7 +44,8 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="table-view" v-else>
<div class="table-view" v-else-if="active==1">
<el-table :data="tableData1" :row-class-name="tableRowClassName" height="620" style="width: 100%"> <el-table :data="tableData1" :row-class-name="tableRowClassName" height="620" style="width: 100%">
<!-- <el-table-column label="序号"> <!-- <el-table-column label="序号">
<template slot-scope="scope"> <template slot-scope="scope">
@ -64,7 +69,30 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="table-view" v-else-if="active==2">
<el-table :data="tableData2" :row-class-name="tableRowClassName" height="620" style="width: 100%">
<!-- <el-table-column label="序号">
<template slot-scope="scope">
<div>{{scope.$index+1 }}
</div>
</template>
</el-table-column> -->
<el-table-column prop="deviceId" label="设备code码">
</el-table-column>
<el-table-column prop="deviceTypeName" label="设备名称">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<div class="table-flex">
<div class="table-operate blue" @click="openModel1(scope.row, scope.$index)">
<img src="../../assets/manageImg/table-edit.png" alt="">编辑
</div>
</div>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog title="提示" top="10vh" :visible.sync="addModel" width="700px" class="vrcode-model manage-model" <el-dialog title="提示" top="10vh" :visible.sync="addModel" width="700px" class="vrcode-model manage-model"
:append-to-body="true"> :append-to-body="true">
<div class="vrcode-model-title"> <div class="vrcode-model-title">
@ -283,6 +311,7 @@ export default {
active: 0, active: 0,
tableData: [], tableData: [],
tableData1: [], tableData1: [],
tableData2: [],
addModel: false, addModel: false,
addModel1: false, addModel1: false,
changeName: false, changeName: false,
@ -298,12 +327,15 @@ export default {
this.api.selUserbyid(user.userid).then(res => { this.api.selUserbyid(user.userid).then(res => {
this.tableData = [] this.tableData = []
this.tableData1 = [] this.tableData1 = []
this.tableData2 = []
if (res.data.code == 200) { if (res.data.code == 200) {
res.data.data.devices.forEach((el, index) => { res.data.data.devices.forEach((el, index) => {
if (el.deviceName == 10) { if (el.deviceName == 10) {
this.tableData1.push(el) this.tableData1.push(el)
} else if (el.deviceName == 1) { } else if (el.deviceName == 1) {
this.tableData.push(el) this.tableData.push(el)
} else if (el.deviceName == 20) {
this.tableData2.push(el)
} }
}) })
} }

View File

@ -154,7 +154,10 @@ export default {
}, },
deviceType:'', deviceType:'',
deviceSel: [{ label: '控制器', value: 10, }, { label: '施肥机', value: 1, }, { label: '气象站', value:30, }], deviceSel: [{ label: '控制器', value: 10, },
{ label: '施肥机', value: 1, },
{ label: '气象站', value:30, },
{ label: '智能灌溉控制器', value:20, }],
} }
}, },
mounted() { this.dataInit() }, mounted() { this.dataInit() },

View File

@ -225,7 +225,10 @@ export default {
typeSelList: [{ label: '管理员', value: 1, }, { label: '用户', value: 2, }], typeSelList: [{ label: '管理员', value: 1, }, { label: '用户', value: 2, }],
deviceType:'', deviceType:'',
deviceSel: [{ label: '控制器', value: 10, }, { label: '施肥机', value: 1, }, { label: '气象站', value:30, }], deviceSel: [{ label: '控制器', value: 10, },
{ label: '施肥机', value: 1, },
{ label: '气象站', value:30, },
{ label: '智能灌溉控制器', value:20, }],
} }
}, },
mounted() { this.dataInit() }, mounted() { this.dataInit() },

View File

@ -99,7 +99,7 @@ export default {
this.tableData = res.data.data.equipments this.tableData = res.data.data.equipments
this.typeSelList=[] this.typeSelList=[]
res.data.data.devices.forEach((el,index)=>{ res.data.data.devices.forEach((el,index)=>{
if(el.deviceName==10){ if(el.deviceName!=30){
this.typeSelList.push(el) this.typeSelList.push(el)
} }
}) })