设备节点增加筛选功能
This commit is contained in:
@@ -45,12 +45,31 @@
|
||||
:defaultFormData="defaultFormData" />
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 5px">
|
||||
<d2-crud ref="d2Crud" :columns="columns" :data="devicePointData" :rowHandle="rowHandle" add-title="新增"
|
||||
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">
|
||||
<el-button slot="header" style="margin-bottom: 5px" @click="addRow">新增</el-button>
|
||||
<d2-crud ref="d2Crud"
|
||||
:columns="columns"
|
||||
:data="devicePointTableData"
|
||||
:rowHandle="rowHandle"
|
||||
add-title="新增"
|
||||
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>
|
||||
</el-card>
|
||||
</el-main>
|
||||
@@ -126,7 +145,6 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
active: '',
|
||||
timing: null,
|
||||
columns: [
|
||||
{
|
||||
title: '序号',
|
||||
@@ -318,6 +336,8 @@ export default {
|
||||
{ required: true, message: '请输入采集周期(ms)', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
timing: null,
|
||||
nameSearchValue: '',
|
||||
serverData: {},
|
||||
devicePointData: [],
|
||||
nodeCodeData: [],
|
||||
@@ -340,6 +360,19 @@ export default {
|
||||
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: {
|
||||
addRow () {
|
||||
this.$refs.d2Crud.showDialog({
|
||||
|
||||
Reference in New Issue
Block a user