@@ -104,10 +145,8 @@
:show-overflow-tooltip="true"
height="100%"
>
-
-
-
+
-
-
-
-
- 记录
+ 记录
删除
+ >删除
修改
+ >修改
解绑
+ >解绑
绑定
+ >绑定
@@ -299,18 +247,15 @@
:rules="addOrEditFormRules"
>
-
+
-
+
-
+
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
+
-
-
-
+
+
查询
@@ -443,13 +340,9 @@
:highlight-current-row="true"
>
-
-
+
+
+
@@ -483,39 +376,19 @@
-
-
+
-
+
-
+
-
+
-
+
- 确 定
- 取 消
+ 确 定
+ 取 消
-
+
-
({
+ this.categoryList = res.data.map((item) => ({
...item,
- uniqueKey: `${item.typeId}-${item.type}`
+ uniqueKey: `${item.typeId}-${item.type}`,
}))
}
},
-/* async getEquipment(){
+ /* async getEquipment(){
const res = await getEquipment()
if (res.code === 200) {
this.tableData.own.list = res.rows
@@ -841,7 +707,6 @@ export default {
/** 添加/编辑设备 */
addDevice(row) {
-
this.getCategoryList()
// 1. 先清空旧表单(放在最前)
this.$refs.addOrEditFormRef?.resetFields()
@@ -854,7 +719,7 @@ export default {
this.addOrEditForm = {
...row,
iotStatus: String(row.iotStatus), // 统一转字符串,避免类型问题
- bindStatus: String(row.bindStatus)
+ bindStatus: String(row.bindStatus),
}
} else {
this.isAdd = true
@@ -869,7 +734,7 @@ export default {
address: '',
iotManager: '', // 原代码写的iotPerson,和表单的iotManager不一致,修正!
iotStatus: '1',
- remark: ''
+ remark: '',
}
}
@@ -878,9 +743,9 @@ export default {
},
/** 绑定设备 */
- handleBind(row){
- this.selectedRowId ='';
- this.getCategoryList();
+ handleBind(row) {
+ this.selectedRowId = ''
+ this.getCategoryList()
this.loadOwnEquipmentData()
this.$refs.bindFormRef?.resetFields()
this.bindForm = {
@@ -890,7 +755,7 @@ export default {
maId: '',
}
this.bindDialogTitle = '设备绑定' // 用新的标题变量
- this.bindDialogVisible = true;
+ this.bindDialogVisible = true
},
/** 复选框选择事件 */
@@ -954,7 +819,7 @@ export default {
address: '',
iotManager: '',
iotStatus: '1',
- remark: ''
+ remark: '',
}
},
@@ -962,8 +827,8 @@ export default {
handleBindDialogClose() {
this.$refs.bindFormRef?.resetFields()
this.bindForm = {
- iotId:'',
- typeName:'',
+ iotId: '',
+ typeName: '',
maCode: '',
maId: '',
}
@@ -972,7 +837,7 @@ export default {
/** 查看记录(强化:确保弹窗参数正确) */
handleViewRecord(id) {
this.dialogConfig.outerWidth = '70%'
- this.dialogConfig.outerTitle = "绑定记录"
+ this.dialogConfig.outerTitle = '绑定记录'
this.sendParams.iotId = id
this.dialogConfig.outerVisible = true // 强制设置为显示
console.log('记录弹窗参数:', this.dialogConfig, this.sendParams) // 调试用
@@ -991,28 +856,30 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
- }).then(async () => {
- try {
- if (type === 1) {
- const res = await deleteDeviceApi(row.iotId)
- if (res.code === 200) {
- this.$message.success(`${title}成功!`)
- this.getDeviceList()
- }
- } else {
- const detailRes = await unbindIot(row)
- if (Number(detailRes.code) === 200) {
- this.$message.success(`${title}成功!`)
- this.getDeviceList()
- }
- }
- } catch (err) {
- this.$message.error(`${title}失败`)
- console.error(`${title}失败:`, err)
- }
- }).catch(() => {
- this.$message.info('已取消操作')
})
+ .then(async () => {
+ try {
+ if (type === 1) {
+ const res = await deleteDeviceApi(row.iotId)
+ if (res.code === 200) {
+ this.$message.success(`${title}成功!`)
+ this.getDeviceList()
+ }
+ } else {
+ const detailRes = await unbindIot(row)
+ if (Number(detailRes.code) === 200) {
+ this.$message.success(`${title}成功!`)
+ this.getDeviceList()
+ }
+ }
+ } catch (err) {
+ this.$message.error(`${title}失败`)
+ console.error(`${title}失败:`, err)
+ }
+ })
+ .catch(() => {
+ this.$message.info('已取消操作')
+ })
},
/** 分页 - 每页条数改变 */
@@ -1057,7 +924,7 @@ export default {
async handleMap(row) {
this.deviceName = row.specificationType
- this.deviceType = row.maStatusName
+ this.deviceType = row.maStatusName
this.iotCode = row.iotCode
this.mapDialogVisible = true
},
@@ -1076,9 +943,7 @@ export default {
this.formData.classificationForm.category = ''
return
}
- const selectedItem = this.categoryList.find(
- item => item.typeId === selectedTypeId
- )
+ const selectedItem = this.categoryList.find((item) => item.typeId === selectedTypeId)
if (selectedItem) {
this.formData.classificationForm.matchingName = selectedItem.typeId
this.formData.classificationForm.category = selectedItem.type
@@ -1094,7 +959,7 @@ export default {
this.searchForm.own = {
name: '',
type: '',
- specificationModel: ''
+ specificationModel: '',
}
this.tableData.own.pageNum = 1
this.loadOwnEquipmentData()
@@ -1110,7 +975,7 @@ export default {
// 点击行选中单选框
handleRowClick(row) {
- this.selectedRowId = row.id; // 替换为你行数据的唯一标识(如row.key)
+ this.selectedRowId = row.id // 替换为你行数据的唯一标识(如row.key)
this.bindForm = {
iotId: this.bindForm.iotId,
@@ -1135,7 +1000,7 @@ export default {
const queryParams = {
...this.searchForm.own,
pageNum: tabConfig.pageNum,
- pageSize: tabConfig.pageSize
+ pageSize: tabConfig.pageSize,
}
const res = await getEquipment(queryParams)
tabConfig.list = res.rows || []
@@ -1148,9 +1013,8 @@ export default {
} finally {
tabConfig.loading = false
}
- }
-
- }
+ },
+ },
}
@@ -1258,7 +1122,6 @@ export default {
word-break: break-all;
}
-
/* 分页组件:固定右下 */
.pagination-wrapper {
margin-top: 12px;
@@ -1295,7 +1158,7 @@ export default {
/* 搜索区域收起/展开按钮 */
.search-toggle-btn {
- color: #2CBAB2;
+ color: #2cbab2;
padding: 5px 10px;
font-size: 16px;
font-weight: 300;
@@ -1314,12 +1177,12 @@ export default {
}
.el-button--text {
- color: #2CBAB2;
+ color: #2cbab2;
}
.el-button--primary {
- background-color: #2CBAB2;
- border-color: #2CBAB2;
+ background-color: #2cbab2;
+ border-color: #2cbab2;
}
/* 隐藏el-radio的文本部分 */
@@ -1332,11 +1195,11 @@ export default {
display: block;
}
-.el-radio__input.is-checked+.el-radio__label{
+.el-radio__input.is-checked + .el-radio__label {
display: none;
}
-::v-deep .el-radio__label{
+::v-deep .el-radio__label {
display: none;
}