Commit 7b2ebac9 by cwq0219

修改

1 parent 988d887f
......@@ -5,7 +5,13 @@
:loading="loading"
v-if="isInRole"
@click="handleClick"
>{{label}}</el-button>
>{{label}}
<input v-if="label == '导入'"
type="file"
class="import-input"
:accept="accept"
@change="handleImport" />
</el-button>
</template>
<script>
......@@ -36,6 +42,10 @@ export default {
id: {
type: String,
default: null
},
accept: {
type: String,
default: null
}
},
computed: {
......@@ -54,10 +64,23 @@ export default {
methods: {
handleClick: function () {
this.$emit('e-auth-click', {})
},
handleImport(e) {
this.$emit('import-file', e)
}
}
}
</script>
<style scoped>
.import-input {
opacity: 0;
position: absolute;
left: 0;
top: 0;
width: 70px;
height: 100%;
cursor: pointer;
font-size:0
}
</style>
......@@ -28,12 +28,18 @@
<el-row style="height: 40px; line-height: 40px">
<el-col :span="12">物料列表</el-col>
<el-col :span="12" style="text-align: right">
<auth-button label="导入" class="import-button" type="">
<input
<auth-button
label="导入"
class="import-button"
type=""
accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@import-file="importFile"
>
<!-- <input
type="file"
class="import-input"
accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@change="importFile($event)" />
@change="importFile($event)" /> -->
</auth-button>
<auth-button label="导出" type=""></auth-button>
</el-col>
......@@ -290,7 +296,7 @@ export default {
position: relative;
cursor: pointer;
}
.import-input {
/* .import-input {
opacity: 0;
position: absolute;
left: 0;
......@@ -299,5 +305,5 @@ export default {
height: 100%;
cursor: pointer;
font-size:0
}
} */
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!