<template>
  <el-dialog title="查看" :visible.sync="dialogFormVisible" width="90%">
    <div class="dialogConcent" :style="{height:clientHeight+'px'}">
      <el-scrollbar style="flex: 1">
        <el-form :model="form" ref="form" label-position="top" label-width="120">
          <el-form-item label="任务名称">
            {{form.title}}
          </el-form-item>


          <el-form-item label="任务日期">

            {{form.start_date}}至{{form.end_date}}
          </el-form-item>

          <el-form-item label="内容" prop="content">
            <div style="width: 99.9%;" v-html="form.content">
            </div>
          </el-form-item>
          <el-form-item label="附件" prop="file_list">
            <div style="display: flex;flex-direction: column;align-items:flex-start">
              <el-link v-for="item in form.files" target="_blank" :href="item.url" type="primary">
                {{item.original_name}}
              </el-link>
            </div>

          </el-form-item>
        </el-form>

      </el-scrollbar>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogFormVisible=false">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
  import {
    listtask,
    getdaily
  } from "../../../api/daily/index.js";

  export default {
    data() {
      return {
        dialogFormVisible: false,
        form: {},
        fileList: [],
        clientHeight: 0
      }
    },
    created() {
      this.clientHeight = document.documentElement.clientHeight*.6;
    },
    methods: {
      async getinfo(id) {

        var that = this;
        await getdaily(id).then(res => {
          // this.$set(that.form,res);
          that.form = res;
          let _files = [];
          for (var mod of result.files) {
            let m = Object.assign({}, mod);
            m.name = mod.original_name;
            _files.push(m);
          }
          that.fileList = _files;
        }).catch(error => {
          //reject(error)
        })
      }
    }
  }
</script>

<style>
  .dialogConcent {
    overflow-y: auto;
  }
</style>
