NEZ-938 feat:列表页面增加 duplicate按钮

This commit is contained in:
zhangyu
2021-08-26 14:51:38 +08:00
parent 952c563870
commit 7afc73effc
17 changed files with 80 additions and 9 deletions

View File

@@ -26,6 +26,7 @@
:table-data="tableData"
@del="del"
@edit="edit"
@copy="copy"
@orderBy="tableDataSort"
@reload="getTableData"
@selectionChange="selectionChange"
@@ -181,7 +182,7 @@ export default {
this.object = JSON.parse(JSON.stringify(this.blankObject))
this.rightBox.show = true
},
edit (u) {
edit (u, copyFlag) {
this.$get(`${this.url}/${u.id}`).then(response => {
if (response.code === 200) {
this.object = {
@@ -190,10 +191,22 @@ export default {
startAt: bus.UTCTimeToConfigTimezone(response.data.startAt),
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
}
})
},
copy (u) {
this.edit(u, true)
},
del (row) {
this.$confirm(this.$t('tip.confirmExpired'), {
confirmButtonText: this.$t('tip.yes'),