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
| <template>
| <basic-container>
| <avue-crud ref="crud"
| v-model="form"
| :data="data"
| :option="option"
| @on-load="getList"
| @row-del="rowDel"
| @refresh-change="refreshChange"
| @row-save="rowSave"
| >
| </avue-crud>
| </basic-container>
| </template>
|
| <script>
| export default {
| name: "Torelationpackage.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,
| indexFixed:false,
| menuFixed:false,
| column:[
| {
| label:"To端类型",
| prop:"name",
| },
| ]
| }
| }
| },
| methods:{
| // 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;
| // })
| // },
| //搜索
| rowSave(row, done, loading) {
| add(Object.assign({
| createUser: this.userInfo.name
| }, row)).then(() => {
| this.$message.success('新增成功')
| done();
| this.getList();
| }).catch(() => {
| loading()
| })
| },
| rowDel(row) {
| this.$confirm('此操作将永久删除, 是否继续?', '提示', {
| confirmButtonText: '确定',
| cancelButtonText: '取消',
| type: 'warning'
| }).then(() => {
| return del(row.id)
| }).then(() => {
| this.$message.success('删除成功')
| this.getList();
| })
| },
| }
| }
| </script>
|
| <style scoped>
|
| </style>
|
|