删除设备节点的发送按钮&增加节点复制功能

This commit is contained in:
wu
2022-08-24 16:13:21 +08:00
parent 2a86558335
commit 231912e617

View File

@@ -48,8 +48,8 @@
<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"
@dialog-cancel="handleDialogCancel" @banding="bandingNodeTemplate" @cell-data-change="handleCellDataChange"
@form-data-change="handleFormDataChange">
@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>
</el-card>
@@ -207,19 +207,10 @@ export default {
return false
}
},
{
text: '发送',
size: 'mini',
show (index, row) {
if (row.showSendButton) {
return true
}
return false
}
},
{
text: '复制',
size: 'mini',
emit: 'cpoy',
show (index, row) {
if (row.showCopyButton) {
return true
@@ -625,6 +616,17 @@ export default {
this.$set(this.devicePointData[index], '@Binding', row.nodeCode)
done()
},
async copyDevicePoint ({ row }) {
this.$prompt('复制该点位前,请输入设备点位名称', '复制点位', {
confirmButtonText: '确定',
inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/,
inputErrorMessage: '请输入设备点位名称'
}).then(async ({ value }) => {
row.id = this.devicePointData.length + 1
row['@Name'] = value
this.devicePointData.push(row)
})
},
setDeviceConfigureConfirm () {
this.$confirm('是否要应用该配置信息,更改配置后需要重启改服务才能使配置生效?', '提示', {
confirmButtonText: '确定',