This commit is contained in:
2020-06-25 13:02:31 +00:00
parent 6840586e76
commit e4836a7396

View File

@@ -268,16 +268,28 @@ export default {
},
methods: {
doReplace() {
let changesMade = false;
if (this.find && this.replace) {
// alert(`stub: find ${this.find} and replace ${this.replace}`);
//str.split(searchStr).join(replaceStr)
for (let i = 0; i < this.obj.translationItems.length; i++) {
if (
!changesMade &&
this.obj.translationItems[i].display.includes(this.find)
) {
changesMade = true;
}
this.obj.translationItems[i].display = this.obj.translationItems[
i
].display
.split(this.find)
.join(this.replace);
}
if (changesMade == true) {
window.$gz.form.setFormState({
vm: this,
dirty: true
});
}
}
this.replaceDialog = false;
},