wangting
2023-05-31 8befde9f52a8bf1a7cd13666d4396587b0a0b1cc
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
<template>
  <avue-input-table :props="props"  :column="column" :on-load="onLoad" v-model="value"  :placeholder="placeholder" ></avue-input-table>
</template>
 
<script>
export default {
  name: "vciWebReferTable",
  props:["options","value"],
  data() {
    return {
      placeholder:'请选择数据',
      column:{
        children:{
          border: true,
          column: [{
            label: '姓名',
            width: 120,
            search:true,
            prop: 'name'
          }, {
            label: '性别',
            search:true,
            prop: 'sex'
          }],
        },
      },
      props: {
        label: 'name',
        value: 'oid'
      }
    };
  },
  methods: {
    onLoad({page, value, data}, callback) {
      //首次加载去查询对应的值
      if (value) {
        this.$message.success('首次查询' + value)
        callback({
          id: '0',
          name: '张三',
          sex: '男'
        })
        return
      }
      if (data) {
        this.$message.success('搜索查询参数' + JSON.stringify(data))
      }
      if (page) {
        this.$message.success('分页参数' + JSON.stringify(page))
      }
      //分页查询信息
      callback({
        total: 2,
        data: [{
          id: '0',
          name: '张三',
          sex: '男'
        }, {
          id: '1',
          name: '李四',
          sex: '女'
        }]
      })
    }
  }
}
</script>
 
<style scoped>
 
</style>