NEZ-938 feat:列表页面增加 duplicate按钮
This commit is contained in:
@@ -138,6 +138,7 @@ const cn = {
|
|||||||
assetSubTab: '子级 asset',
|
assetSubTab: '子级 asset',
|
||||||
moreOption: '更多选项',
|
moreOption: '更多选项',
|
||||||
copy: '复制',
|
copy: '复制',
|
||||||
|
duplicate: '复制',
|
||||||
silence: '静默',
|
silence: '静默',
|
||||||
labels: '标签',
|
labels: '标签',
|
||||||
editType: '类型',
|
editType: '类型',
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ const en = {
|
|||||||
labels: 'Label',
|
labels: 'Label',
|
||||||
moreOption: 'More option',
|
moreOption: 'More option',
|
||||||
copy: 'Copy',
|
copy: 'Copy',
|
||||||
|
duplicate: 'Duplicate',
|
||||||
silence: 'Silence',
|
silence: 'Silence',
|
||||||
editType: 'Type',
|
editType: 'Type',
|
||||||
searchCondition: 'Search condition',
|
searchCondition: 'Search condition',
|
||||||
|
|||||||
@@ -147,7 +147,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
copy (u) {
|
copy (u) {
|
||||||
this.object = { ...u, name: 'Copy from ' + u.name, id: '' }
|
this.object = { ...u, name: u.name + '-copy', id: '' }
|
||||||
|
if (this.object.name.length > 64) {
|
||||||
|
const length = this.object.name.length - 64
|
||||||
|
console.log(length, this.object.name.length, u.name.length)
|
||||||
|
this.object.name = u.name.substring(0, u.name.length - length) + '-copy'
|
||||||
|
}
|
||||||
this.rightBox.show = true
|
this.rightBox.show = true
|
||||||
},
|
},
|
||||||
esc () {
|
esc () {
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ export default {
|
|||||||
handler (n, o) {
|
handler (n, o) {
|
||||||
this.isEdit = true
|
this.isEdit = true
|
||||||
this.editAlertRule = JSON.parse(JSON.stringify(n))
|
this.editAlertRule = JSON.parse(JSON.stringify(n))
|
||||||
if (this.editAlertRule.id) {
|
if (this.editAlertRule.id || this.editAlertRule.name) {
|
||||||
this.expressions = [this.editAlertRule.expr]
|
this.expressions = [this.editAlertRule.expr]
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.expressions.forEach((ex, index) => {
|
this.expressions.forEach((ex, index) => {
|
||||||
|
|||||||
@@ -72,6 +72,7 @@
|
|||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item v-has="'alertRule_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'alertRule_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'alertRule_delete'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'alertRule_delete'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||||
|
<el-dropdown-item v-has="'alertRule_edit'" :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'alertRule']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'alertRule']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<!-- <el-dropdown-item :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>-->
|
<!-- <el-dropdown-item :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>-->
|
||||||
|
<el-dropdown-item v-has="'alertSilence_edit'" :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'alertSilence_expire'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('buttons.delete')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'alertSilence_expire'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('buttons.delete')}}</span></el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item v-has="'panel_chart_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'panel_chart_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'panel_chart_delete'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'panel_chart_delete'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||||
|
<el-dropdown-item v-has="'panel_chart_edit'" :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'panel_chart_edit'" :command="['sync', scope.row]"><i class="nz-icon nz-icon-sync"></i><span class="operation-dropdown-text">{{$t('overall.syncChart')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'panel_chart_edit'" :command="['sync', scope.row]"><i class="nz-icon nz-icon-sync"></i><span class="operation-dropdown-text">{{$t('overall.syncChart')}}</span></el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|||||||
@@ -178,6 +178,7 @@
|
|||||||
<!-- <el-dropdown-item v-if="!endpointTab" :command="['endpointQuery', scope.row]"><i class="nz-icon nz-icon-search"></i><span class="operation-dropdown-text">{{$t('overall.query')}}</span></el-dropdown-item>-->
|
<!-- <el-dropdown-item v-if="!endpointTab" :command="['endpointQuery', scope.row]"><i class="nz-icon nz-icon-search"></i><span class="operation-dropdown-text">{{$t('overall.query')}}</span></el-dropdown-item>-->
|
||||||
<el-dropdown-item v-if="!endpointTab" v-has="'monitor_endpoint_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
<el-dropdown-item v-if="!endpointTab" v-has="'monitor_endpoint_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'monitor_endpoint_delete'" :command="['delete', scope.row, `sys/endpoint?ids=${scope.row.id}`]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'monitor_endpoint_delete'" :command="['delete', scope.row, `sys/endpoint?ids=${scope.row.id}`]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||||
|
<el-dropdown-item v-has="'monitor_endpoint_edit'" :command="['copy', scope.row, 'project']"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'endpoint']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'endpoint']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
<i class="nz-icon nz-icon-more3"></i>
|
<i class="nz-icon nz-icon-more3"></i>
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item v-has="'expressionTemplate_add'" :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.copy')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'expressionTemplate_add'" :command="['copy', scope.row]"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'expressionTemplate_delete'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'expressionTemplate_delete'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item v-has="'monitor_module_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'monitor_module_edit'" :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'monitor_module_delete'" :command="['delete', scope.row, `sys/user?ids=${scope.row.id}`]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'monitor_module_delete'" :command="['delete', scope.row, `sys/user?ids=${scope.row.id}`]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||||
|
<el-dropdown-item v-has="'monitor_module_edit'" :command="['copy', scope.row, 'module']"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'panel_chart_edit'" :command="['sync', scope.row]"><i class="nz-icon nz-icon-sync"></i><span class="operation-dropdown-text">{{$t('overall.syncChart')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'panel_chart_edit'" :command="['sync', scope.row]"><i class="nz-icon nz-icon-sync"></i><span class="operation-dropdown-text">{{$t('overall.syncChart')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'module']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'module']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item :command="['edit', scope.row]" v-has="'project_edit'"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
<el-dropdown-item :command="['edit', scope.row]" v-has="'project_edit'"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item :command="['delete', scope.row, `sys/user?ids=${scope.row.id}`]" v-has="'project_delete'"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
<el-dropdown-item :command="['delete', scope.row, `sys/user?ids=${scope.row.id}`]" v-has="'project_delete'"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
|
||||||
|
<el-dropdown-item v-has="'project_edit'" :command="['copy', scope.row, 'project']"><i class="nz-icon nz-icon-override"></i><span class="operation-dropdown-text">{{$t('overall.duplicate')}}</span></el-dropdown-item>
|
||||||
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'project']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
|
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'project']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
:table-data="tableData"
|
:table-data="tableData"
|
||||||
@del="del"
|
@del="del"
|
||||||
@edit="edit"
|
@edit="edit"
|
||||||
|
@copy="copy"
|
||||||
@orderBy="tableDataSort"
|
@orderBy="tableDataSort"
|
||||||
@queryMessage="queryMessage"
|
@queryMessage="queryMessage"
|
||||||
@reload="getTableData"
|
@reload="getTableData"
|
||||||
@@ -178,7 +179,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
edit (u) {
|
edit (u, copyFlag) {
|
||||||
this.$get(`${this.url}/${u.id}`).then(response => {
|
this.$get(`${this.url}/${u.id}`).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.object = {
|
this.object = {
|
||||||
@@ -186,9 +187,21 @@ export default {
|
|||||||
method: response.data.method ? response.data.method.split(',').map(item => Number(item)) : [],
|
method: response.data.method ? response.data.method.split(',').map(item => Number(item)) : [],
|
||||||
receiverShow: response.data.receiver ? response.data.receiver.split(',').map(item => Number(item)) : []
|
receiverShow: response.data.receiver ? response.data.receiver.split(',').map(item => Number(item)) : []
|
||||||
}
|
}
|
||||||
|
if (copyFlag) {
|
||||||
|
this.object.id = ''
|
||||||
|
this.object.name = this.object.name + '-copy'
|
||||||
|
if (this.object.name.length > 64) {
|
||||||
|
const length = this.object.name.length - 64
|
||||||
|
console.log(length, this.object.name.length, u.name.length)
|
||||||
|
this.object.name = u.name.substring(0, u.name.length - length) + '-copy'
|
||||||
|
}
|
||||||
|
}
|
||||||
this.rightBox.show = true
|
this.rightBox.show = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
copy (u) {
|
||||||
|
this.edit(u, true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
:table-data="tableData"
|
:table-data="tableData"
|
||||||
@del="del"
|
@del="del"
|
||||||
@edit="edit"
|
@edit="edit"
|
||||||
|
@copy="copy"
|
||||||
@orderBy="tableDataSort"
|
@orderBy="tableDataSort"
|
||||||
@reload="getTableData"
|
@reload="getTableData"
|
||||||
@selectionChange="selectionChange"
|
@selectionChange="selectionChange"
|
||||||
@@ -181,7 +182,7 @@ export default {
|
|||||||
this.object = JSON.parse(JSON.stringify(this.blankObject))
|
this.object = JSON.parse(JSON.stringify(this.blankObject))
|
||||||
this.rightBox.show = true
|
this.rightBox.show = true
|
||||||
},
|
},
|
||||||
edit (u) {
|
edit (u, copyFlag) {
|
||||||
this.$get(`${this.url}/${u.id}`).then(response => {
|
this.$get(`${this.url}/${u.id}`).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.object = {
|
this.object = {
|
||||||
@@ -190,10 +191,22 @@ export default {
|
|||||||
startAt: bus.UTCTimeToConfigTimezone(response.data.startAt),
|
startAt: bus.UTCTimeToConfigTimezone(response.data.startAt),
|
||||||
endAt: bus.UTCTimeToConfigTimezone(response.data.endAt)
|
endAt: bus.UTCTimeToConfigTimezone(response.data.endAt)
|
||||||
}
|
}
|
||||||
|
if (copyFlag) {
|
||||||
|
this.object.id = ''
|
||||||
|
this.object.name = this.object.name + '-copy'
|
||||||
|
if (this.object.name.length > 64) {
|
||||||
|
const length = this.object.name.length - 64
|
||||||
|
console.log(length, this.object.name.length, u.name.length)
|
||||||
|
this.object.name = u.name.substring(0, u.name.length - length) + '-copy'
|
||||||
|
}
|
||||||
|
}
|
||||||
this.rightBox.show = true
|
this.rightBox.show = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
copy (u) {
|
||||||
|
this.edit(u, true)
|
||||||
|
},
|
||||||
del (row) {
|
del (row) {
|
||||||
this.$confirm(this.$t('tip.confirmExpired'), {
|
this.$confirm(this.$t('tip.confirmExpired'), {
|
||||||
confirmButtonText: this.$t('tip.yes'),
|
confirmButtonText: this.$t('tip.yes'),
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
:table-data="tableData"
|
:table-data="tableData"
|
||||||
@del="del"
|
@del="del"
|
||||||
@edit="edit"
|
@edit="edit"
|
||||||
@copy="(row) => {copyRow(row, 'exprTmpl')}"
|
@copy="copy"
|
||||||
@orderBy="tableDataSort"
|
@orderBy="tableDataSort"
|
||||||
@reload="getTableData"
|
@reload="getTableData"
|
||||||
@sync="chartBySync"
|
@sync="chartBySync"
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
:tableId="tableId"
|
:tableId="tableId"
|
||||||
@del="del"
|
@del="del"
|
||||||
@edit="edit"
|
@edit="edit"
|
||||||
|
@copy="copy"
|
||||||
@orderBy="tableDataSort"
|
@orderBy="tableDataSort"
|
||||||
@reload="getTableData"
|
@reload="getTableData"
|
||||||
@addSilence="addSilence"
|
@addSilence="addSilence"
|
||||||
@@ -317,9 +318,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
edit (row) {
|
edit (row, copyFlag) {
|
||||||
this.$get('monitor/endpoint/' + row.id).then(res => {
|
this.$get('monitor/endpoint/' + row.id).then(res => {
|
||||||
this.object = JSON.parse(JSON.stringify(res.data))
|
this.object = JSON.parse(JSON.stringify(res.data))
|
||||||
|
if (copyFlag) {
|
||||||
|
this.object.id = ''
|
||||||
|
this.object.name = this.object.name + '-copy'
|
||||||
|
if (this.object.name.length > 64) {
|
||||||
|
const length = this.object.name.length - 64
|
||||||
|
console.log(length, this.object.name.length, row.name.length)
|
||||||
|
this.object.name = row.name.substring(0, row.name.length - length) + '-copy'
|
||||||
|
}
|
||||||
|
}
|
||||||
this.object.configs.forEach(item => {
|
this.object.configs.forEach(item => {
|
||||||
item.config = JSON.parse(item.config)
|
item.config = JSON.parse(item.config)
|
||||||
})
|
})
|
||||||
@@ -393,12 +403,20 @@ export default {
|
|||||||
this.object.paramObj.push({ key: '', value: [] })
|
this.object.paramObj.push({ key: '', value: [] })
|
||||||
}
|
}
|
||||||
this.object.assetName = this.object.asset ? this.object.asset.name : ''
|
this.object.assetName = this.object.asset ? this.object.asset.name : ''
|
||||||
|
this.object.assetId = this.object.asset ? this.object.asset.id + '' : ''
|
||||||
this.object.projectId = this.object.project.id
|
this.object.projectId = this.object.project.id
|
||||||
this.object.moduleId = this.object.module.id
|
this.object.moduleId = this.object.module.id
|
||||||
this.object.type = this.object.module.type
|
this.object.type = this.object.module.type
|
||||||
this.rightBox.editShow = true
|
if (copyFlag) {
|
||||||
|
this.rightBox.show = true
|
||||||
|
} else {
|
||||||
|
this.rightBox.editShow = true
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
copy (u) {
|
||||||
|
this.edit(u, true)
|
||||||
|
},
|
||||||
closeRightEditBox (refresh) {
|
closeRightEditBox (refresh) {
|
||||||
this.rightBox.editShow = false
|
this.rightBox.editShow = false
|
||||||
this.rightBox.show = false
|
this.rightBox.show = false
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
:table-data="tableData"
|
:table-data="tableData"
|
||||||
@del="del"
|
@del="del"
|
||||||
@edit="edit"
|
@edit="edit"
|
||||||
|
@copy="copy"
|
||||||
@orderBy="tableDataSort"
|
@orderBy="tableDataSort"
|
||||||
@reload="getTableData"
|
@reload="getTableData"
|
||||||
@sync="chartBySync"
|
@sync="chartBySync"
|
||||||
@@ -200,11 +201,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
edit (row) {
|
edit (row, copyFlag) {
|
||||||
this.$get('monitor/module/' + row.id).then(res => {
|
this.$get('monitor/module/' + row.id).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.object = JSON.parse(JSON.stringify(res.data))
|
this.object = JSON.parse(JSON.stringify(res.data))
|
||||||
this.object.configs = JSON.parse(this.object.configs)
|
this.object.configs = JSON.parse(this.object.configs)
|
||||||
|
if (copyFlag) {
|
||||||
|
this.object.id = ''
|
||||||
|
this.object.name = this.object.name + '-copy'
|
||||||
|
if (this.object.name.length > 64) {
|
||||||
|
const length = this.object.name.length - 64
|
||||||
|
console.log(length, this.object.name.length, row.name.length)
|
||||||
|
this.object.name = row.name.substring(0, row.name.length - length) + '-copy'
|
||||||
|
}
|
||||||
|
}
|
||||||
// this.object.configs.walk = this.object.configs.walk ? JSON.parse(JSON.stringify(this.object.configs.walk)) : []
|
// this.object.configs.walk = this.object.configs.walk ? JSON.parse(JSON.stringify(this.object.configs.walk)) : []
|
||||||
// this.object.port = this.object.configs.port ? JSON.parse(JSON.stringify(this.object.configs.port)) : ''
|
// this.object.port = this.object.configs.port ? JSON.parse(JSON.stringify(this.object.configs.port)) : ''
|
||||||
this.object.paramObj = []
|
this.object.paramObj = []
|
||||||
@@ -285,6 +295,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
copy (u) {
|
||||||
|
this.edit(u, true)
|
||||||
|
},
|
||||||
getTableData () {
|
getTableData () {
|
||||||
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
|
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
|
||||||
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
|
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
style="padding-right: 0"
|
style="padding-right: 0"
|
||||||
@del="del"
|
@del="del"
|
||||||
@edit="edit"
|
@edit="edit"
|
||||||
|
@copy = 'copy'
|
||||||
@orderBy="tableDataSort"
|
@orderBy="tableDataSort"
|
||||||
@reload="getTableData"
|
@reload="getTableData"
|
||||||
@addSilence="addSilence"
|
@addSilence="addSilence"
|
||||||
|
|||||||
Reference in New Issue
Block a user