|
@@ -1,6 +1,14 @@
|
|
<template>
|
|
<template>
|
|
- <div>
|
|
|
|
- <el-table :data="tableData" style="width: 100%" border size="large ">
|
|
|
|
|
|
+ <el-drawer
|
|
|
|
+ ref="drawerRef"
|
|
|
|
+ v-model="props.visible"
|
|
|
|
+ title="I have a nested form inside!"
|
|
|
|
+ :before-close="handleClose"
|
|
|
|
+ direction="ltr"
|
|
|
|
+ class="demo-drawer"
|
|
|
|
+ size="80%"
|
|
|
|
+ >
|
|
|
|
+ <el-table :data="tableData" style="width: 100%" border size="large">
|
|
<el-table-column prop="index" label="#" align="center" />
|
|
<el-table-column prop="index" label="#" align="center" />
|
|
<el-table-column prop="numId" label="编号" align="center" />
|
|
<el-table-column prop="numId" label="编号" align="center" />
|
|
<el-table-column prop="name" label="测试产品名称" align="center" />
|
|
<el-table-column prop="name" label="测试产品名称" align="center" />
|
|
@@ -19,35 +27,46 @@
|
|
@current-change="currentChange"
|
|
@current-change="currentChange"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </el-drawer>
|
|
</template>
|
|
</template>
|
|
-<script setup >
|
|
|
|
-import { productList } from "@/api/login";
|
|
|
|
|
|
+
|
|
|
|
+<script setup>
|
|
|
|
+import { productInformationList } from "@/api/login";
|
|
import { onMounted, ref } from "vue";
|
|
import { onMounted, ref } from "vue";
|
|
-const tableData = ref([]);
|
|
|
|
|
|
+const props = defineProps({
|
|
|
|
+ testId: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: "",
|
|
|
|
+ },
|
|
|
|
+ visible: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false,
|
|
|
|
+ },
|
|
|
|
+});
|
|
const page = ref({
|
|
const page = ref({
|
|
current: 1,
|
|
current: 1,
|
|
size: 10,
|
|
size: 10,
|
|
});
|
|
});
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
-const getList = async () => {
|
|
|
|
- let { code, data } = await productList(page.value);
|
|
|
|
|
|
+const tableData = ref([]);
|
|
|
|
+const getData = async () => {
|
|
|
|
+ let { code, data } = await productInformationList({
|
|
|
|
+ ...page.value,
|
|
|
|
+ testId: props.testId,
|
|
|
|
+ });
|
|
if (code != 200) return;
|
|
if (code != 200) return;
|
|
- tableData.value = data.records.map((item,i)=>({...item,index:(page.value.current-1)*10+i+1}));
|
|
|
|
|
|
+ tableData.value = data.records;
|
|
total.value = data.total;
|
|
total.value = data.total;
|
|
};
|
|
};
|
|
-const currentChange = (val) => {
|
|
|
|
- page.value.current = val;
|
|
|
|
- getList();
|
|
|
|
-};
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- getList();
|
|
|
|
|
|
+ getData();
|
|
});
|
|
});
|
|
|
|
+const handleClose = () => {};
|
|
</script>
|
|
</script>
|
|
-<script>
|
|
|
|
|
|
+ <script>
|
|
export default {
|
|
export default {
|
|
- name: "Home",
|
|
|
|
|
|
+ name: "DrawerM",
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
-<style scoped lang="scss">
|
|
|
|
|
|
+<style lang='scss' scoped>
|
|
</style>
|
|
</style>
|