|
|
@ -6,21 +6,33 @@
|
|
|
|
class="WM-Margin-T-20"
|
|
|
|
class="WM-Margin-T-20"
|
|
|
|
:TitleFa="getDialogProperties.title || defaultMessage[type].title"
|
|
|
|
:TitleFa="getDialogProperties.title || defaultMessage[type].title"
|
|
|
|
:TitleEn="getDialogProperties.titleEn || defaultMessage[type].titleEn"
|
|
|
|
:TitleEn="getDialogProperties.titleEn || defaultMessage[type].titleEn"
|
|
|
|
:Color="getDialogProperties.color || defaultMessage[type].color"
|
|
|
|
:color="getDialogProperties.color || defaultMessage[type].color"
|
|
|
|
></WM-PartTitle>
|
|
|
|
></WM-PartTitle>
|
|
|
|
</v-card-title>
|
|
|
|
</v-card-title>
|
|
|
|
<v-card-text>
|
|
|
|
<v-card-text>
|
|
|
|
<div class="WM-Align-R WM-Margin-T-10">{{ getDialogProperties.message || defaultMessage[type].message }}</div>
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="WM-Align-R WM-Margin-T-10"
|
|
|
|
|
|
|
|
>{{ getDialogProperties.message || defaultMessage[type].message }}</div>
|
|
|
|
</v-card-text>
|
|
|
|
</v-card-text>
|
|
|
|
|
|
|
|
|
|
|
|
<v-divider></v-divider>
|
|
|
|
<v-divider></v-divider>
|
|
|
|
<v-card-actions>
|
|
|
|
<v-card-actions>
|
|
|
|
<v-spacer></v-spacer>
|
|
|
|
<v-spacer></v-spacer>
|
|
|
|
<v-btn :color="getDialogProperties.cancelButtonColor || defaultMessage[type].cancelButtonColor" @click="cancel" depressed dark>
|
|
|
|
<v-btn
|
|
|
|
|
|
|
|
:color="getDialogProperties.cancelButtonColor || defaultMessage[type].cancelButtonColor"
|
|
|
|
|
|
|
|
@click="cancel"
|
|
|
|
|
|
|
|
depressed
|
|
|
|
|
|
|
|
dark
|
|
|
|
|
|
|
|
>
|
|
|
|
<v-icon dark right>fas fa-times</v-icon>
|
|
|
|
<v-icon dark right>fas fa-times</v-icon>
|
|
|
|
{{getDialogProperties.cancelButtonText || defaultMessage[type].cancelButtonText}}
|
|
|
|
{{getDialogProperties.cancelButtonText || defaultMessage[type].cancelButtonText}}
|
|
|
|
</v-btn>
|
|
|
|
</v-btn>
|
|
|
|
<v-btn :color="getDialogProperties.confirmButtonColor || defaultMessage[type].confirmButtonColor" depressed dark @click="confirm">
|
|
|
|
<v-btn
|
|
|
|
|
|
|
|
:color="getDialogProperties.confirmButtonColor || defaultMessage[type].confirmButtonColor"
|
|
|
|
|
|
|
|
depressed
|
|
|
|
|
|
|
|
dark
|
|
|
|
|
|
|
|
@click="confirm"
|
|
|
|
|
|
|
|
>
|
|
|
|
<v-icon dark right>fas fa-trash-alt</v-icon>
|
|
|
|
<v-icon dark right>fas fa-trash-alt</v-icon>
|
|
|
|
{{getDialogProperties.confirmButtonText || defaultMessage[type].confirmButtonText}}
|
|
|
|
{{getDialogProperties.confirmButtonText || defaultMessage[type].confirmButtonText}}
|
|
|
|
</v-btn>
|
|
|
|
</v-btn>
|
|
|
@ -30,7 +42,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { mapActions, mapGetters } from 'vuex';
|
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data: () => ({
|
|
|
|
data: () => ({
|
|
|
|
defaultMessage: {
|
|
|
|
defaultMessage: {
|
|
|
@ -50,9 +62,9 @@ export default {
|
|
|
|
confirmButtonText: "حذف",
|
|
|
|
confirmButtonText: "حذف",
|
|
|
|
cancelButtonColor: "cyan",
|
|
|
|
cancelButtonColor: "cyan",
|
|
|
|
confirmButtonColor: "red"
|
|
|
|
confirmButtonColor: "red"
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
type: "delete"
|
|
|
|
type: 'delete'
|
|
|
|
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
getDialogType(type) {
|
|
|
|
getDialogType(type) {
|
|
|
@ -64,7 +76,11 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
...mapGetters('modal', ['getDialogType', 'getDialogProperties', 'isModal']),
|
|
|
|
...mapGetters("modal", [
|
|
|
|
|
|
|
|
"getDialogType",
|
|
|
|
|
|
|
|
"getDialogProperties",
|
|
|
|
|
|
|
|
"isModal"
|
|
|
|
|
|
|
|
]),
|
|
|
|
modal: {
|
|
|
|
modal: {
|
|
|
|
get() {
|
|
|
|
get() {
|
|
|
|
return this.isModal("modal/dialog");
|
|
|
|
return this.isModal("modal/dialog");
|
|
|
@ -80,17 +96,16 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
async confirm() {
|
|
|
|
async confirm() {
|
|
|
|
|
|
|
|
if (typeof this.getDialogProperties.success == "function") {
|
|
|
|
if(typeof this.getDialogProperties.success == 'function') {
|
|
|
|
|
|
|
|
await this.getDialogProperties.success();
|
|
|
|
await this.getDialogProperties.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.$_closeModal('modal/dialog');
|
|
|
|
this.$_closeModal("modal/dialog");
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async cancel() {
|
|
|
|
async cancel() {
|
|
|
|
if(typeof this.getDialogProperties.close == 'function') {
|
|
|
|
if (typeof this.getDialogProperties.close == "function") {
|
|
|
|
await this.getDialogProperties.close();
|
|
|
|
await this.getDialogProperties.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.$_closeModal('modal/dialog');
|
|
|
|
this.$_closeModal("modal/dialog");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|