<template>
    <i-form :model="msgNotificationProperty">
        <collapse v-model="collapseValue">
            <panel name="MsgNotificationProp">
                组件设置
                <div slot="content">
                    <form-item label="标题" :label-width="45">
                        <i-input v-model="msgNotificationProperty.NotificationTitle"></i-input>
                    </form-item>
                </div>
            </panel>
        </collapse>
    </i-form>
</template>


<script>
    import {mapMutations} from "vuex";

    export default {
        props: ["itemId"],

        data: () => ({
            collapseValue: ["MsgNotificationProp"]
        }),
        created() {
        },
        computed: {
            msgNotificationProperty() {
                let id = this.itemId,
                    weather = this.$store.getters.getMsgNotification(id);
                if (!weather || weather.length === 0) {
                    this.initMsgNotificationById(id);
                }
                let msgNotificationProperty = this.$store.getters.getNodeProp(id);
                if (!msgNotificationProperty || msgNotificationProperty.length === 0) {
                    let newMsgNotificationProperty = this.$store.getters.getMsgNotification(id).MsgNotificationProperty;
                    this.setNodeProp({id: id, MsgNotificationProperty: newMsgNotificationProperty});
                }
                return  this.$store.getters.getNodeProp(id).MsgNotificationProperty;
            }
        },
        methods: {
            ...mapMutations(["initMsgNotificationById", "setNodeProp"])
        },
        components: {}
    };
</script>