|
@@ -1,7 +1,28 @@
|
|
|
<script setup lang="ts">
|
|
|
+import { ref } from "vue";
|
|
|
+import TemplateList from "./com/templateList.vue";
|
|
|
+import {
|
|
|
+ getProductCodeListById,
|
|
|
+ getTestedProductList,
|
|
|
+ getTestingDataByCode,
|
|
|
+} from "@/api/project/template";
|
|
|
+
|
|
|
const excelRef = ref(null);
|
|
|
+
|
|
|
+// 打开模版
|
|
|
+const temsDrawerVisible = ref(false);
|
|
|
+const listRef = ref();
|
|
|
+const currentTemplate = ref(null);
|
|
|
+const onSelectTemplate = (tem) => {
|
|
|
+ currentTemplate.value = tem;
|
|
|
+ temsDrawerVisible.value = false;
|
|
|
+};
|
|
|
const onOpenTemplate = () => {
|
|
|
console.log("onOpenTemplate");
|
|
|
+ temsDrawerVisible.value = true;
|
|
|
+ nextTick(() => {
|
|
|
+ listRef.value && listRef.value.openDrawer();
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const onImportTemplate = () => {
|
|
@@ -17,10 +38,89 @@ const onExportTemplate = () => {
|
|
|
console.log("onExportTemplate");
|
|
|
};
|
|
|
|
|
|
+// ===== 右侧区域 =======
|
|
|
+const formRef = ref(null);
|
|
|
+const formData = reactive({
|
|
|
+ engineeringId: "",
|
|
|
+ formName: "",
|
|
|
+ productCode: "",
|
|
|
+});
|
|
|
+
|
|
|
+// 产品选择器
|
|
|
+const productAllList = ref<any[]>([]); // 产品列表
|
|
|
+const productList = ref<any[]>([]); // 产品列表
|
|
|
+const proProps = {
|
|
|
+ label: "engineeringProductName",
|
|
|
+ value: "id",
|
|
|
+};
|
|
|
+const proLoading = ref(false);
|
|
|
+const proRemoteMethod = (query: string) => {
|
|
|
+ let queryString = query.trim();
|
|
|
+ if (queryString.length === 0) {
|
|
|
+ productList.value = productAllList.value;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ getTestedProductList({
|
|
|
+ engineeringProductName: queryString,
|
|
|
+ executeStatus: true,
|
|
|
+ }).then((res) => {
|
|
|
+ productList.value = res.data;
|
|
|
+ });
|
|
|
+};
|
|
|
+const onProductChange = (val) => {
|
|
|
+ getProductCodeListById(formData.engineeringId).then((res) => {
|
|
|
+ codeAllList.value = res.data;
|
|
|
+ codeList.value = codeAllList.value;
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// 产品编号选择器
|
|
|
+const codeAllList = ref<any[]>([]); // 产品编号列表
|
|
|
+const codeList = ref<any[]>([]); // 产品编号列表
|
|
|
+const codeProps = {
|
|
|
+ label: "productCode",
|
|
|
+ value: "productCode",
|
|
|
+};
|
|
|
+const codeLoading = ref(false);
|
|
|
+const codeRemoteMethod = (query: string) => {
|
|
|
+ let queryString = query.trim();
|
|
|
+ if (queryString.length === 0) {
|
|
|
+ codeList.value = codeAllList.value;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ getProductCodeListById(formData.engineeringId, queryString).then((res) => {
|
|
|
+ codeList.value = res.data;
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
const onSaveTemplate = () => {
|
|
|
- const res = excelRef.value.getExcelData();
|
|
|
- console.log("onSaveTemplate", res, "传给后端要转json");
|
|
|
+ // const res = excelRef.value.getExcelData();
|
|
|
+ // console.log("onSaveTemplate", res, "传给后端要转json");
|
|
|
+ console.log("onSaveTemplate", formRef.value);
|
|
|
+ formRef.value && formRef.value.resetFields();
|
|
|
+};
|
|
|
+
|
|
|
+// 点击搜索按钮查询 产品编码下的测试数据
|
|
|
+const onSearchTestingData = async () => {
|
|
|
+ console.log(formData);
|
|
|
+ let res = await getTestingDataByCode(
|
|
|
+ formData.engineeringId,
|
|
|
+ formData.productCode
|
|
|
+ );
|
|
|
+};
|
|
|
+// 点击测试数据的写入
|
|
|
+const onWriteTestingData = (item) => {
|
|
|
+ console.log("onWriteTestingData", item);
|
|
|
};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getTestedProductList({
|
|
|
+ executeStatus: true,
|
|
|
+ }).then((res) => {
|
|
|
+ productAllList.value = res.data;
|
|
|
+ productList.value = productAllList.value;
|
|
|
+ });
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -55,18 +155,40 @@ const onSaveTemplate = () => {
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
<div class="title-header">测试项查询</div>
|
|
|
- <el-form rer="formRef" label-position="top">
|
|
|
- <el-form-item label="产品">
|
|
|
- <el-input />
|
|
|
+ <el-form ref="formRef" v-model:model="formData" label-position="top">
|
|
|
+ <el-form-item label="模版名称" prop="formName">
|
|
|
+ <el-input v-model="formData.formName" placeholder="请输入模版名称" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="产品编号">
|
|
|
- <el-select placeholder="please select your zone">
|
|
|
- <el-option label="Zone one" value="shanghai" />
|
|
|
- <el-option label="Zone two" value="beijing" />
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="产品" prop="engineeringId">
|
|
|
+ <el-select-v2
|
|
|
+ v-model="formData.engineeringId"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ :remote-method="proRemoteMethod"
|
|
|
+ clearable
|
|
|
+ :props="proProps"
|
|
|
+ :options="productList"
|
|
|
+ :loading="proLoading"
|
|
|
+ placeholder="请选择产品名称"
|
|
|
+ @change="onProductChange"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="产品编号" prop="productCode">
|
|
|
+ <el-select-v2
|
|
|
+ v-model="formData.productCode"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ :remote-method="codeRemoteMethod"
|
|
|
+ clearable
|
|
|
+ :props="codeProps"
|
|
|
+ :options="codeList"
|
|
|
+ :loading="codeLoading"
|
|
|
+ placeholder="请选择产品编号"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <div class="blue-btn" style="width: 100%" @click="onSaveTemplate">
|
|
|
+ <div class="blue-btn" style="width: 100%" @click="onSearchTestingData">
|
|
|
<svg-icon icon-class="search" />
|
|
|
搜索
|
|
|
</div>
|
|
@@ -74,9 +196,28 @@ const onSaveTemplate = () => {
|
|
|
<div class="result-text">搜索结果</div>
|
|
|
<div class="result-box">
|
|
|
<div class="result-title-text">1dB压缩点</div>
|
|
|
- <div class="result-bar">测试时间:14:28:48</div>
|
|
|
+ <div class="result-bar">
|
|
|
+ <el-icon size="20" style="cursor: pointer"><DocumentAdd /></el-icon>
|
|
|
+ <div>测试时间:14:28:48</div>
|
|
|
+ <div>通过</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <el-drawer
|
|
|
+ v-model="temsDrawerVisible"
|
|
|
+ :with-header="false"
|
|
|
+ :append-to-body="true"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ size="800"
|
|
|
+ direction="ltr"
|
|
|
+ >
|
|
|
+ <TemplateList
|
|
|
+ ref="listRef"
|
|
|
+ @close="temsDrawerVisible = false"
|
|
|
+ @selected="onSelectTemplate"
|
|
|
+ ></TemplateList>
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -159,6 +300,10 @@ const onSaveTemplate = () => {
|
|
|
color: #ffffff;
|
|
|
margin-top: 8px;
|
|
|
text-align: center;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-evenly;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 12px;
|
|
|
}
|
|
|
}
|
|
|
}
|