This commit is contained in:
@@ -268,16 +268,28 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doReplace() {
|
doReplace() {
|
||||||
|
let changesMade = false;
|
||||||
if (this.find && this.replace) {
|
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++) {
|
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[
|
this.obj.translationItems[i].display = this.obj.translationItems[
|
||||||
i
|
i
|
||||||
].display
|
].display
|
||||||
.split(this.find)
|
.split(this.find)
|
||||||
.join(this.replace);
|
.join(this.replace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changesMade == true) {
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: this,
|
||||||
|
dirty: true
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.replaceDialog = false;
|
this.replaceDialog = false;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user