田源
2023-09-18 da6cc144cc4d60805e4693e4adc5ebdf78b5b37d
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
<<template>
  <basic-container>
    <avue-crud ref="crud"
               v-model="form"
               :data="data"
               :option="option"
               @on-load="getList"
               @row-del="rowDel"
               @refresh-change="refreshChange"
               @search-change="searchChange"
               @row-click="handleRowClick"
    >
      <template slot="menuLeft">
        <span>当前选择生命周期:{{this.lifeList}}</span>
 
      </template>
    </avue-crud>
    <div></div>
<!--    <el-button >取 消</el-button>-->
<!--    <el-button type="primary" >确 定</el-button>-->
  </basic-container>
</template>
 
<script>
export default {
  name: "Businpackage.vue",
  data(){
    return {
      lifeList:"",
      data:[
        {
          name:"测试1",
        },
        {
          name:"测试2",
        },
        {
          name:"测试3",
        },
        {
          name:"测试4",
        },
      ],
      form:{},
      option:{
        height:300,
        headerAlign:'center',
        align: 'center',
        border: true,
        editBtn:false,
        index: true,
        searchMenuSpan:8,
        searchSpan:9,
        searchBtnText:'查找',
        searchLabelWidth:100,
        addBtn:false,
        indexFixed:false,
        menuFixed:false,
        column:[
          {
            label:"生命周期名称",
            prop:"name",
            search:true,
            searchWidth:170
          },
        ]
      }
    }
  },
  methods:{
    handleRowClick(val){
      console.log(val)
      this.lifeList=val.name
    },
    // getList () {
    //   this.loading = true;
    //   const data = Object.assign({
    //     pageNum: this.page.currentPage,
    //     pageSize: this.page.pageSize,
    //   }, this.params)
    //   this.data = [];
    //   getList(data).then(res => {
    //     const data = res.data.data
    //     this.loading = false;
    //     this.page.total = data.total;
    //     const result = data.list;
    //     this.data = result;
    //   })
    // },
    //搜索
    searchChange(params, done) {
      if (done) done();
      this.params = params;
      this.page.currentPage = 1;
      this.getList();
      this.$message.success('搜索成功')
    },
    rowDel(row) {
      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        return del(row.id)
      }).then(() => {
        this.$message.success('删除成功')
        this.getList();
      })
    },
  }
}
</script>
 
<style scoped>
 
</style>