From e4a0a37f0bcb3bf6c34f1766b93d3180a312301d Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Mon, 12 May 2025 18:01:10 +0800 Subject: [PATCH] =?UTF-8?q?[1078]=20=E5=90=88=E5=B9=B6=E6=96=B0UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/api/jtDevice.js | 16 ++ web/src/store/index.js | 4 +- web/src/store/modules/jtDevice.js | 22 ++ web/src/views/jtDevice/channel/index.vue | 323 ++++++++++++----------- web/src/views/jtDevice/edit.vue | 83 +++--- web/src/views/jtDevice/list.vue | 91 ++----- 6 files changed, 266 insertions(+), 273 deletions(-) diff --git a/web/src/api/jtDevice.js b/web/src/api/jtDevice.js index 3630305dc..e2b411a4d 100644 --- a/web/src/api/jtDevice.js +++ b/web/src/api/jtDevice.js @@ -24,6 +24,22 @@ export function queryDeviceById(deviceId) { }) } +export function update(form) { + return request({ + method: 'post', + url: `/api/jt1078/terminal/update`, + params: form + }) +} + +export function add(form) { + return request({ + method: 'post', + url: `/api/jt1078/terminal/add`, + params: form + }) +} + export function deleteDeviceById(deviceId) { return request({ method: 'delete', diff --git a/web/src/store/index.js b/web/src/store/index.js index 385592902..138c4abed 100644 --- a/web/src/store/index.js +++ b/web/src/store/index.js @@ -22,6 +22,7 @@ import userApiKeys from './modules/userApiKeys' import gbRecord from './modules/gbRecord' import log from './modules/log' import frontEnd from './modules/frontEnd' +import jtDevice from './modules/jtDevice' Vue.use(Vuex) @@ -47,7 +48,8 @@ const store = new Vuex.Store({ userApiKeys, gbRecord, log, - frontEnd + frontEnd, + jtDevice }, getters }) diff --git a/web/src/store/modules/jtDevice.js b/web/src/store/modules/jtDevice.js index c86295965..6ae2d4383 100644 --- a/web/src/store/modules/jtDevice.js +++ b/web/src/store/modules/jtDevice.js @@ -1,4 +1,6 @@ import { deleteDeviceById, queryChannels, queryDeviceById, queryDevices } from '@/api/jtDevice' +import { add } from '@/api/user' +import { update } from '@/api/group' const actions = { queryDevices({ commit }, params) { @@ -11,6 +13,26 @@ const actions = { }) }) }, + add({ commit }, params) { + return new Promise((resolve, reject) => { + add(params).then(response => { + const { data } = response + resolve(data) + }).catch(error => { + reject(error) + }) + }) + }, + update({ commit }, params) { + return new Promise((resolve, reject) => { + update(params).then(response => { + const { data } = response + resolve(data) + }).catch(error => { + reject(error) + }) + }) + }, queryDeviceById({ commit }, deviceId) { return new Promise((resolve, reject) => { queryDeviceById(deviceId).then(response => { diff --git a/web/src/views/jtDevice/channel/index.vue b/web/src/views/jtDevice/channel/index.vue index d7b53246c..ae84a3d7c 100755 --- a/web/src/views/jtDevice/channel/index.vue +++ b/web/src/views/jtDevice/channel/index.vue @@ -1,61 +1,81 @@ - -