<template>
  <div>
    <el-card>
      <div style="display: inline">
        <h1>{{ resourceDetail.name }}</h1>
        <h3>资源类型:{{ resourceDetail.typeName }}</h3>
      </div>
    </el-card>
    <el-card>
      <div v-if="resourceDetail.type==0">
        <el-form>
          <el-form-item>
            <el-input type="textarea" :rows="14" readonly v-model="curSource"></el-input>
          </el-form-item>
        </el-form>
      </div>
    </el-card>
  </div>
</template>

<script>
import {getResourceData} from "@/api/resource";

export default {
  name: "ResourceDetailsPage",
  data() {
    return {
      resourceId:null,
      resourceDetail:{

      },
      sourceList:[],
      curSource:''
    }
  },
  mounted() {
    this.resourceId = this.$route.params.resourceId
  },
  methods:{
    fetchResourceData(id){
      getResourceData(id).then(res=>{
        this.resourceDetail=res.result;
        this.sourceList=res.result.dataList;
      })
    }
  }

}
</script>

<style scoped>

</style>
