Jelajahi Sumber

报告模版页面测试数据接口。

jiaxiaoqiang 3 bulan lalu
induk
melakukan
d39437a1ea
1 mengubah file dengan 30 tambahan dan 13 penghapusan
  1. 30 13
      src/views/modules/report-template/report-template.vue

+ 30 - 13
src/views/modules/report-template/report-template.vue

@@ -18,7 +18,6 @@ const onSelectTemplate = (tem) => {
   temsDrawerVisible.value = false;
 };
 const onOpenTemplate = () => {
-  console.log("onOpenTemplate");
   temsDrawerVisible.value = true;
   nextTick(() => {
     listRef.value && listRef.value.openDrawer();
@@ -101,16 +100,19 @@ const onSaveTemplate = () => {
 };
 
 // 点击搜索按钮查询 产品编码下的测试数据
+const testingDataList = ref<any[]>([]); // 测试数据列表
 const onSearchTestingData = async () => {
   console.log(formData);
   let res = await getTestingDataByCode(
     formData.engineeringId,
     formData.productCode
   );
+  testingDataList.value = res.data;
 };
 // 点击测试数据的写入
 const onWriteTestingData = (item) => {
   console.log("onWriteTestingData", item);
+  let toWriteValue = `{{${item.dataItem}}`;
 };
 
 onMounted(() => {
@@ -194,14 +196,24 @@ onMounted(() => {
       </div>
       <div class="white-line"></div>
       <div class="result-text">搜索结果</div>
-      <div class="result-box">
-        <div class="result-title-text">1dB压缩点</div>
-        <div class="result-bar">
-          <el-icon size="20" style="cursor: pointer"><DocumentAdd /></el-icon>
-          <div>测试时间:14:28:48</div>
-          <div>通过</div>
+      <el-scrollbar class="scroll-bottm-height">
+        <div class="result-box">
+          <div v-for="item in testingDataList" :key="item.projectName">
+            <div class="result-title-text">{{ item.projectName }}</div>
+            <div class="result-bar" v-for="log in item.logList">
+              <el-icon
+                size="20"
+                style="cursor: pointer"
+                @click.stop="onWriteTestingData(log)"
+              >
+                ><DocumentAdd
+              /></el-icon>
+              <div>{{ log.dataItem }}</div>
+              <div></div>
+            </div>
+          </div>
         </div>
-      </div>
+      </el-scrollbar>
     </div>
 
     <el-drawer
@@ -277,10 +289,9 @@ onMounted(() => {
     .result-box {
       margin-top: 12px;
       padding: 12px 6px;
-      height: calc(100vh - $main-header-height - 64px - 12px - 240px);
-      border-radius: 4px 4px 4px 4px;
-      border: 1px solid #696969;
-      overflow-y: auto;
+      //height: calc(100vh - $main-header-height - 64px - 12px - 330px);
+
+      //overflow-y: auto;
 
       .result-title-text {
         font-size: 14px;
@@ -301,7 +312,7 @@ onMounted(() => {
         margin-top: 8px;
         text-align: center;
         display: flex;
-        justify-content: space-evenly;
+        justify-content: space-around;
         align-items: center;
         padding: 0 12px;
       }
@@ -309,6 +320,12 @@ onMounted(() => {
   }
 }
 
+.scroll-bottm-height {
+  height: calc(100vh - $main-header-height - 64px - 12px - 330px);
+  border-radius: 4px 4px 4px 4px;
+  border: 1px solid #696969;
+}
+
 .blue-btn {
   width: 130px;
   height: 36px;