123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- {
- 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;
- }
- });
- }
- }
- <page-header [autoTitle]="false" [title]=" " [action]="phActionTpl">
- </page-header>
- <nz-card>
- <div nz-row>
- <div nz-col nzSpan="20">
- <sf mode="search" [schema]="searchSchema" (formSubmit)="formSubmit($event)" (formReset)="formSubmit($event)"></sf>
- </div>
- <div nz-col nzSpan="4">
- <button nz-button nzType="primary" style="float:right" (click)="add()">新增</button>
- </div>
- </div>
-
- <st #st [data]="list" [total]="total" [columns]="columns"></st>
- </nz-card>
|