瀏覽代碼

添加在线设备

wukai 1 年之前
父節點
當前提交
76bd3384ec

+ 9 - 0
ruoyi-admin/src/main/java/com/ruoyi/biz/controller/ApiController.java

@@ -67,6 +67,15 @@ public class ApiController extends BaseController {
     @Value("${excel.template}")
     private String excelTemplate;
 
+    @ApiOperation("在线设备")
+    @GetMapping("/device/online")
+    @CrossOrigin(origins = "*")
+    public R<List<String>> online() {
+        List<String> devices = new ArrayList<>();
+        deviceService.selectTwinDeviceList(new TwinDevice()).forEach(d -> devices.add(d.getDeviceCode()));
+        return R.ok(devices);
+    }
+
     @ApiOperation("首页统计数据")
     @GetMapping("/index")
     @CrossOrigin(origins = "*")

+ 30 - 37
ruoyi-admin/src/main/java/com/ruoyi/biz/controller/TwinDeviceController.java

@@ -1,44 +1,40 @@
 package com.ruoyi.biz.controller;
 
-import java.util.List;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import com.ruoyi.common.annotation.Log;
-import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.biz.domain.TwinDevice;
 import com.ruoyi.biz.service.ITwinDeviceService;
+import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 设备管理Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-05-19
  */
 @Controller
-@RequestMapping("/biz/biz")
-public class TwinDeviceController extends BaseController
-{
-    private String prefix = "biz/biz";
+@RequestMapping("/biz/device")
+public class TwinDeviceController extends BaseController {
+    private String prefix = "biz/device";
 
-    @Autowired
+    @Resource
     private ITwinDeviceService twinDeviceService;
 
     @RequiresPermissions("biz:biz:view")
     @GetMapping()
-    public String biz()
-    {
-        return prefix + "/biz";
+    public String biz() {
+        return prefix + "/device";
     }
 
     /**
@@ -47,8 +43,7 @@ public class TwinDeviceController extends BaseController
     @RequiresPermissions("biz:biz:list")
     @PostMapping("/list")
     @ResponseBody
-    public TableDataInfo list(TwinDevice twinDevice)
-    {
+    public TableDataInfo list(TwinDevice twinDevice) {
         startPage();
         List<TwinDevice> list = twinDeviceService.selectTwinDeviceList(twinDevice);
         return getDataTable(list);
@@ -61,8 +56,7 @@ public class TwinDeviceController extends BaseController
     @Log(title = "设备管理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     @ResponseBody
-    public AjaxResult export(TwinDevice twinDevice)
-    {
+    public AjaxResult export(TwinDevice twinDevice) {
         List<TwinDevice> list = twinDeviceService.selectTwinDeviceList(twinDevice);
         ExcelUtil<TwinDevice> util = new ExcelUtil<TwinDevice>(TwinDevice.class);
         return util.exportExcel(list, "设备管理数据");
@@ -72,8 +66,7 @@ public class TwinDeviceController extends BaseController
      * 新增设备管理
      */
     @GetMapping("/add")
-    public String add()
-    {
+    public String add() {
         return prefix + "/add";
     }
 
@@ -84,8 +77,9 @@ public class TwinDeviceController extends BaseController
     @Log(title = "设备管理", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @ResponseBody
-    public AjaxResult addSave(TwinDevice twinDevice)
-    {
+    public AjaxResult addSave(TwinDevice twinDevice) {
+        twinDevice.setCreatedBy(getLoginName());
+        twinDevice.setCreatedTime(new Date());
         return toAjax(twinDeviceService.insertTwinDevice(twinDevice));
     }
 
@@ -94,8 +88,7 @@ public class TwinDeviceController extends BaseController
      */
     @RequiresPermissions("biz:biz:edit")
     @GetMapping("/edit/{id}")
-    public String edit(@PathVariable("id") Long id, ModelMap mmap)
-    {
+    public String edit(@PathVariable("id") Long id, ModelMap mmap) {
         TwinDevice twinDevice = twinDeviceService.selectTwinDeviceById(id);
         mmap.put("twinDevice", twinDevice);
         return prefix + "/edit";
@@ -108,8 +101,9 @@ public class TwinDeviceController extends BaseController
     @Log(title = "设备管理", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @ResponseBody
-    public AjaxResult editSave(TwinDevice twinDevice)
-    {
+    public AjaxResult editSave(TwinDevice twinDevice) {
+        twinDevice.setUpdatedBy(getLoginName());
+        twinDevice.setUpdatedTime(new Date());
         return toAjax(twinDeviceService.updateTwinDevice(twinDevice));
     }
 
@@ -118,10 +112,9 @@ public class TwinDeviceController extends BaseController
      */
     @RequiresPermissions("biz:biz:remove")
     @Log(title = "设备管理", businessType = BusinessType.DELETE)
-    @PostMapping( "/remove")
+    @PostMapping("/remove")
     @ResponseBody
-    public AjaxResult remove(String ids)
-    {
+    public AjaxResult remove(String ids) {
         return toAjax(twinDeviceService.deleteTwinDeviceByIds(ids));
     }
 }

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/biz/domain/IndexData.java

@@ -25,4 +25,6 @@ public class IndexData {
     private List<WeekData> weekData;
     @ApiModelProperty("盘头数据")
     private List<IndexPan> pan;
+    @ApiModelProperty("已接入设备列表")
+    private List<String> onlineDevice;
 }

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/biz/service/impl/AsyncServiceImpl.java

@@ -57,7 +57,10 @@ public class AsyncServiceImpl {
         calc2hr.setDeviceId(twinDevice.getId());
         calc2hr.setDataDate(date);
         calc2hr.setTimePeriod(period + "");
+
         Map<String, Object> map = calc(table, startTime, endTime);
+
+
         //0.已织造米数 1.A班组总开机时间 2.A班组总停机时间 3.A班总产量 4.B班组总开机时间 5.B班组总停机时间 6.B班总产量 7.A班总重量 8.B班总重量 9.总能耗 10.A班能耗 11.B班能耗
         float[] total = (float[]) map.get("total");
         calc2hr.setLengthA(BigDecimal.valueOf(total[3]));

+ 0 - 8
ruoyi-admin/src/main/java/com/ruoyi/biz/service/impl/IotServiceImpl.java

@@ -82,14 +82,6 @@ public class IotServiceImpl implements IIotService {
     }
 
     private String queryToken() {
-        System.err.println("========================");
-        System.err.println("========================");
-        System.err.println("========================");
-        System.err.println("========================");
-        System.err.println("==========切克闹?========");
-        System.err.println("========================");
-        System.err.println("========================");
-        System.err.println("========================");
         String uri = this.uri + "/api/blade-auth/oauth/token";
         Map<String, Object> map = new HashMap<>(16);
         map.put("tenantId", tenantId);

+ 0 - 49
ruoyi-admin/src/main/resources/templates/biz/biz/add.html

@@ -1,49 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
-<head>
-    <th:block th:include="include :: header('新增设备管理')" />
-</head>
-<body class="white-bg">
-    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
-        <form class="form-horizontal m" id="form-biz-add">
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">设备名称:</label>
-                <div class="col-sm-8">
-                    <input name="deviceName" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">设备编码:</label>
-                <div class="col-sm-8">
-                    <input name="deviceCode" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">设备路径:</label>
-                <div class="col-sm-8">
-                    <input name="devicePath" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">
-                <label class="col-sm-3 control-label">备注:</label>
-                <div class="col-sm-8">
-                    <textarea name="remark" class="form-control"></textarea>
-                </div>
-            </div>
-        </form>
-    </div>
-    <th:block th:include="include :: footer" />
-    <script th:inline="javascript">
-        var prefix = ctx + "biz/biz"
-        $("#form-biz-add").validate({
-            focusCleanup: true
-        });
-
-        function submitHandler() {
-            if ($.validate.form()) {
-                $.operate.save(prefix + "/add", $('#form-biz-add').serialize());
-            }
-        }
-    </script>
-</body>
-</html>

+ 0 - 122
ruoyi-admin/src/main/resources/templates/biz/biz/biz.html

@@ -1,122 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
-<head>
-    <th:block th:include="include :: header('设备管理列表')" />
-</head>
-<body class="gray-bg">
-     <div class="container-div">
-        <div class="row">
-            <div class="col-sm-12 search-collapse">
-                <form id="formId">
-                    <div class="select-list">
-                        <ul>
-                            <li>
-                                <label>设备名称:</label>
-                                <input type="text" name="deviceName"/>
-                            </li>
-                            <li>
-                                <label>设备编码:</label>
-                                <input type="text" name="deviceCode"/>
-                            </li>
-                            <li>
-                                <label>设备路径:</label>
-                                <input type="text" name="devicePath"/>
-                            </li>
-                            <li>
-                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
-                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
-                            </li>
-                        </ul>
-                    </div>
-                </form>
-            </div>
-
-            <div class="btn-group-sm" id="toolbar" role="group">
-                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="biz:biz:add">
-                    <i class="fa fa-plus"></i> 添加
-                </a>
-                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="biz:biz:edit">
-                    <i class="fa fa-edit"></i> 修改
-                </a>
-                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="biz:biz:remove">
-                    <i class="fa fa-remove"></i> 删除
-                </a>
-                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="biz:biz:export">
-                    <i class="fa fa-download"></i> 导出
-                </a>
-            </div>
-            <div class="col-sm-12 select-table table-striped">
-                <table id="bootstrap-table"></table>
-            </div>
-        </div>
-    </div>
-    <th:block th:include="include :: footer" />
-    <script th:inline="javascript">
-        var editFlag = [[${@permission.hasPermi('biz:biz:edit')}]];
-        var removeFlag = [[${@permission.hasPermi('biz:biz:remove')}]];
-        var prefix = ctx + "biz/biz";
-
-        $(function() {
-            var options = {
-                url: prefix + "/list",
-                createUrl: prefix + "/add",
-                updateUrl: prefix + "/edit/{id}",
-                removeUrl: prefix + "/remove",
-                exportUrl: prefix + "/export",
-                modalName: "设备管理",
-                columns: [{
-                    checkbox: true
-                },
-                {
-                    field: 'id',
-                    title: 'ID',
-                    visible: false
-                },
-                {
-                    field: 'deviceName',
-                    title: '设备名称'
-                },
-                {
-                    field: 'deviceCode',
-                    title: '设备编码'
-                },
-                {
-                    field: 'devicePath',
-                    title: '设备路径'
-                },
-                {
-                    field: 'createdBy',
-                    title: '创建人'
-                },
-                {
-                    field: 'createdTime',
-                    title: '创建时间'
-                },
-                {
-                    field: 'updatedBy',
-                    title: '更新人'
-                },
-                {
-                    field: 'updatedTime',
-                    title: '更新时间'
-                },
-                {
-                    field: 'remark',
-                    title: '备注'
-                },
-                {
-                    title: '操作',
-                    align: 'center',
-                    formatter: function(value, row, index) {
-                        var actions = [];
-                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
-                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
-                        return actions.join('');
-                    }
-                }]
-            };
-            $.table.init(options);
-        });
-    </script>
-</body>
-</html>

+ 0 - 50
ruoyi-admin/src/main/resources/templates/biz/biz/edit.html

@@ -1,50 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
-<head>
-    <th:block th:include="include :: header('修改设备管理')" />
-</head>
-<body class="white-bg">
-    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
-        <form class="form-horizontal m" id="form-biz-edit" th:object="${twinDevice}">
-            <input name="id" th:field="*{id}" type="hidden">
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">设备名称:</label>
-                <div class="col-sm-8">
-                    <input name="deviceName" th:field="*{deviceName}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">设备编码:</label>
-                <div class="col-sm-8">
-                    <input name="deviceCode" th:field="*{deviceCode}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">    
-                <label class="col-sm-3 control-label">设备路径:</label>
-                <div class="col-sm-8">
-                    <input name="devicePath" th:field="*{devicePath}" class="form-control" type="text">
-                </div>
-            </div>
-            <div class="form-group">
-                <label class="col-sm-3 control-label">备注:</label>
-                <div class="col-sm-8">
-                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
-                </div>
-            </div>
-        </form>
-    </div>
-    <th:block th:include="include :: footer" />
-    <script th:inline="javascript">
-        var prefix = ctx + "biz/biz";
-        $("#form-biz-edit").validate({
-            focusCleanup: true
-        });
-
-        function submitHandler() {
-            if ($.validate.form()) {
-                $.operate.save(prefix + "/edit", $('#form-biz-edit').serialize());
-            }
-        }
-    </script>
-</body>
-</html>

+ 35 - 35
ruoyi-admin/src/main/resources/templates/biz/device/add.html

@@ -4,46 +4,46 @@
     <th:block th:include="include :: header('新增设备管理')" />
 </head>
 <body class="white-bg">
-<div class="wrapper wrapper-content animated fadeInRight ibox-content">
-    <form class="form-horizontal m" id="form-biz-add">
-        <div class="form-group">
-            <label class="col-sm-3 control-label">设备名称:</label>
-            <div class="col-sm-8">
-                <input name="deviceName" class="form-control" type="text">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-biz-add">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">设备名称:</label>
+                <div class="col-sm-8">
+                    <input name="deviceName" class="form-control" type="text">
+                </div>
             </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-3 control-label">设备编码:</label>
-            <div class="col-sm-8">
-                <input name="deviceCode" class="form-control" type="text">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">设备编码:</label>
+                <div class="col-sm-8">
+                    <input name="deviceCode" class="form-control" type="text">
+                </div>
             </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-3 control-label">设备路径:</label>
-            <div class="col-sm-8">
-                <input name="devicePath" class="form-control" type="text">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">设备路径:</label>
+                <div class="col-sm-8">
+                    <input name="devicePath" class="form-control" type="text">
+                </div>
             </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-3 control-label">备注:</label>
-            <div class="col-sm-8">
-                <textarea name="remark" class="form-control"></textarea>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">备注:</label>
+                <div class="col-sm-8">
+                    <textarea name="remark" class="form-control"></textarea>
+                </div>
             </div>
-        </div>
-    </form>
-</div>
-<th:block th:include="include :: footer" />
-<script th:inline="javascript">
-    var prefix = ctx + "biz/biz"
-    $("#form-biz-add").validate({
-        focusCleanup: true
-    });
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var prefix = ctx + "biz/device"
+        $("#form-biz-add").validate({
+            focusCleanup: true
+        });
 
-    function submitHandler() {
-        if ($.validate.form()) {
-            $.operate.save(prefix + "/add", $('#form-biz-add').serialize());
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/add", $('#form-biz-add').serialize());
+            }
         }
-    }
-</script>
+    </script>
 </body>
 </html>

+ 63 - 63
ruoyi-admin/src/main/resources/templates/biz/device/device.html

@@ -4,69 +4,69 @@
     <th:block th:include="include :: header('设备管理列表')" />
 </head>
 <body class="gray-bg">
-<div class="container-div">
-    <div class="row">
-        <div class="col-sm-12 search-collapse">
-            <form id="formId">
-                <div class="select-list">
-                    <ul>
-                        <li>
-                            <label>设备名称:</label>
-                            <input type="text" name="deviceName"/>
-                        </li>
-                        <li>
-                            <label>设备编码:</label>
-                            <input type="text" name="deviceCode"/>
-                        </li>
-                        <li>
-                            <label>设备路径:</label>
-                            <input type="text" name="devicePath"/>
-                        </li>
-                        <li>
-                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
-                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
-                        </li>
-                    </ul>
-                </div>
-            </form>
-        </div>
+     <div class="container-div">
+        <div class="row">
+            <div class="col-sm-12 search-collapse">
+                <form id="formId">
+                    <div class="select-list">
+                        <ul>
+                            <li>
+                                <label>设备名称:</label>
+                                <input type="text" name="deviceName"/>
+                            </li>
+                            <li>
+                                <label>设备编码:</label>
+                                <input type="text" name="deviceCode"/>
+                            </li>
+                            <li>
+                                <label>设备路径:</label>
+                                <input type="text" name="devicePath"/>
+                            </li>
+                            <li>
+                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                            </li>
+                        </ul>
+                    </div>
+                </form>
+            </div>
 
-        <div class="btn-group-sm" id="toolbar" role="group">
-            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="biz:biz:add">
-                <i class="fa fa-plus"></i> 添加
-            </a>
-            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="biz:biz:edit">
-                <i class="fa fa-edit"></i> 修改
-            </a>
-            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="biz:biz:remove">
-                <i class="fa fa-remove"></i> 删除
-            </a>
-            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="biz:biz:export">
-                <i class="fa fa-download"></i> 导出
-            </a>
-        </div>
-        <div class="col-sm-12 select-table table-striped">
-            <table id="bootstrap-table"></table>
+            <div class="btn-group-sm" id="toolbar" role="group">
+                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="biz:biz:add">
+                    <i class="fa fa-plus"></i> 添加
+                </a>
+                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="biz:biz:edit">
+                    <i class="fa fa-edit"></i> 修改
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="biz:biz:remove">
+                    <i class="fa fa-remove"></i> 删除
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="biz:biz:export">
+                    <i class="fa fa-download"></i> 导出
+                </a>
+            </div>
+            <div class="col-sm-12 select-table table-striped">
+                <table id="bootstrap-table"></table>
+            </div>
         </div>
     </div>
-</div>
-<th:block th:include="include :: footer" />
-<script th:inline="javascript">
-    var editFlag = [[${@permission.hasPermi('biz:biz:edit')}]];
-    var removeFlag = [[${@permission.hasPermi('biz:biz:remove')}]];
-    var prefix = ctx + "biz/biz";
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var editFlag = [[${@permission.hasPermi('biz:biz:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('biz:biz:remove')}]];
+        var prefix = ctx + "biz/device";
 
-    $(function() {
-        var options = {
-            url: prefix + "/list",
-            createUrl: prefix + "/add",
-            updateUrl: prefix + "/edit/{id}",
-            removeUrl: prefix + "/remove",
-            exportUrl: prefix + "/export",
-            modalName: "设备管理",
-            columns: [{
-                checkbox: true
-            },
+        $(function() {
+            var options = {
+                url: prefix + "/list",
+                createUrl: prefix + "/add",
+                updateUrl: prefix + "/edit/{id}",
+                removeUrl: prefix + "/remove",
+                exportUrl: prefix + "/export",
+                modalName: "设备管理",
+                columns: [{
+                    checkbox: true
+                },
                 {
                     field: 'id',
                     title: 'ID',
@@ -114,9 +114,9 @@
                         return actions.join('');
                     }
                 }]
-        };
-        $.table.init(options);
-    });
-</script>
+            };
+            $.table.init(options);
+        });
+    </script>
 </body>
 </html>

+ 36 - 36
ruoyi-admin/src/main/resources/templates/biz/device/edit.html

@@ -4,47 +4,47 @@
     <th:block th:include="include :: header('修改设备管理')" />
 </head>
 <body class="white-bg">
-<div class="wrapper wrapper-content animated fadeInRight ibox-content">
-    <form class="form-horizontal m" id="form-biz-edit" th:object="${twinDevice}">
-        <input name="id" th:field="*{id}" type="hidden">
-        <div class="form-group">
-            <label class="col-sm-3 control-label">设备名称:</label>
-            <div class="col-sm-8">
-                <input name="deviceName" th:field="*{deviceName}" class="form-control" type="text">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-biz-edit" th:object="${twinDevice}">
+            <input name="id" th:field="*{id}" type="hidden">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">设备名称:</label>
+                <div class="col-sm-8">
+                    <input name="deviceName" th:field="*{deviceName}" class="form-control" type="text">
+                </div>
             </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-3 control-label">设备编码:</label>
-            <div class="col-sm-8">
-                <input name="deviceCode" th:field="*{deviceCode}" class="form-control" type="text">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">设备编码:</label>
+                <div class="col-sm-8">
+                    <input name="deviceCode" th:field="*{deviceCode}" class="form-control" type="text">
+                </div>
             </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-3 control-label">设备路径:</label>
-            <div class="col-sm-8">
-                <input name="devicePath" th:field="*{devicePath}" class="form-control" type="text">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">设备路径:</label>
+                <div class="col-sm-8">
+                    <input name="devicePath" th:field="*{devicePath}" class="form-control" type="text">
+                </div>
             </div>
-        </div>
-        <div class="form-group">
-            <label class="col-sm-3 control-label">备注:</label>
-            <div class="col-sm-8">
-                <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">备注:</label>
+                <div class="col-sm-8">
+                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
+                </div>
             </div>
-        </div>
-    </form>
-</div>
-<th:block th:include="include :: footer" />
-<script th:inline="javascript">
-    var prefix = ctx + "biz/biz";
-    $("#form-biz-edit").validate({
-        focusCleanup: true
-    });
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var prefix = ctx + "biz/device";
+        $("#form-biz-edit").validate({
+            focusCleanup: true
+        });
 
-    function submitHandler() {
-        if ($.validate.form()) {
-            $.operate.save(prefix + "/edit", $('#form-biz-edit').serialize());
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-biz-edit').serialize());
+            }
         }
-    }
-</script>
+    </script>
 </body>
 </html>