wz_shi 3 years ago
parent
commit
48bb26fdad
  1. 9
      src/api/device/deviceList.js
  2. 9
      src/api/device/startUpList.js
  3. 6
      src/views/device/deviceConfig.vue
  4. 41
      src/views/device/index.vue

9
src/api/device/deviceList.js

@ -27,4 +27,13 @@ export function ReqQueryDevice(parameter) {
method: 'get',
params: parameter
})
}
// 根据id解绑
export function ReqRemoveDevice(parameter) {
return request({
url: 'api/device/delete',
method: 'post',
data: parameter
})
}

9
src/api/device/startUpList.js

@ -16,4 +16,13 @@ export function reqEditStartUp(parameter) {
method: 'post',
data: parameter
})
}
// 情况开关机配置列表的接口
export function reqClearStartUp(parameter) {
return request({
url: 'api/device/clearSetting',
method: 'post',
data: 'parameter'
})
}

6
src/views/device/deviceConfig.vue

@ -14,7 +14,7 @@
</div>
</el-col>
<el-col class="page_add" :span="4">
<el-button class="table_add clear_btn" plain :disabled="clearBtnDisabled">清空</el-button>
<el-button class="table_add clear_btn" plain :disabled="clearBtnDisabled" @click="clearStartUp">清空</el-button>
</el-col>
</el-row>
</div>
@ -391,7 +391,7 @@ export default {
} else {
this.clearBtnDisabled = true
}
// console.log(val)
console.log(val)
}
}
}
@ -466,7 +466,7 @@ export default {
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;

41
src/views/device/index.vue

@ -91,7 +91,7 @@
@click="editFormData(scope.row)"
>编辑</el-button>
<el-button type="danger" class="record_btn" @click="recordData(scope.$index, scope.row)">记录</el-button>
<el-button type="danger">解绑</el-button>
<el-button type="danger" @click="removeDevice(scope.row)">解绑</el-button>
</template>
</el-table-column>
</el-table>
@ -198,7 +198,7 @@
</template>
<script>
import { ReqDeviceEdit ,ReqDeviceList,ReqQueryDevice} from '@/api/device/deviceList.js'
import { ReqDeviceEdit ,ReqDeviceList,ReqQueryDevice,ReqRemoveDevice} from '@/api/device/deviceList.js'
import {parseTime} from '@/utils/index.js'
export default {
name: 'Device',
@ -267,9 +267,42 @@ export default {
this.form.name=row.device_name
this.form.orientation=row.device_direction==1?'竖屏':'横屏'
this.form.device_id=row.device_id
console.log(this.form.orientation)
// console.log(this.form.device_id)
},
//
removeDevice(row){
// console.log(row.device_id)
this.$confirm(`你确定解绑${row.device_name}?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(()=>{
const params={
id:row.device_id
}
ReqRemoveDevice(params).then(res=>{
if (res.code === 200) {
this.$message({
message: '解绑成功',
type: 'success'
})
this.getDevice()
}
})
})
// .catch(err => err) //catch
// if ('cancel' === confirmRes) {//
// return this.$message.info('')
// }
// if ('confirm' === confirmRes) { //
// ReqRemoveDevice(row.id).then(res=>{
// console.log(res)
// })
// }
},
recordData(index, row) {
this.recordVisible = true

Loading…
Cancel
Save