|
@@ -45,6 +45,7 @@
|
|
|
<template #header>
|
|
|
<div class="flex justify-center">
|
|
|
<n-progress
|
|
|
+ :indicator-placement="'inside'"
|
|
|
:status="
|
|
|
keyInfo.Code === 600
|
|
|
? 'default'
|
|
@@ -52,16 +53,16 @@
|
|
|
? 'success'
|
|
|
: 'error'
|
|
|
"
|
|
|
- type="dashboard"
|
|
|
+ type="line"
|
|
|
gap-position="bottom"
|
|
|
:percentage="keyInfo.Schedule"
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <div
|
|
|
- style="max-height: 20px;overflow-y: auto;" ref="scrollbarRef"
|
|
|
+ <div class=" pis"
|
|
|
+ style="overflow:auto;height:200px;" ref="scrollbarRef"
|
|
|
>
|
|
|
- <div class="flex" v-for="(item, index) of items" :key="index">
|
|
|
+ <div class="flex" v-for="(item, index) of items" :key="index"> <!-- items -->
|
|
|
<n-badge class="mr-5" type="info" :value="index + 1" />
|
|
|
<span>{{ item }}</span>
|
|
|
</div>
|
|
@@ -98,11 +99,10 @@ import { getToken } from '@/utils/storage/sessionToken';
|
|
|
import { getFileToken } from '@/common';
|
|
|
import { useWindowSize } from '@vueuse/core';
|
|
|
import { NButton } from 'naive-ui';
|
|
|
-import { onBeforeUnmount } from 'vue';
|
|
|
+import { nextTick, onBeforeUnmount, onUpdated } from 'vue';
|
|
|
import FormList from '@/components/FormList.vue';
|
|
|
|
|
|
const { height } = useWindowSize();
|
|
|
-
|
|
|
const message = useMessage();
|
|
|
|
|
|
const scrollbarRef = ref(null);
|
|
@@ -200,14 +200,23 @@ const generateReportInfo = async (obj) => {
|
|
|
let timer = 0;
|
|
|
const keyInfo = ref({});
|
|
|
const items = computed(() => {
|
|
|
- return keyInfo.value.Item
|
|
|
- ? keyInfo.value.Item.split('\n').filter((item) => item)
|
|
|
- : [];
|
|
|
+ if(keyInfo.value.Item){
|
|
|
+ nextTick(()=>{
|
|
|
+ scrollbarRef.value.scrollTop = scrollbarRef.value.scrollHeight
|
|
|
+ })
|
|
|
+ return keyInfo.value.Item.split('\n').filter((item) => item)
|
|
|
+ }else{
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
|
|
|
|
|
|
// 验证报告生成 获取生成结果
|
|
|
const generateKeyInfo = async (key) => {
|
|
|
+
|
|
|
const { data: res } = await generateKey({
|
|
|
key,
|
|
|
});
|
|
@@ -218,10 +227,8 @@ const generateKeyInfo = async (key) => {
|
|
|
} else {
|
|
|
clearTimeout(timer);
|
|
|
}
|
|
|
- // scrollbarRef.value.scrollTop = 999999
|
|
|
-// console.log('scrollbarRef',scrollbarRef.value)
|
|
|
-
|
|
|
keyInfo.value = res;
|
|
|
+
|
|
|
};
|
|
|
|
|
|
// 关闭对话框时触发
|
|
@@ -237,14 +244,14 @@ const handleDownload = () => {
|
|
|
|
|
|
// 生成报告
|
|
|
const putTemplateData = async () => {
|
|
|
-
|
|
|
try {
|
|
|
const arr = toRaw(formValue.formList);
|
|
|
- const VerifyTemplateMapData = arr.map((item) => {
|
|
|
+
|
|
|
+ const VerifyTemplateMapData = arr.map((item,i) => {
|
|
|
if (item.T_label === 3 || item.T_label === 9) {
|
|
|
return {
|
|
|
T_VerifyTemplateMap_id: item.T_VerifyTemplateMap_id,
|
|
|
- T_value: item.T_value.join('|'),
|
|
|
+ T_value: item.T_value!=null?item.T_value.join('|'):'',
|
|
|
T_source: item.T_source,
|
|
|
T_flow_sort: item.T_flow_sort,
|
|
|
T_max_time: item.T_max_time,
|
|
@@ -287,28 +294,30 @@ const putTemplateData = async () => {
|
|
|
T_VerifyTemplate_id: queryData.T_VerifyTemplate_id,
|
|
|
VerifyTemplateMapData,
|
|
|
});
|
|
|
+
|
|
|
if (res.Code === 200) {
|
|
|
const obj = {};
|
|
|
+
|
|
|
for (let i of arr) {
|
|
|
if (i.T_label === 3 || i.T_label === 9) {
|
|
|
- obj[i.T_name] = i.T_value.join('|');
|
|
|
+
|
|
|
+ obj[i.T_name] = i.T_value!=null?i.T_value.join('|'):'';
|
|
|
} else if (i.T_label === 12) {
|
|
|
obj[i.T_name] = i.T_value.join('/');
|
|
|
- } else if (i.T_label === 13) {
|
|
|
+ } else if (i.T_label === 13) {
|
|
|
obj[i.T_name] = `${i.T_value[0].join('|')}/${i.T_value[1]}`;
|
|
|
} else {
|
|
|
obj[i.T_name] = i.T_value;
|
|
|
}
|
|
|
}
|
|
|
modal.title = '生成报告';
|
|
|
- modal.showModal = true;
|
|
|
+ modal.showModal = true;
|
|
|
generateReportInfo(obj);
|
|
|
}
|
|
|
} catch (e) {
|
|
|
console.log(e);
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
// 获取设备列表
|
|
|
const getClassList = async () => {
|
|
|
try {
|
|
@@ -332,9 +341,13 @@ const getTemplateList = async () => {
|
|
|
if (item.T_label === 3){
|
|
|
item.T_value = item.T_value ? item.T_value.split('|') : [];
|
|
|
}else if(item.T_label == 9){
|
|
|
- item.T_value = item.T_value ? item.T_value.split('|') : null;
|
|
|
+ if(item.T_value=='|' || item.T_value==''){
|
|
|
+ item.T_value = null
|
|
|
+ }else{
|
|
|
+ item.T_value = item.T_value.split('|')
|
|
|
+ }
|
|
|
}else if (item.T_label === 12) {
|
|
|
- item.T_value = item.T_value? [item.T_value.split('/')[0], item.T_value.split('/')[1]]: [null,null];
|
|
|
+ item.T_value = item.T_value!='/'? [item.T_value.split('/')[0], item.T_value.split('/')[1]]: [null,null];
|
|
|
} else if (item.T_label === 13) {
|
|
|
item.T_value = item.T_value? [item.T_value.split('/')[0].split('|'), item.T_value.split('/')[1]]: [null,null];
|
|
|
} else {
|
|
@@ -355,4 +368,5 @@ onBeforeUnmount(() => {
|
|
|
getTemplateList();
|
|
|
</script>
|
|
|
|
|
|
-<style scoped></style>
|
|
|
+<style scoped>
|
|
|
+</style>
|