<template>
|
<a-spin :spinning='load'>
|
<a-card :bordered='false'>
|
<div class='table-page-search-wrapper'>
|
<a-form layout='inline' @keyup.enter.native='searchQuery'>
|
<a-row :gutter='24'>
|
<a-col :md='6' :sm='8'>
|
<a-form-item label='参数组编号'>
|
<a-input v-model='queryParam.code' placeholder='请输入参数组编号'></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col :md='6' :sm='8'>
|
<a-form-item label='参数组名称'>
|
<a-input v-model='queryParam.name' placeholder='请输入参数组名称'></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col :md='6' :sm='8'>
|
<span class='table-page-search-submitButtons' style='float: left;overflow: hidden;'>
|
<a-button icon='search' type='primary' @click='searchQuery'>查询</a-button>
|
<a-button icon='reload' style='margin-left: 8px' type='primary' @click='searchReset'>重置</a-button>
|
</span>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
<!-- 查询区域 -->
|
<div>
|
<a-table
|
ref='table'
|
:columns='columns'
|
:customRow='clickThenSelect'
|
:dataSource='dataSource'
|
:loading='loading'
|
:pagination='ipagination'
|
bordered
|
class='j-table-force-nowrap'
|
rowKey='id'
|
@change='handleTableChange'
|
>
|
</a-table>
|
</div>
|
</a-card>
|
</a-spin>
|
</template>
|
|
<script>
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import JDictSelectTag from '@/components/dict/JDictSelectTag'
|
import JInput from '@/components/jeecg/JInput'
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
import { getAction } from '@/api/manage'
|
|
export default {
|
name: 'ParameterGroup',
|
mixins: [JeecgListMixin],
|
components: {
|
JDictSelectTag,
|
JInput,
|
JEllipsis
|
},
|
data() {
|
return {
|
columns: [
|
{
|
title: '',
|
dataIndex: '',
|
key: 'rowIndex',
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '参数组编号',
|
align: 'center',
|
dataIndex: 'code'
|
},
|
{
|
title: '参数组名称',
|
align: 'center',
|
dataIndex: 'name'
|
},
|
{
|
title: '采集等级',
|
align: 'center',
|
dataIndex: 'collectionCycle',
|
customRender: function(t) {
|
if (t == 1000) {
|
return '一级'
|
} else if (t == 5000) {
|
return '二级'
|
} else if (t == 10000) {
|
return '三级'
|
}
|
return ''
|
}
|
},
|
{
|
title: '描述',
|
align: 'center',
|
dataIndex: 'remark',
|
customRender: function(text) {
|
return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
|
}
|
}
|
],
|
load: false,
|
url: {
|
list: '/parameter/group/list',
|
put: '/serve/deploy/collect/put',
|
deploy: '/serve/deploy/deploy/document',
|
delete: '/parameter/group/delete'
|
}
|
}
|
},
|
props: ['parameterGroupId', 'tree'],
|
watch: {
|
parameterGroupId: {
|
handler() {
|
this.loadData()
|
}
|
}
|
},
|
methods: {
|
// 查询终端列表
|
loadData(arg) {
|
//加载数据 若传入参数1则加载第一页的内容
|
if (arg === 1) {
|
this.ipagination.current = 1
|
}
|
this.onClearSelected()
|
var params = this.getQueryParams()//查询条件
|
params.equipmentId = this.parameterGroupId
|
this.loading = true
|
getAction(this.url.list, params).then((res) => {
|
if (res.success) {
|
this.dataSource = res.result.records
|
this.ipagination.total = res.result.total
|
}
|
if (res.code === 510) {
|
this.$message.warning(res.message)
|
}
|
this.loading = false
|
})
|
|
},
|
clickThenSelect(record) {
|
return {
|
on: {
|
click: () => {
|
this.onSelectChange(record.id.split(','), [record])
|
}
|
}
|
}
|
},
|
onSelectChange(selectedRowKeys) {
|
this.selectedRowKeys = selectedRowKeys
|
},
|
modalFormOk(val) {
|
// 调用父组件方法
|
this.$emit('tree')
|
// 新增/修改 成功时,重载列表
|
this.loadData()
|
this.selectedRowKeys = [val.id]
|
},
|
searchQuery() {
|
this.loadData()
|
this.onClearSelected()
|
},
|
searchReset() {
|
this.queryParam = {}
|
this.loadData()
|
this.onClearSelected()
|
},
|
handleEdit(record) {
|
this.$refs.modalForm.edit(record)
|
this.$refs.modalForm.title = '编辑'
|
this.$refs.modalForm.disableSubmit = false
|
}
|
}
|
}
|
</script>
|
<style>
|
</style>
|