| | |
| | | class="demo-form-inline" |
| | | > |
| | | <el-form-item label="选择组织:"> |
| | | <el-select |
| | | <!-- <el-select |
| | | v-model="formInline.organizationId" |
| | | placeholder="选择组织" |
| | | > |
| | |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-select> --> |
| | | <el-cascader |
| | | ref="cascader" |
| | | :show-all-levels="false" |
| | | :options="orgData" |
| | | collapse-tags |
| | | :props="props" |
| | | clearable |
| | | @change="changeCascader" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-radio-group |
| | |
| | | data () { |
| | | return { |
| | | formInline: { |
| | | organizationId: '', |
| | | macs: [], |
| | | hourState: '', |
| | | state: '', |
| | | startTime: '', |
| | |
| | | macDate: {}, |
| | | macOnlineData: {}, |
| | | orgData: [], |
| | | props: { multiple: true, label: 'name', value: 'id', children: 'monitorPoint' }, |
| | | tableData: [], |
| | | handleShow: false, |
| | | loading: false, |
| | |
| | | } |
| | | }, |
| | | mounted () { |
| | | this.getOrganizationId() |
| | | this.$set(this.selectTime, 0, new Date(dayjs().startOf('day').format('YYYY-MM-DD HH:mm'))) |
| | | this.$set(this.selectTime, 1, new Date(dayjs().format('YYYY-MM-DD HH:mm'))) |
| | | }, |
| | | created () { |
| | | this.getOrganizationId() |
| | | |
| | | }, |
| | | methods: { |
| | | changeCascader (val) { |
| | | let nodesInfo = this.$refs['cascader'].getCheckedNodes() |
| | | let macList = nodesInfo.map(({ data: { mac } }) => mac) |
| | | this.formInline.macs = macList.filter(item => item !== undefined) |
| | | console.log(macList) |
| | | }, |
| | | changeDay () { |
| | | console.log('this.selectTime', this.selectTime) |
| | | if (this.selectTime !== null) { |
| | |
| | | console.log(this.macDate) |
| | | }, |
| | | handleSearch () { |
| | | this.getOnlineData() |
| | | console.log(' this.formInline', this.formInline) |
| | | if (this.formInline.organizationId !== '') { |
| | | if (this.formInline.macs.length > 0) { |
| | | if (this.time === '今天') { |
| | | console.log('今天今天') |
| | | this.formInline.startTime = dayjs().startOf('day').format('YYYY-MM-DD HH:mm') |
| | | this.formInline.endTime = dayjs().subtract(1, 'hour').format('YYYY-MM-DD HH:mm') |
| | | } |
| | | this.loading = true |
| | | this.getOnlineData() |
| | | this.$request({ |
| | | url: '/onlineRate/page', |
| | | method: 'post', |
| | |
| | | getOnlineData () { |
| | | this.$request({ |
| | | url: '/onlineRate/state', |
| | | method: 'get', |
| | | params: { |
| | | organizationId: this.formInline.organizationId |
| | | method: 'post', |
| | | data: { |
| | | macs: this.formInline.macs |
| | | } |
| | | }) |
| | | .then(res => { |
| | |
| | | }, |
| | | getOrganizationId () { |
| | | this.$request({ |
| | | url: '/organization/getOrganizationId', |
| | | url: '/organization/queryDevices', |
| | | method: 'get' |
| | | }) |
| | | .then(res => { |