{
constructor: function(){
},
ngOnInit: function() {
},
ngAfterViewInit: function() {
console.log(this);
this.load();
},
add: function(){
var that = this;
this.open(2,{},{size: 'xl'}).subscribe(function(res){
if(res)
that.load();
});
},
searchSchema: {
properties: {
no: {
type: 'string',
title: '编号',
ui: {
errors: {
'required': '必填项'
}
}
},
name: {
type: 'string',
title: '名称'
}
},
required: ['no','name']
},
page: {
front: false,
},
formSubmit: function(event){
},
formReset: function(event) {
},
list: [],
columns: [
{ title: 'ID', index: 'id' ,sort:{} },
{ title: '名称', index: 'name' },
{ title: '状态', index: 'status' },
{ title: '创建时间', type: 'date', index: 'created_at' },
{title: '修改时间',type: 'date', index: 'updated_at'},
{
title: '操作',
buttons: [
{ text: '查看' },
{ text: "编辑" ,click: function(a,b,c){
this.open(2,a,{size: 'xl'}).subscribe(function(res){
});
} }
]
}
],
total: 0,
change: function(event) {
},
query: {
body: {
},
id: '',
name: 'list',
},
load: function(){
var that =this;
this.query.id = this['module'].id;
this.moduleSvr
.getData(this.query)
.subscribe(function(res){
if(res.code === 0){
that.list = res.data.list;
that.total = res.data.total;
}
});
}
}