{"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/base/selfUpload.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/components/base/selfUpload.vue","mtime":1701742078546},{"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 UploadIndex from './uploadPicture.vue';\nexport default {\n  name: 'selfUpload',\n  components: { UploadIndex },\n  props: {\n    value: {},\n    multiple: {\n      type: Boolean,\n      default: false,\n    },\n  },\n  data() {\n    return {\n      image: '',\n      visible: false,\n      callback: function () {},\n      isMore: '',\n      imageList: [],\n    };\n  },\n  beforeMount() {\n    if (this.multiple) {\n      // 接收 v-model 数据\n      if (this.value) {\n        this.imageList = JSON.parse(this.value);\n      }\n    } else {\n      // 接收 v-model 数据\n      if (this.value) {\n        this.image = this.value;\n      }\n    }\n    // 处理多选\n    this.isMore = this.multiple ? '2' : '1';\n  },\n  methods: {\n    handleClose() {\n      this.visible = false;\n    },\n    getImage(img) {\n      if (this.multiple) {\n        let obj = {};\n        let imgList = [];\n        imgList = img.reduce((cur, next) => {\n          obj[next.attId] ? '' : (obj[next.attId] = true && cur.push(next));\n          return cur;\n        }, []);\n        imgList.map((item) => {\n          this.imageList.push(item.sattDir);\n        });\n        this.$emit('input', JSON.stringify(this.imageList));\n      } else {\n        this.image = img[0].sattDir;\n        this.$emit('input', this.image);\n      }\n      this.visible = false;\n    },\n    // 点击商品图\n    modalPicTap(tit, num, i) {\n      this.visible = true;\n    },\n    handleRemove(i) {\n      this.imageList.splice(i, 1);\n      this.$emit('input', JSON.stringify(this.imageList));\n    },\n    // 移动\n    handleDragStart(e, item) {\n      this.dragging = item;\n    },\n    handleDragEnd(e, item) {\n      this.dragging = null;\n    },\n    handleDragOver(e) {\n      e.dataTransfer.dropEffect = 'move';\n    },\n    handleDragEnter(e, item) {\n      e.dataTransfer.effectAllowed = 'move';\n      if (item === this.dragging) {\n        return;\n      }\n      const newItems = [...this.imageList];\n      const src = newItems.indexOf(this.dragging);\n      const dst = newItems.indexOf(item);\n      newItems.splice(dst, 0, ...newItems.splice(src, 1));\n      this.imageList = newItems;\n    },\n  },\n};\n",null]}