微调
This commit is contained in:
@@ -127,12 +127,14 @@
|
||||
size="large"
|
||||
@click="startLoading"
|
||||
style="margin-left: 70px;margin-top: 10px;"
|
||||
:disabled="startDisabeld"
|
||||
>启动</el-button>
|
||||
<el-button :icon="CirclePlus"
|
||||
type="primary"
|
||||
size="large"
|
||||
@click="stopLoading"
|
||||
style="margin-top: 10px;"
|
||||
:disabled="pauseDisabled"
|
||||
>停止</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -168,7 +170,7 @@
|
||||
import { type PropType, ref, nextTick, onMounted, watch } from 'vue'
|
||||
import Tree from './tree.vue'
|
||||
import Commun from './communication.vue'
|
||||
import type { CascaderOption } from 'element-plus'
|
||||
import {type CascaderOption, ElMessage} from 'element-plus'
|
||||
import { getTreeData } from '@/api/check/test'
|
||||
import { CirclePlus, Delete, Check, CopyDocument, View, EditPen } from '@element-plus/icons-vue'
|
||||
import type { TestScript } from '@/api/device/interface/testScript'
|
||||
@@ -203,8 +205,18 @@ const props = defineProps({
|
||||
formControl: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
startDisabeld: {
|
||||
type:Boolean,
|
||||
required:true
|
||||
},
|
||||
pauseDisabled: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const showDialog = ref(false)
|
||||
const viewDialog = ref(false)
|
||||
const dictStore = useDictStore()
|
||||
@@ -234,7 +246,7 @@ const column = ref([
|
||||
}
|
||||
])
|
||||
|
||||
const emit = defineEmits(['update:activeName','update:activeIndex'])
|
||||
const emit = defineEmits(['update:activeName','update:activeIndex','update:startDisabeld','update:pauseDisabled'])
|
||||
const controlContent = ref<controlSource.ResControl>({
|
||||
userPageId: '',
|
||||
scriptId: '',
|
||||
@@ -373,12 +385,17 @@ const view = (row: Partial<TestScript.ResTestScript> = {}) => {
|
||||
|
||||
// 定义 startLoading 方法
|
||||
const startLoading = async () => {
|
||||
emit('update:startDisabeld', true)
|
||||
emit('update:pauseDisabled', true)
|
||||
ElMessage.success({message:'启动中...',duration:4000})
|
||||
// 启动加载逻辑
|
||||
controlContent.value.userPageId = 'cdf'
|
||||
controlContent.value.scriptId = '9ff96807cf8c7524587982ed8baa8b57'
|
||||
controlContent.value.scriptIndex = childActiveIndex.value
|
||||
controlContent.value.sourceId = props.formControl.sourceId
|
||||
setTimeout(async () => {
|
||||
await startSimulateTest(controlContent.value)
|
||||
},3000)
|
||||
}
|
||||
|
||||
// 定义 startLoading 方法
|
||||
@@ -389,6 +406,9 @@ const stopLoading = async () => {
|
||||
controlContent.value.scriptIndex = childActiveIndex.value
|
||||
controlContent.value.sourceId = props.formControl.sourceId
|
||||
await closeSimulateTest(controlContent.value)
|
||||
emit('update:pauseDisabled', true)
|
||||
emit('update:startDisabeld', true)
|
||||
ElMessage.success({message:'停止中...',duration:4000})
|
||||
}
|
||||
|
||||
// 获取左边树数据
|
||||
|
||||
Reference in New Issue
Block a user