|
@@ -2,36 +2,33 @@
|
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
<p style="font-size: 16px;font-weight: bold">采集模块配置:</p>
|
|
<p style="font-size: 16px;font-weight: bold">采集模块配置:</p>
|
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
- <el-form-item label="采集模块IP" prop="configName">
|
|
|
|
|
|
|
+ <el-form-item label="采集模块IP" prop="ip">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="queryParams.configName"
|
|
|
|
|
|
|
+ v-model="queryParams.ip"
|
|
|
placeholder="请输入采集模块IP"
|
|
placeholder="请输入采集模块IP"
|
|
|
clearable
|
|
clearable
|
|
|
style="width: 240px"
|
|
style="width: 240px"
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="端口号" prop="configKey">
|
|
|
|
|
|
|
+ <el-form-item label="端口号" prop="port">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="queryParams.configKey"
|
|
|
|
|
|
|
+ v-model="queryParams.port"
|
|
|
placeholder="请输入端口号"
|
|
placeholder="请输入端口号"
|
|
|
clearable
|
|
clearable
|
|
|
style="width: 240px"
|
|
style="width: 240px"
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="采样频率" prop="configKey">
|
|
<el-form-item label="采样频率" prop="configKey">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="queryParams.configKey"
|
|
|
|
|
|
|
+ v-model="queryParams.frequency"
|
|
|
placeholder="请输入采样频率"
|
|
placeholder="请输入采样频率"
|
|
|
clearable
|
|
clearable
|
|
|
style="width: 240px"
|
|
style="width: 240px"
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-button type="primary" icon="Search" @click="handleQuery">连接</el-button>
|
|
|
|
|
- <el-button icon="Refresh" @click="resetQuery">断开连接</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" icon="Search" @click="startConnect" :disabled="isConnect">连接</el-button>
|
|
|
|
|
+ <el-button icon="Refresh" @click="closeConnect" :disabled="!isConnect">断开连接</el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<p style="font-size: 16px;font-weight: bold;margin-top: 12px">振动传感器配置:</p>
|
|
<p style="font-size: 16px;font-weight: bold;margin-top: 12px">振动传感器配置:</p>
|
|
@@ -236,7 +233,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="Config">
|
|
<script setup name="Config">
|
|
|
-import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
|
|
|
|
|
|
|
+import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache, sensorConnect, sensorDisConnect, sensorStartGather,
|
|
|
|
|
+sensorStopGather} from "@/api/system/config";
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
|
const { sys_yes_no } = proxy.useDict("sys_yes_no");
|
|
const { sys_yes_no } = proxy.useDict("sys_yes_no");
|
|
@@ -252,20 +250,23 @@ const multiple = ref(true);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
const title = ref("");
|
|
const title = ref("");
|
|
|
const dateRange = ref([]);
|
|
const dateRange = ref([]);
|
|
|
|
|
+const isConnect = ref(false)
|
|
|
|
|
|
|
|
const data = reactive({
|
|
const data = reactive({
|
|
|
- form: {},
|
|
|
|
|
|
|
+ form: {
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
- configName: undefined,
|
|
|
|
|
- configKey: undefined,
|
|
|
|
|
- configType: undefined
|
|
|
|
|
|
|
+ ip: undefined,
|
|
|
|
|
+ port: undefined,
|
|
|
|
|
+ frequency: undefined
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
- configName: [{ required: true, message: "参数名称不能为空", trigger: "blur" }],
|
|
|
|
|
- configKey: [{ required: true, message: "参数键名不能为空", trigger: "blur" }],
|
|
|
|
|
- configValue: [{ required: true, message: "参数键值不能为空", trigger: "blur" }]
|
|
|
|
|
|
|
+ // configName: [{ required: true, message: "参数名称不能为空", trigger: "blur" }],
|
|
|
|
|
+ // configKey: [{ required: true, message: "参数键名不能为空", trigger: "blur" }],
|
|
|
|
|
+ // configValue: [{ required: true, message: "参数键值不能为空", trigger: "blur" }]
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -305,6 +306,23 @@ function handleQuery() {
|
|
|
queryParams.value.pageNum = 1;
|
|
queryParams.value.pageNum = 1;
|
|
|
getList();
|
|
getList();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+function startConnect() {
|
|
|
|
|
+ sensorConnect({
|
|
|
|
|
+ ...data.queryParams,
|
|
|
|
|
+ vibrateSensor: configList.value,
|
|
|
|
|
+ electricSensor: configList1.value
|
|
|
|
|
+ }).then(response => {
|
|
|
|
|
+ proxy.$modal.msgSuccess("连接成功");
|
|
|
|
|
+ isConnect.value = true;
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function closeConnect() {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
function resetQuery() {
|
|
function resetQuery() {
|
|
|
dateRange.value = [];
|
|
dateRange.value = [];
|