<template>
  <div id="app">
    <router-view />
    <theme-picker />
    <div class="onlyoffice">
      <div id="placeholder"></div>
    </div>
  </div>
</template>

<script>
import ThemePicker from "@/components/ThemePicker";

export default {
  name: "App",
  components: { ThemePicker },
  data() {
    return {
      config: {},
      flag: false
    }
  },
  mounted() {
    console.log("app.vue");
    this.config = {
      "editorConfig": {
        "mode": "edit",
        "customization": {
          "feedback": {
            "visible": false
          },
          "help": false,
          "goback": {
            "blank": false
          },
          "macros": false,
          "autosave": false,
          "comments": false,
          "review": {},
          "hideRightMenu": true,
          "anonymous": {
            "request": false
          },
          "forcesave": true,
          "logo": {},
          "hideNotes": true
        },
        "plugins": {
          "pluginsData": [],
          "autostart": []
        },
        "callbackUrl": "http://121.40.189.20:9090/onlyOffice/save",
        "lang": "zh-CN",
        "user": {
          "name": "OnlyOfficeUserName1",
          "id": "1"
        }
      },
      "docServiceApiUrl": "http://121.40.189.20:8899/web-apps/apps/api/documents/api.js",
      "documentType": "word",
      "document": {
        "permissions": {
          "edit": false,
          "chat": false,
          "review": false
        },
        "title": "调解申请书模板.docx",
        "fileType": "docx",
        "key": "6ae50056ac5e4e3ba09be430d444699c",
        "url": "http://121.40.189.20:9090/download/6ae50056ac5e4e3ba09be430d444699c",
        "info": {
          "sharingSettings": [
            {
              "isLink": true,
              "permissions": [
                "Full Access"
              ],
              "user": "OnlyOfficeUserName1"
            }
          ],
          "created": "2024-03-13 09:46:41"
        }
      },
      "type": "desktop"
    }
    var docEditor = new DocsAPI.DocEditor("placeholder", this.config);
  },
  metaInfo() {
    return {
      title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
      titleTemplate: title => {
        return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
      }
    }
  }
};
</script>
<style scoped>
#app .theme-picker {
  display: none;
}

.onlyoffice {
  width: 0;
  height: 0;
}
</style>
