<template>
  <div>
		<el-row :gutter="20" class="elrow">
			<el-col :span="24">
				<el-card shadow="nerver" class="searchlist">
					<el-row :gutter="20" class="searchlist1">
            <div class="selectoptionClass" v-if="userInfo.type==0">
              <selectoption></selectoption>
            </div>
						<el-input placeholder="请输入校区名称" v-model="schoolName" :clearable="true" class="inputBox" size="small"></el-input>
						<el-button type="primary" @click="queryfirstall" size="small">查询</el-button>
            <input class="input-file" type="file" @change="exportData"
              accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" />
            <el-button type="primary" @click="btnClick" size="mini">上传</el-button>
					</el-row>
				</el-card>
			</el-col>
		</el-row>

  </div>
</template>

<script>
	import {
		httpGet,
		httpPost,
		download
	} from "../../api";
	export default {
		inject: ['reload'],
		name: "offinHouse",
		data() {
			return {
        userInfo:{},
        schoolName:""
      }
    },
		created() {
			this.userInfo = JSON.parse(localStorage.getItem('info'))
    },
    methods:{
      exportData(){
        if (!event.currentTarget.files.length) {
          return;
        }
        const that = this;
        // 拿取文件对象
				var fd = new FormData();
				fd.append("file", event.currentTarget.files[0]);
        // var f = event.currentTarget.files[0];
        var data={
          code:"zg/auth/uploadProfile",
          data:{
            fd
          }
        }
        httpPost(data,this.$api.sendCommand).then(res=>{

        })
      },
      btnClick() {
        document.querySelector(".input-file").click();
      },
      queryfirstall() {

			},
    }
  }
</script>

<style scoped>
  .input-file {
    display: none;
  }
</style>
