| | |
| | | import { Component, OnInit } from '@angular/core'; |
| | | import { NzMessageService } from 'ng-zorro-antd'; |
| | | import { getRule, saveRule, removeRule } from '../../../../../_mock/rule.service'; |
| | | import { getInstaller } from '../../../../../_mock/installer.service'; |
| | | |
| | | @Component({ |
| | | selector: 'app-installer', |
| | |
| | | pi: 1, |
| | | ps: 10, |
| | | sorter: '', |
| | | status: -1, |
| | | statusList: [] |
| | | u_name: '', |
| | | u_mobile: '' |
| | | }; |
| | | data: any[] = []; |
| | | loading = false; |
| | |
| | | totalCallNo = 0; |
| | | allChecked = false; |
| | | indeterminate = false; |
| | | status = [ |
| | | { text: '关闭', value: false, type: 'default' }, |
| | | { text: '运行中', value: false, type: 'processing' }, |
| | | { text: '已上线', value: false, type: 'success' }, |
| | | { text: '异常', value: false, type: 'error' } |
| | | ]; |
| | | |
| | | sortMap: any = {}; |
| | | expandForm = false; |
| | | modalVisible = false; |
| | | description = ''; |
| | | |
| | | constructor(public msg: NzMessageService) {} |
| | | |
| | |
| | | |
| | | getData() { |
| | | this.pageChange(1).then(() => { |
| | | this.q.statusList = this.status.map((i, index) => i.value ? index : -1).filter(w => w !== -1); |
| | | if (this.q.status && this.q.status > -1) this.q.statusList.push(this.q.status); |
| | | console.log(this.q); |
| | | this.data = getRule(this.q).map(i => { |
| | | const statusItem = this.status[i.status]; |
| | | i.statusText = statusItem.text; |
| | | i.statusType = statusItem.type; |
| | | // this.q.statusList = this.status.map((i, index) => i.value ? index : -1).filter(w => w !== -1); |
| | | // if (this.q.status && this.q.status > -1) this.q.statusList.push(this.q.status); |
| | | // console.log(this.q); |
| | | this.data = getInstaller(this.q).map(i => { |
| | | return i; |
| | | }); |
| | | }); |
| | |
| | | |
| | | add() { |
| | | this.modalVisible = true; |
| | | this.description = ''; |
| | | } |
| | | |
| | | save() { |
| | | this.loading = true; |
| | | saveRule(this.description); |
| | | this.getData(); |
| | | setTimeout(() => this.modalVisible = false, 500); |
| | | |
| | | } |
| | | |
| | | remove() { |