{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\Tinymce\\components\\EditorImage.vue?vue&type=script&lang=js&","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\Tinymce\\components\\EditorImage.vue","mtime":1622443089431},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n// import { getToken } from 'api/qiniu'\n\nexport default {\n  name: 'EditorSlideUpload',\n  props: {\n    color: {\n      type: String,\n      default: '#1890ff'\n    }\n  },\n  data() {\n    return {\n      dialogVisible: false,\n      listObj: {},\n      fileList: []\n    }\n  },\n  methods: {\n    checkAllSuccess() {\n      return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)\n    },\n    handleSubmit() {\n      const arr = Object.keys(this.listObj).map(v => this.listObj[v])\n      if (!this.checkAllSuccess()) {\n        this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!')\n        return\n      }\n      this.$emit('successCBK', arr)\n      this.listObj = {}\n      this.fileList = []\n      this.dialogVisible = false\n    },\n    handleSuccess(response, file) {\n      const uid = file.uid\n      const objKeyArr = Object.keys(this.listObj)\n      for (let i = 0, len = objKeyArr.length; i < len; i++) {\n        if (this.listObj[objKeyArr[i]].uid === uid) {\n          this.listObj[objKeyArr[i]].url = response.files.file\n          this.listObj[objKeyArr[i]].hasSuccess = true\n          return\n        }\n      }\n    },\n    handleRemove(file) {\n      const uid = file.uid\n      const objKeyArr = Object.keys(this.listObj)\n      for (let i = 0, len = objKeyArr.length; i < len; i++) {\n        if (this.listObj[objKeyArr[i]].uid === uid) {\n          delete this.listObj[objKeyArr[i]]\n          return\n        }\n      }\n    },\n    beforeUpload(file) {\n      const _self = this\n      const _URL = window.URL || window.webkitURL\n      const fileName = file.uid\n      this.listObj[fileName] = {}\n      return new Promise((resolve, reject) => {\n        const img = new Image()\n        img.src = _URL.createObjectURL(file)\n        img.onload = function() {\n          _self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height }\n        }\n        resolve(true)\n      })\n    }\n  }\n}\n",{"version":3,"sources":["EditorImage.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"EditorImage.vue","sourceRoot":"src/components/Tinymce/components","sourcesContent":["<template>\n  <div class=\"upload-container\">\n    <el-button :style=\"{background:color,borderColor:color}\" icon=\"el-icon-upload\" size=\"mini\" type=\"primary\" @click=\" dialogVisible=true\">\n      upload\n    </el-button>\n    <el-dialog :visible.sync=\"dialogVisible\">\n      <el-upload\n        :multiple=\"true\"\n        :file-list=\"fileList\"\n        :show-file-list=\"true\"\n        :on-remove=\"handleRemove\"\n        :on-success=\"handleSuccess\"\n        :before-upload=\"beforeUpload\"\n        class=\"editor-slide-upload\"\n        action=\"https://httpbin.org/post\"\n        list-type=\"picture-card\"\n      >\n        <el-button size=\"small\" type=\"primary\">\n          Click upload\n        </el-button>\n      </el-upload>\n      <el-button @click=\"dialogVisible = false\">\n        Cancel\n      </el-button>\n      <el-button type=\"primary\" @click=\"handleSubmit\">\n        Confirm\n      </el-button>\n    </el-dialog>\n  </div>\n</template>\n\n<script>\n// import { getToken } from 'api/qiniu'\n\nexport default {\n  name: 'EditorSlideUpload',\n  props: {\n    color: {\n      type: String,\n      default: '#1890ff'\n    }\n  },\n  data() {\n    return {\n      dialogVisible: false,\n      listObj: {},\n      fileList: []\n    }\n  },\n  methods: {\n    checkAllSuccess() {\n      return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)\n    },\n    handleSubmit() {\n      const arr = Object.keys(this.listObj).map(v => this.listObj[v])\n      if (!this.checkAllSuccess()) {\n        this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!')\n        return\n      }\n      this.$emit('successCBK', arr)\n      this.listObj = {}\n      this.fileList = []\n      this.dialogVisible = false\n    },\n    handleSuccess(response, file) {\n      const uid = file.uid\n      const objKeyArr = Object.keys(this.listObj)\n      for (let i = 0, len = objKeyArr.length; i < len; i++) {\n        if (this.listObj[objKeyArr[i]].uid === uid) {\n          this.listObj[objKeyArr[i]].url = response.files.file\n          this.listObj[objKeyArr[i]].hasSuccess = true\n          return\n        }\n      }\n    },\n    handleRemove(file) {\n      const uid = file.uid\n      const objKeyArr = Object.keys(this.listObj)\n      for (let i = 0, len = objKeyArr.length; i < len; i++) {\n        if (this.listObj[objKeyArr[i]].uid === uid) {\n          delete this.listObj[objKeyArr[i]]\n          return\n        }\n      }\n    },\n    beforeUpload(file) {\n      const _self = this\n      const _URL = window.URL || window.webkitURL\n      const fileName = file.uid\n      this.listObj[fileName] = {}\n      return new Promise((resolve, reject) => {\n        const img = new Image()\n        img.src = _URL.createObjectURL(file)\n        img.onload = function() {\n          _self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height }\n        }\n        resolve(true)\n      })\n    }\n  }\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.editor-slide-upload {\n  margin-bottom: 20px;\n  ::v-deep .el-upload--picture-card {\n    width: 100%;\n  }\n}\n</style>\n"]}]}