clll
2023-12-15 68e28b5e14ba2de103921aa1ab10f6df7b445ae9
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
<script setup>
import request from "@/utils/request";
import deepClone from "@/utils/deepClone";
import {ElDatePicker, ElMessage} from "element-plus";
import useProductGlassTypeStore from "@/stores/productGlassType"
import {watch} from "vue";
import {Search} from "@element-plus/icons-vue";
import GlassType from "@/components/basic/product/GlassType.vue";
import router from "@/router";
let productGlassTypeStore = useProductGlassTypeStore()
watch(productGlassTypeStore,(newVal,oldVal) => {
  console.log(newVal.GlassType)
  let list = productList.filter( product=>{
    return  product.glassType==newVal.GlassType
  })
})
 
let loading = $ref(true)
let productList=$ref([])
request.get("/product").then((res) => {
  if(res.code==200){
    productList= deepClone(res.data)
    loading=false
  }else{
    ElMessage.warning(res.msg)
    router.push("/login")
  }
})
</script>
 
<template>
 
  <div>
    <glass-type   style="float: left" />
 
 
    <el-button
        id="select"
        type="primary" :icon="Search">查询</el-button>
 
 
    <el-table
        v-loading="loading"
        :data="productList"
        :header-cell-style="{ 'text-align': 'center' }"
        :cell-style="{ 'text-align': 'center' }"
        lazy
        border
        style="width: 100%;"
        max-height="80vh">
 
 
      <el-table-column type="expand" fixed>
        <template #default="props">
          <div m="4">
            <p m="t-0 b-2">编号: {{ props.row.prodID }}</p>
            <p m="t-0 b-2">名称: {{ props.row.product }}</p>
            <p m="t-0 b-2">所属类别: {{ props.row.glassType }}</p>
            <p m="t-0 b-2">快速查询: {{ props.row.query }}</p>
            <p m="t-0 b-2">备注: {{ props.row.remarks }}</p>
            <p m="t-0 b-2">创建人: {{ props.row.creator }}</p>
            <p m="t-0 b-2">创建时间: {{ props.row.createTime }}</p>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="110" fixed  >
        <el-button link type="primary" size="small">编辑</el-button>
<!--        <el-button link type="primary" size="small">修改</el-button>-->
        <el-button link type="primary" size="small">删除</el-button>
      </el-table-column>
      <el-table-column sortable prop="prodID" label="编号" width="110"  />
      <el-table-column prop="product" label="名称" :show-overflow-tooltip='true'  />
      <el-table-column prop="typeName" label="所属类别" width="175" />
      <el-table-column prop="query" label="快速查询" width="150" />
      <el-table-column prop="remarks" label="备注" :show-overflow-tooltip='true' width="100" />
      <el-table-column prop="creator" label="创建人" width="75" />
      <el-table-column prop="createTime" label="创建时间" width="100" />
    </el-table>
  </div>
</template>
 
<style scoped>
 
</style>