Commit 283f9383 by cwq0219

导入按钮

1 parent a4cfe44f
......@@ -6,11 +6,7 @@
v-if="isInRole"
@click="handleClick"
>{{label}}
<input v-if="label == '导入'"
type="file"
class="import-input"
:accept="accept"
@change="handleImport" />
<slot></slot>
</el-button>
</template>
......@@ -42,10 +38,6 @@ export default {
id: {
type: String,
default: null
},
accept: {
type: String,
default: null
}
},
computed: {
......@@ -67,23 +59,10 @@ 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>
......@@ -181,7 +181,7 @@ export const resources = {
}]
},
'104': {
path: '/trafficManagement',
path: '/deviceManagement',
icon: 'train',
name: '物料管理',
meta: {
......
......@@ -32,14 +32,12 @@
label="导入"
class="import-button"
type=""
accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@import-file="importFile"
>
<!-- <input
<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>
......@@ -301,7 +299,7 @@ export default {
position: relative;
cursor: pointer;
}
/* .import-input {
.import-input {
opacity: 0;
position: absolute;
left: 0;
......@@ -310,5 +308,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!