config.js
2.75 KB
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
117
118
119
120
121
122
123
//组件参数数据
export const componentsData = {
};
// 搜索model
export const bookSearchModel = {
'code': null
};
// 表格展示配置
export const tableColumns = function() {
return [
{
type: 'checkbox',
fixed: 'left'
},
{
text: '书本编号',
field: 'code',
minWidth: 200,
render: (h, param) => {
return h('elLink', {
props: {
type: 'primary'
},
on: {
click: () => {
this.handleOpt('VIEW', param.row);
}
}
}, param.row.code);
},
align: 'left'
},
{
text: '书本名称',
field: 'name',
width: 200,
align: 'left'
},
{
text: '书本介绍',
field: 'introduce',
width: 200,
align: 'left'
},
{
text: '书本排序',
field: 'showorder',
width: 80,
align: 'left'
},
{
text: '创建人',
field: 'createdByName',
align: 'left',
width: 100
},
{
text: '创建时间',
field: 'createdAt',
width: 160,
sortable: true,
render: (h, param) => {
if(param.row.createdAt){
const text = param.row.createdAt.substr(0,16);
return text;
}
return '--';
},
align: 'left'
},
{
field: 'opt',
fixed: 'right',
text: '操作',
width: 100,
render: (h, param) => {
const row = param.row;
const optArr = [];
const editBtn = h('QgButton', {
props: {
toolTip: '编辑',
type: 'text',
icon: 'el-icon-edit'
},
on: {
click: () => {
this.handleOpt('EDIT', row);
}
}
});
optArr.push(editBtn);
const deleteBtn = h('QgButton', {
props: {
toolTip: '删除',
type: 'text',
icon: 'el-icon-delete'
},
on: {
click: () => {
this.handleOpt('DELETE', row);
}
}
});
optArr.push(deleteBtn);
return h('div', optArr, '');
}
}
];
};
// 表单对象
export const bookModel = {
code:null,
name:null,
introduce:null,
showorder:undefined
};