微调
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
ref="dialogFormRef"
|
||||
class="form-five"
|
||||
>
|
||||
<el-form-item label='检测源' prop='sourceIds' >
|
||||
<el-select v-model="sourceValue" collapse-tags placeholder="请选择检测源">
|
||||
<el-form-item label='检测源' prop='sourceId' >
|
||||
<el-select v-model="controlContent.sourceId" collapse-tags placeholder="请选择检测源">
|
||||
<el-option
|
||||
v-for="(option, index) in pqSourceArray"
|
||||
:key="index"
|
||||
@@ -19,7 +19,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div class="formBut">
|
||||
<el-button type="primary" :icon="Select" >通讯校验</el-button>
|
||||
<el-button type="primary" :icon="Select" @click="start()">通讯校验</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -44,6 +44,8 @@ import { CascaderOption, ElMessage } from 'element-plus'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||
import socketClient from '@/utils/webSocketClient'
|
||||
import { checkSimulate } from '@/api/device/controlSource/index.ts'
|
||||
import { controlSource } from '@/api/device/interface/controlSource'
|
||||
const show = ref(false)
|
||||
const router = useRouter()
|
||||
const modeId = ref()
|
||||
@@ -65,6 +67,13 @@ const formContent = ref<TestScript.ResTestScript>({
|
||||
standardTime: '2025',
|
||||
state: 1
|
||||
})
|
||||
|
||||
const controlContent = ref<controlSource.ResControl>({
|
||||
userPageId: '',
|
||||
scriptId: '',
|
||||
scriptIndex: '',
|
||||
sourceId: '',
|
||||
})
|
||||
//开始创建webSocket客户端
|
||||
const dataSocket = reactive({
|
||||
socketServe: socketClient.Instance,
|
||||
@@ -118,20 +127,25 @@ onMounted(async () => {
|
||||
label: item.name || '',
|
||||
value: item.id
|
||||
}));
|
||||
|
||||
|
||||
nextTick(async () => {
|
||||
|
||||
await treeInfo(modeStore.currentMode)
|
||||
formContent.value.pattern = modeId.value
|
||||
console.log( formContent.value);
|
||||
show.value = true
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
watch(webMsgSend, function (newValue, oldValue) {
|
||||
switch (newValue.requestId) {
|
||||
case 'connect':
|
||||
switch (newValue.operateCode) {
|
||||
case "Source":
|
||||
ElMessage.error('源服务端连接失败')
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
// 获取树字典
|
||||
const treeInfo = async (currentMode: string) => {
|
||||
const data: Dict.ResDictTree = {
|
||||
@@ -172,6 +186,14 @@ const convertToOptions = (dictTree: Dict.ResDictTree[]): CascaderOption[] => {
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
const start = async () => {
|
||||
controlContent.value.userPageId = 'cdf'
|
||||
controlContent.value.scriptId = '9ff96807cf8c7524587982ed8baa8b5'
|
||||
controlContent.value.scriptIndex = '1'
|
||||
await checkSimulate(controlContent.value)
|
||||
}
|
||||
|
||||
// 对外映射
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user