{"remainingRequest":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/components/RightPanel/index.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/components/RightPanel/index.vue","mtime":1701742078544},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n// +----------------------------------------------------------------------\n// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]\n// +----------------------------------------------------------------------\n// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.\n// +----------------------------------------------------------------------\n// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权\n// +----------------------------------------------------------------------\n// | Author: CRMEB Team <admin@crmeb.com>\n// +----------------------------------------------------------------------\n\nimport { addClass, removeClass } from '@/utils';\n\nexport default {\n  name: 'RightPanel',\n  props: {\n    clickNotClose: {\n      default: false,\n      type: Boolean,\n    },\n    buttonTop: {\n      default: 250,\n      type: Number,\n    },\n  },\n  computed: {\n    show: {\n      get() {\n        return this.$store.state.settings.showSettings;\n      },\n      set(val) {\n        this.$store.dispatch('settings/changeSetting', {\n          key: 'showSettings',\n          value: val,\n        });\n      },\n    },\n    theme() {\n      return this.$store.state.settings.theme;\n    },\n  },\n  watch: {\n    show(value) {\n      if (value && !this.clickNotClose) {\n        this.addEventClick();\n      }\n      if (value) {\n        addClass(document.body, 'showRightPanel');\n      } else {\n        removeClass(document.body, 'showRightPanel');\n      }\n    },\n  },\n  mounted() {\n    this.insertToBody();\n    this.addEventClick();\n  },\n  beforeDestroy() {\n    const elx = this.$refs.rightPanel;\n    elx.remove();\n  },\n  methods: {\n    addEventClick() {\n      window.addEventListener('click', this.closeSidebar);\n    },\n    closeSidebar(evt) {\n      const parent = evt.target.closest('.rightPanel');\n      if (!parent) {\n        this.show = false;\n        window.removeEventListener('click', this.closeSidebar);\n      }\n    },\n    insertToBody() {\n      const elx = this.$refs.rightPanel;\n      const body = document.querySelector('body');\n      body.insertBefore(elx, body.firstChild);\n    },\n  },\n};\n",null]}