#
Junjie
2025-07-15 63fc53379b059d4076a228c8b5b149ead84f20eb
src/main/webapp/views/index.html
@@ -21,7 +21,7 @@
    <div style="width: 50%;">
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span>模拟设备</span>
                <span>模拟设备 - {{ systemInfo.gatewayId }}号网关</span>
                <el-button style="float: right; padding: 3px 0" type="text" @click="addDeviceVisible = true">添加设备</el-button>
            </div>
@@ -83,6 +83,10 @@
                threadImpl: '',
                deviceType: ''
            },
            systemInfo: {
                gatewayId: 0,
                gatewayPort: 0
            },
            formLabelWidth: '120px',
            deviceList: []
        },
@@ -91,10 +95,36 @@
        },
        methods: {
            init() {
                this.getSystemInfo();
                setInterval(() => {
                    this.getDeviceList()
                }, 100);
            },
            getSystemInfo() {
                let that = this;
                $.ajax({
                    url: baseUrl + "/open/getSystemInfo",
                    headers: {
                        'token': localStorage.getItem('token')
                    },
                    data: {},
                    dataType: 'json',
                    contentType: 'application/json;charset=UTF-8',
                    method: 'GET',
                    success: function(res) {
                        if (res.code == 200) {
                            let data = res.data;
                            that.systemInfo = data
                        } else {
                            that.$message({
                                message: res.msg,
                                type: 'error'
                            });
                        }
                    }
                });
            },
            addDevice() {
                //添加设备
                let that = this;