删除设备节点的发送按钮&增加节点复制功能
This commit is contained in:
@@ -48,8 +48,8 @@
|
|||||||
<d2-crud ref="d2Crud" :columns="columns" :data="devicePointData" :rowHandle="rowHandle" add-title="新增"
|
<d2-crud ref="d2Crud" :columns="columns" :data="devicePointData" :rowHandle="rowHandle" add-title="新增"
|
||||||
edit-title="绑定" :add-template="addTemplate" :add-rules="addRules" :form-options="formOptions"
|
edit-title="绑定" :add-template="addTemplate" :add-rules="addRules" :form-options="formOptions"
|
||||||
@row-add="addDevicePoint" @row-edit="devicePointBandingNode" @row-remove="delDevicePoint"
|
@row-add="addDevicePoint" @row-edit="devicePointBandingNode" @row-remove="delDevicePoint"
|
||||||
@dialog-cancel="handleDialogCancel" @banding="bandingNodeTemplate" @cell-data-change="handleCellDataChange"
|
@cpoy='copyDevicePoint' @dialog-cancel="handleDialogCancel" @banding="bandingNodeTemplate"
|
||||||
@form-data-change="handleFormDataChange">
|
@cell-data-change="handleCellDataChange" @form-data-change="handleFormDataChange">
|
||||||
<el-button slot="header" style="margin-bottom: 5px" @click="addRow">新增</el-button>
|
<el-button slot="header" style="margin-bottom: 5px" @click="addRow">新增</el-button>
|
||||||
</d2-crud>
|
</d2-crud>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -207,19 +207,10 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
text: '发送',
|
|
||||||
size: 'mini',
|
|
||||||
show (index, row) {
|
|
||||||
if (row.showSendButton) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
text: '复制',
|
text: '复制',
|
||||||
size: 'mini',
|
size: 'mini',
|
||||||
|
emit: 'cpoy',
|
||||||
show (index, row) {
|
show (index, row) {
|
||||||
if (row.showCopyButton) {
|
if (row.showCopyButton) {
|
||||||
return true
|
return true
|
||||||
@@ -625,6 +616,17 @@ export default {
|
|||||||
this.$set(this.devicePointData[index], '@Binding', row.nodeCode)
|
this.$set(this.devicePointData[index], '@Binding', row.nodeCode)
|
||||||
done()
|
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 () {
|
setDeviceConfigureConfirm () {
|
||||||
this.$confirm('是否要应用该配置信息,更改配置后需要重启改服务才能使配置生效?', '提示', {
|
this.$confirm('是否要应用该配置信息,更改配置后需要重启改服务才能使配置生效?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
|
|||||||
Reference in New Issue
Block a user