设备节点增加筛选功能
This commit is contained in:
@@ -45,12 +45,31 @@
|
|||||||
:defaultFormData="defaultFormData" />
|
:defaultFormData="defaultFormData" />
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="box-card" style="margin-top: 5px">
|
<el-card class="box-card" style="margin-top: 5px">
|
||||||
<d2-crud ref="d2Crud" :columns="columns" :data="devicePointData" :rowHandle="rowHandle" add-title="新增"
|
<d2-crud ref="d2Crud"
|
||||||
edit-title="绑定" :add-template="addTemplate" :add-rules="addRules" :form-options="formOptions"
|
:columns="columns"
|
||||||
@row-add="addDevicePoint" @row-edit="devicePointBandingNode" @row-remove="delDevicePoint"
|
:data="devicePointTableData"
|
||||||
@cpoy='copyDevicePoint' @dialog-cancel="handleDialogCancel" @banding="bandingNodeTemplate"
|
:rowHandle="rowHandle"
|
||||||
@cell-data-change="handleCellDataChange" @form-data-change="handleFormDataChange">
|
add-title="新增"
|
||||||
<el-button slot="header" style="margin-bottom: 5px" @click="addRow">新增</el-button>
|
edit-title="绑定"
|
||||||
|
:add-template="addTemplate"
|
||||||
|
:add-rules="addRules"
|
||||||
|
:form-options="formOptions"
|
||||||
|
@row-add="addDevicePoint"
|
||||||
|
@row-edit="devicePointBandingNode"
|
||||||
|
@row-remove="delDevicePoint"
|
||||||
|
@cpoy='copyDevicePoint'
|
||||||
|
@dialog-cancel="handleDialogCancel"
|
||||||
|
@banding="bandingNodeTemplate"
|
||||||
|
@cell-data-change="handleCellDataChange"
|
||||||
|
@form-data-change="handleFormDataChange"
|
||||||
|
>
|
||||||
|
<div slot="header">
|
||||||
|
<el-button style="margin-bottom: 5px" @click="addRow">新增</el-button>
|
||||||
|
<span class="demo-form-inline" style="margin-left:15px;">
|
||||||
|
筛选:<el-input placeholder="请输入筛选内容" v-model="nameSearchValue" style="width:300px" class="input-with-select"></el-input>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
</d2-crud>
|
</d2-crud>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-main>
|
</el-main>
|
||||||
@@ -126,7 +145,6 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
active: '',
|
active: '',
|
||||||
timing: null,
|
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
@@ -318,6 +336,8 @@ export default {
|
|||||||
{ required: true, message: '请输入采集周期(ms)', trigger: 'blur' }
|
{ required: true, message: '请输入采集周期(ms)', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
timing: null,
|
||||||
|
nameSearchValue: '',
|
||||||
serverData: {},
|
serverData: {},
|
||||||
devicePointData: [],
|
devicePointData: [],
|
||||||
nodeCodeData: [],
|
nodeCodeData: [],
|
||||||
@@ -340,6 +360,19 @@ export default {
|
|||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
devicePointTableData () {
|
||||||
|
if (this.nameSearchValue) {
|
||||||
|
return this.devicePointData.filter((item) => {
|
||||||
|
if (item['@Name'].search(this.nameSearchValue) > -1) {
|
||||||
|
return item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return this.devicePointData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addRow () {
|
addRow () {
|
||||||
this.$refs.d2Crud.showDialog({
|
this.$refs.d2Crud.showDialog({
|
||||||
|
|||||||
Reference in New Issue
Block a user