<!--
    上传图片的弹窗
-->

<template>
  <el-dialog title="上传图片" :visible.sync="dialog.uploadImgs" width="500px">
    <div style="max-height: 500px; overflow-y: auto;">
        <upload-imgs :readOnly="read" :keysArr="deepcopy(keysArr)" @change="changeItem" max="2"></upload-imgs>
    </div>
  </el-dialog>
</template>
<script>
import uploadImgs from "@/components/ledger/lib/uploadImgs";
export default {
  components: {
    uploadImgs
  },
  props: {
    dialog: {
      type: Object,
      default: function () {
        return {
          uploadImgs: true
        };
      }
    },
    keysArr: {
      type: Array,
      default: function () {
        return []
      }
    },
    read: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {};
  },
  created() { },
  mounted() { },
  methods: {
    deepcopy(obj) {
      console.log(obj, "out")
      return JSON.parse(JSON.stringify(obj));
    },
    changeItem(file) {
      console.log(file, "changed")
      this.$emit("changeFile", file)
    }
  },
};
</script>
<style>
</style>