<template>
  <ed-form :form-desc="formDesc" v-model="formModel"> </ed-form>
</template>

<script>
import {DefaultUrl, getFileAccessHttpUrl} from "../../../lib/api/easyData";

export default {
  name: "EdFormView",
  data(){
    return {
      formModel: {
        upload: [],
        text: ""
      },
      formDesc: [
        {
          label: "上传",
          props: "upload",
          children: {
            tags: "ed-upload",
            attrs: this.bindUploadProps()
          }
        },
        {
          label: "文件描述",
          props: "text",
          children: {
            tags: "el-input"
          }
        }
      ]
    }
  },
  methods:{
    bindUploadProps(){
      let props = {}
      props.headers = this.$EdFrame.BASE_HEADERS()
      props.action = this.$EdFrame.BASE_API + '/admin-api' + DefaultUrl.uploadUrl
      // props.beforeUpload = (file) => this.beforeUpload(file, control)
      // props.onPreview = (v) => this.uploadHandleDownload(v, control)
      // props.onSuccess = (res, file, fileList) => this.uploadHandleSuccess(res, file, fileList, control)
      // props.onExceed = (v) => this.uploadHandleExceed(v, controlProps)
      // props.onRemove = (file, fileList) => this.uploadHandleRemove(file, fileList, control.controlName)
      // props.data = controlProps
      return props
    },
  }
}
</script>

<style scoped>

</style>
