From 2ded8ff672cdc504567ad407fa882a764ab4d749 Mon Sep 17 00:00:00 2001 From: hh <292475944@qq.com> Date: Tue, 10 Nov 2020 08:59:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=88=97=E8=A1=A8&=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/hardware/device.js | 45 ++++ src/api/hardware/product.js | 44 ++++ src/assets/styles/ruoyi.scss | 4 + src/views/device-manage/index.vue | 6 +- src/views/hardware/deviceList/index.vue | 302 +++++++++++++++++++++++ src/views/hardware/productList/index.vue | 291 ++++++++++++++++++++++ vue.config.js | 4 +- 7 files changed, 692 insertions(+), 4 deletions(-) create mode 100644 src/api/hardware/device.js create mode 100644 src/api/hardware/product.js create mode 100644 src/views/hardware/deviceList/index.vue create mode 100644 src/views/hardware/productList/index.vue diff --git a/src/api/hardware/device.js b/src/api/hardware/device.js new file mode 100644 index 0000000..ed3683d --- /dev/null +++ b/src/api/hardware/device.js @@ -0,0 +1,45 @@ +import request from '@/utils/request' + +// 查询设备列表 +export function list(params) { + return request({ + url: '/system/device/list', + method: 'get', + params + }) +} + + +// 查询设备详细 +export function Info(deviceId) { + return request({ + url: '/system/device/' + deviceId, + method: 'get' + }) + } + +// 新增设备 +export function add(data) { + return request({ + url: '/system/device', + method: 'post', + data + }) +} + +// 修改设备 +export function update(data) { + return request({ + url: '/system/device', + method: 'post', + data + }) +} + +// 删除设备 +export function del(ids) { + return request({ + url: '/system/device/' + ids, + method: 'delete' + }) +} diff --git a/src/api/hardware/product.js b/src/api/hardware/product.js new file mode 100644 index 0000000..2d3288f --- /dev/null +++ b/src/api/hardware/product.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询产品列表 +export function list(params) { + return request({ + url: '/system/product/list', + method: 'get', + params + }) +} + +// 查询产品详细 +export function Info(productId) { + return request({ + url: '/system/product/' + productId, + method: 'get' + }) + } + +// 新增产品 +export function add(data) { + return request({ + url: '/system/device', + method: 'post', + data + }) +} + +// 修改产品 +export function update(data) { + return request({ + url: '/system/product', + method: 'post', + data + }) +} + +// 删除产品 +export function del(ids) { + return request({ + url: '/system/product/' + ids, + method: 'delete' + }) +} \ No newline at end of file diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss index c4b9b7c..060987f 100644 --- a/src/assets/styles/ruoyi.scss +++ b/src/assets/styles/ruoyi.scss @@ -110,8 +110,12 @@ padding-left: 0; padding-right: 0; width: inherit; + &.text-danger { + color: #ed5565; + } } + .el-tree-node__content > .el-checkbox { margin-right: 8px; } diff --git a/src/views/device-manage/index.vue b/src/views/device-manage/index.vue index 27dbbae..3ff3e9b 100644 --- a/src/views/device-manage/index.vue +++ b/src/views/device-manage/index.vue @@ -268,7 +268,7 @@ import { addDevice, updateDevice, delDevice, -} from "@/api/system/device"; +} from "@/api/hardware/device"; export default { name: "Device", data() { @@ -370,8 +370,10 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - this.deviceId=[] + // debugger + // this.deviceId=[] const deviceId = row.deviceId || this.ids; + debugger getDevice(deviceId).then(response => { this.form = response.data; this.open = true; diff --git a/src/views/hardware/deviceList/index.vue b/src/views/hardware/deviceList/index.vue new file mode 100644 index 0000000..7eb49e8 --- /dev/null +++ b/src/views/hardware/deviceList/index.vue @@ -0,0 +1,302 @@ + + + + + + diff --git a/src/views/hardware/productList/index.vue b/src/views/hardware/productList/index.vue new file mode 100644 index 0000000..1260ac4 --- /dev/null +++ b/src/views/hardware/productList/index.vue @@ -0,0 +1,291 @@ + + + + + + diff --git a/vue.config.js b/vue.config.js index c9a9225..9661948 100644 --- a/vue.config.js +++ b/vue.config.js @@ -34,8 +34,8 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - // target: `http://192.168.0.125:8080`, - target: `http://121.37.250.170:8080`, + target: `http://192.168.0.129:8080`, + // target: `http://121.37.250.170:8080`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''