<el-upload style="display: inline-flex;margin-right: 10px" :show-file-list="false" :before-upload="beforeUpload" :on-success="onSuccess" :on-error="onError" :disabled="importDataDisabled" action="/emp/basic/import"><!--@click="importData"--> <el-button type="success" :disabled="importDataDisabled" :icon="importDataBtnIcon"> {{importDataBtnText}} </el-button> </el-upload>
importDataBtnText:‘导入数据‘, importDataBtnIcon:‘el-icon-upload2‘, importDataDisabled:false,
onError(err, file, fileList) { this.importDataBtnText = ‘导入数据‘; this.importDataBtnIcon = ‘el-icon-upload2‘; this.importDataDisabled = false; }, onSuccess(response, file, fileList) { this.importDataBtnText = ‘导入数据‘; this.importDataBtnIcon = ‘el-icon-upload2‘; this.importDataDisabled = false; this.initEmployee() }, beforeUpload() { this.importDataBtnText = ‘正在导入‘; this.importDataBtnIcon = ‘el-icon-loading‘; this.importDataDisabled = true; },
|