闫增涛
4 天以前 6227519a1bd9007aedae11b77b0b3b1851837c38
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<template>
  <div class="permission-manage">
    <div class="titleBox">
      <div class="name">
        <span>{{ name }}测试报告</span>
      </div>
      <div class="back" @click="goBack">
        <el-icon><ArrowLeftBold /></el-icon>返回
      </div>
    </div>
    <div class="page-box">
      <div class="search flex">
        <el-input
          v-model="searchValue"
          placeholder="请输入搜索关键字"
          class="searchInput"
        >
          <template #suffix>
            <el-icon class="el-input__icon"><search /></el-icon>
          </template>
        </el-input>
      </div>
      <div class="list">
        <div>
          <el-table
            :data="tableData"
            border
            :default-sort="{ prop: 'date', order: 'descending' }"
            style="width: 100%"
          >
            <el-table-column prop="index" label="序号" width="60" />
            <el-table-column prop="name" label="测试名称" />
            <el-table-column prop="TestModel" label="测试模型" />
            <el-table-column prop="createDate" label="测试时间" sortable />
            <!-- <el-table-column prop="operator" label="测试人" /> -->
            <!-- <el-table-column label="操作">
              <template #default="scope">
                <el-button size="small" @click="getDetail(scope.row)">
                  查看
                </el-button>
              </template>
            </el-table-column> -->
          </el-table>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script setup lang="ts">
import { ref, onMounted, inject } from "vue";
const name = ref("飞跃器整模型");
const testTime = ref();
const searchValue = ref();
const tableData = ref([]);
import { curStoreInfo } from "@/store/index";
import { useRoute, useRouter } from "vue-router";
const seleStore = curStoreInfo();
const toolClass: any = inject("toolClass");
const route = useRoute();
const router = useRouter();
onMounted(() => {
  getReportData();
});
 
const goBack = () => {
  router.push({
    path: "/simulation",
  });
};
 
const getReportData = async () => {
  const fields = {
    TestModel: [],
    TestName: [],
    ModelRemarks: [],
  };
  let searchFields = {};
  let modelQuery = {};
  if (searchValue.value && searchValue.value != "") {
    searchFields = {
      "TestName*": [searchValue.value],
    };
  }
  if (route.query?.id && route.query.id != "") {
    modelQuery = {
      "TestModel=": [route.query.id],
    };
  }
  const body = {
    path: seleStore.testReportChannel.data.idPath,
    type: "\\",
    storeId: seleStore.storeInfo.storeId,
    repositoryId: seleStore.storeInfo.repositoryId,
    paging: {
      Start: 0,
      Size: 99,
    },
    linkTypes: [],
    fields: { ...fields, ...searchFields, ...modelQuery },
    filters: {
      "SysType=": ["CmsItem"],
    },
  };
  const queryTableData = await toolClass.getCmsItem(body);
  console.log(queryTableData, "queryTableData");
  tableData.value = queryTableData.datas;
};
</script>
 
<style lang="less" scoped>
.permission-manage {
  background-color: #fff;
  height: 100%;
}
.testReport {
  padding: 20px;
}
.titleBox {
  height: 36px;
  line-height: 36px;
  position: relative;
  .name {
    text-align: center;
  }
  .back {
    position: absolute;
    left: 10px;
    top: 0;
    display: flex;
    align-items: center;
  }
}
.page-box {
  padding: 20px;
  .searchInput {
    width: 220px;
    margin-left: 20px;
  }
  .list {
    margin-top: 20px;
  }
}
</style>