diff --git a/sgzb-ui/src/api/store/iotManagement.js b/sgzb-ui/src/api/store/iotManagement.js new file mode 100644 index 00000000..d5656d08 --- /dev/null +++ b/sgzb-ui/src/api/store/iotManagement.js @@ -0,0 +1,81 @@ +import request from '@/utils/request' + +// 新增或修改IOT +export function addOrUpdate(data) { + return request({ + url: '/material/iotMachine/addOrUpdate', + method: 'post', + data, + }) +} + +// IOT列表 +export function getIotList(params = {}) { + return request({ + url: '/material/iotMachine/getIotList', + method: 'get', + params, + }) +} + +// 删除IOT /iotMachine/deleteById/{iotId} +export function deleteIotById(params) { + return request({ + url: '/material/iotMachine/deleteById/' + params, + method: 'delete', + }) +} + +// IOT下拉列表 /iotMachine/selectList +export function selectList(params = {}) { + return request({ + url: '/material/iotMachine/selectList', + method: 'get', + params, + }) +} + +// 绑定IOT /iotMachine/bind +export function bindIot(data) { + return request({ + url: '/material/iotMachine/bind', + method: 'post', + data, + }) +} + +// 解绑IOT /iotMachine/unbind +export function unbindIot(data) { + return request({ + url: '/material/iotMachine/unbind', + method: 'post', + data, + }) +} + +// 获取绑定IOT列表 /iotMachine/getTypeList +export function getTypeList(params = {}) { + return request({ + url: '/material/iotMachine/getTypeList', + method: 'get', + params, + }) +} + +// 绑定详情 /iotMachine/getRecordList +export function getRecordList(params = {}) { + return request({ + url: '/material/iotMachine/getRecordList', + method: 'get', + params, + }) +} + +// 所有绑定详情 /iotMachine/getRecordListAll +export function getRecordListAll(params = {}) { + return request({ + url: '/material/iotMachine/getRecordListAll', + method: 'get', + params, + }) +} diff --git a/sgzb-ui/src/views/warehouseManage/machinery/IOTequipment/component/BindDetails.vue b/sgzb-ui/src/views/warehouseManage/machinery/IOTequipment/component/BindDetails.vue index b6b7779f..1280340e 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/IOTequipment/component/BindDetails.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/IOTequipment/component/BindDetails.vue @@ -22,13 +22,14 @@ width="55" :index="indexContinuation(queryParams.pageNum, queryParams.pageSize)" /> - - + + - + import PageHeader from '@/components/pageHeader' +import { getRecordList } from '@/api/store/iotManagement' + export default { name: 'BindDetails', props: { @@ -46,6 +49,10 @@ export default { type: Boolean, default: false, }, + iotId: { + type: Number, + default: '', + }, }, components: { PageHeader, @@ -61,14 +68,7 @@ export default { pageNum: 1, pageSize: 10, }, - tableData: [ - { - name: '设备1', - code: '001', - bindTime: '2021-08-01', - unbindTime: '2021-08-02', - }, - ], + tableData: [], pageContent: '绑定详情', } }, @@ -80,22 +80,20 @@ export default { console.log('🚀 ~ handleQuery ~ 查询:', this.queryForm.keyWord) this.getList() }, - getList() { - const params = { - keyWord: this.queryForm.keyWord || '', - pageNum: this.queryParams.pageNum, - pageSize: this.queryParams.pageSize, + async getList() { + try { + const params = { + keyWord: this.queryForm.keyWord, + iotId: this.iotId, + ...this.queryParams + } + console.log('🚀 ~ getList ~ 获取列表', params) + const res = await getRecordList(params) + this.tableData = res.rows + this.total = res.total + } catch (err) { + console.log('🚀 ~ getList ~ err', err) } - console.log('🚀 ~ getList ~ 获取列表', params) - - // 接口(params) - // .then(res => { - // this.tableData = res.data - // this.total = res.total - // }) - // .catch(err => { - // console.log('🚀 ~ getList ~ err:', err) - // }) }, goBack() { this.$tab.refreshPage() diff --git a/sgzb-ui/src/views/warehouseManage/machinery/IOTequipment/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/IOTequipment/index.vue index e7fcb097..86a4e859 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/IOTequipment/index.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/IOTequipment/index.vue @@ -24,31 +24,55 @@ width="55" :index="indexContinuation(queryParams.pageNum, queryParams.pageSize)" /> - - - - + + + + + + - - + + - - + + + + + +
- +