This commit is contained in:
@@ -12,12 +12,16 @@
|
|||||||
<v-container>
|
<v-container>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-text-field :label="$ay.t('Find')" required></v-text-field>
|
<v-text-field
|
||||||
|
v-model="find"
|
||||||
|
:label="$ay.t('Find')"
|
||||||
|
required
|
||||||
|
></v-text-field>
|
||||||
</v-col>
|
</v-col>
|
||||||
bind find and replace to fields so is sticky
|
|
||||||
add OK button bound method to do the replace
|
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
|
v-model="replace"
|
||||||
:label="$ay.t('Replace')"
|
:label="$ay.t('Replace')"
|
||||||
required
|
required
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
@@ -30,7 +34,7 @@
|
|||||||
<v-btn color="blue darken-1" text @click="replaceDialog = false">{{
|
<v-btn color="blue darken-1" text @click="replaceDialog = false">{{
|
||||||
$ay.t("Cancel")
|
$ay.t("Cancel")
|
||||||
}}</v-btn>
|
}}</v-btn>
|
||||||
<v-btn color="blue darken-1" text @click="replaceDialog = false">{{
|
<v-btn color="blue darken-1" text @click="doReplace()">{{
|
||||||
$ay.t("OK")
|
$ay.t("OK")
|
||||||
}}</v-btn>
|
}}</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
@@ -205,6 +209,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY,
|
||||||
search: "",
|
search: "",
|
||||||
|
find: "",
|
||||||
|
replace: "",
|
||||||
replaceDialog: false,
|
replaceDialog: false,
|
||||||
editingActiveTranslation: false,
|
editingActiveTranslation: false,
|
||||||
obj: {},
|
obj: {},
|
||||||
@@ -261,20 +267,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
doReplace() {
|
||||||
|
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++) {
|
||||||
|
this.obj.translationItems[i].display = this.obj.translationItems[
|
||||||
|
i
|
||||||
|
].display
|
||||||
|
.split(this.find)
|
||||||
|
.join(this.replace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.replaceDialog = false;
|
||||||
|
},
|
||||||
saveItem(updatedItem) {
|
saveItem(updatedItem) {
|
||||||
// if (!updatedItem.display) {
|
|
||||||
// console.log("display empty setting to key");
|
|
||||||
// updatedItem.display = updatedItem.key;
|
|
||||||
// for (let i = 0; i < this.obj.translationItems.length; i++) {
|
|
||||||
// if (this.obj.translationItems[i].key == updatedItem.key) {
|
|
||||||
// this.obj.translationItems[i].display = this.obj.translationItems[
|
|
||||||
// i
|
|
||||||
// ].key;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
//just called to flag as dirty
|
//just called to flag as dirty
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: this,
|
vm: this,
|
||||||
|
|||||||
Reference in New Issue
Block a user