diff --git a/src/api/device/configuration.js b/src/api/device/configuration.js new file mode 100644 index 0000000..c9608d5 --- /dev/null +++ b/src/api/device/configuration.js @@ -0,0 +1,2 @@ +// 开关机配置的接口 +import request from '@/utils/request' \ No newline at end of file diff --git a/src/api/device/deviceList.js b/src/api/device/deviceList.js new file mode 100644 index 0000000..a539860 --- /dev/null +++ b/src/api/device/deviceList.js @@ -0,0 +1,29 @@ +// 设备列表的管理接口 +import request from '@/utils/request' + +export function ReqDeviceList(page, size) { + return request({ + url: `api/device/list?page=${page}&size=${size}`, + method: 'get', + }) +} +// &device_id=${device_id} + + +// 编辑设备发起请求 +export function ReqDeviceEdit(parameter) { + return request({ + url: '/api/device/save', + method: 'post', + data: parameter + }) +} + +// 根据id查询设备 +export function ReqQueryDevice(parameter) { + return request({ + url: 'api/device/findById', + method: 'get', + data: parameter + }) +} \ No newline at end of file diff --git a/src/store/modules/device.js b/src/store/modules/device.js new file mode 100644 index 0000000..bdd02f5 --- /dev/null +++ b/src/store/modules/device.js @@ -0,0 +1,23 @@ +import { ReqDeviceList, ReqDeviceEdit } from '@/api/device/deviceList' +const device = { + state: { + deviceList: [] + + }, + mutations: { + GETDEVICELIST: (state, deviceList) => { + state.deviceList = deviceList + } + }, + actions: { + //获取设备列表的信息 + async getDeviceList({ commit }, { page, size }) { + let result = await ReqDeviceList(page, size) + if (result.code == 200) { + commit('GETDEVICELIST', result.data.content) + } + }, + }, +} + +export default device \ No newline at end of file diff --git a/src/views/device/index.vue b/src/views/device/index.vue index 3d1cc3f..a5c83b3 100644 --- a/src/views/device/index.vue +++ b/src/views/device/index.vue @@ -15,31 +15,30 @@ /> +
设备ID:
设备名称:
- 清空 @@ -51,15 +50,20 @@ - - - - - - + + + + + + + + > + - + - - @@ -187,60 +189,68 @@