微调
This commit is contained in:
@@ -54,7 +54,7 @@ export namespace CheckData {
|
||||
LOADING = 0,
|
||||
SUCCESS = 1,
|
||||
FAIL = 2,
|
||||
UNCONNECTED=3,
|
||||
UNCONNECTED = 3,
|
||||
ERRORDATA = 4
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<!-- <template #header>-->
|
||||
<!-- <div style="background: #003078 !important; color: #fff !important; font-size: 18px;">检测项进度</div>-->
|
||||
<!-- </template>-->
|
||||
<div ref="scrollContainer">
|
||||
<div ref="scrollContainerRef">
|
||||
<p v-for="(item, index) in testLogList"
|
||||
:key="index"
|
||||
:style="{color:item.type==='error'?'#F56C6C': item.type==='warning'?'#e6a23c':'var(--el-text-color-regular)'}">
|
||||
@@ -195,7 +195,7 @@ const testStatus = toRef(props, 'testStatus')
|
||||
const webMsgSend = toRef(props, 'webMsgSend')
|
||||
|
||||
const resultDialogVisible = ref(false)
|
||||
const scrollContainer = ref<HTMLElement | null>(null);
|
||||
const scrollContainerRef = ref();
|
||||
const dataCheckSingleChannelSingleTestPopupRef = ref<InstanceType<typeof dataCheckSingleChannelSingleTestPopup>>()
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ const checkResultView = computed(() => {
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Minus'})
|
||||
break;
|
||||
case CheckData.ChnCheckResultEnum.LOADING:
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Loading'})
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.LOADING, icon: 'Loading'})
|
||||
break;
|
||||
case CheckData.ChnCheckResultEnum.SUCCESS:
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.SUCCESS, icon: 'CircleCheckFilled'})
|
||||
@@ -256,7 +256,7 @@ const checkResultView = computed(() => {
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Minus'})
|
||||
break;
|
||||
case CheckData.ChnCheckResultEnum.LOADING:
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Loading'})
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.LOADING, icon: 'Loading'})
|
||||
break;
|
||||
case CheckData.ChnCheckResultEnum.SUCCESS:
|
||||
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.SUCCESS, icon: 'CircleCheckFilled'})
|
||||
@@ -470,7 +470,6 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
|
||||
// 更新进度条
|
||||
const updatePercentage = () => {
|
||||
console.log('updatePercentage',activeIndex, checkTotal)
|
||||
if (activeIndex < checkTotal) {
|
||||
percentage.value = Math.trunc(activeIndex / checkTotal * 100);
|
||||
} else {
|
||||
@@ -498,7 +497,8 @@ onBeforeMount(() => {
|
||||
initCheckResult()
|
||||
|
||||
// todo 可移除start
|
||||
randomUnConnectedRaw = getRandomInt(scriptData.length) + 1
|
||||
let a = getRandomInt(scriptData.length) + 4
|
||||
randomUnConnectedRaw = a < scriptData.length ? a : scriptData.length
|
||||
randomUnConnectedDeviceId = deviceList[getRandomInt(deviceList.length)].deviceId
|
||||
randomErrorDataRaw = getRandomInt(scriptData.length) + 1
|
||||
while (randomErrorDataRaw === randomUnConnectedRaw) {
|
||||
@@ -507,6 +507,7 @@ onBeforeMount(() => {
|
||||
// todo 可移除end
|
||||
})
|
||||
|
||||
|
||||
const showTestLog = () => {
|
||||
drawer.value = true
|
||||
}
|
||||
@@ -600,8 +601,9 @@ const updateCheckResult = (data: CheckData.ScriptChnItem) => {
|
||||
}
|
||||
|
||||
const scrollToBottom = () => {
|
||||
if (scrollContainer.value) {
|
||||
scrollContainer.value.scrollTop = scrollContainer.value.scrollHeight;
|
||||
if (scrollContainerRef.value) {
|
||||
scrollContainerRef.value.scrollTop = scrollContainerRef.value.scrollHeight;
|
||||
console.log(scrollContainerRef.value.scrollTop)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -773,7 +775,7 @@ const getCheckResult = (scriptId: string) => {
|
||||
tempChnResult.push(CheckData.ChnCheckResultEnum.SUCCESS)
|
||||
}
|
||||
let randomNum = getRandomInt(item.chnNum * 2)
|
||||
if (randomNum < item.chnNum) {
|
||||
if (randomNum < item.chnNum && activeIndex >= 4 && activeIndex <= 8) {
|
||||
tempChnResult[randomNum] = CheckData.ChnCheckResultEnum.FAIL
|
||||
errorCheckItem.push({scriptId, type: 'error'})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user