Commit 283f9383 by cwq0219

导入按钮

1 parent a4cfe44f
...@@ -6,11 +6,7 @@ ...@@ -6,11 +6,7 @@
v-if="isInRole" v-if="isInRole"
@click="handleClick" @click="handleClick"
>{{label}} >{{label}}
<input v-if="label == '导入'" <slot></slot>
type="file"
class="import-input"
:accept="accept"
@change="handleImport" />
</el-button> </el-button>
</template> </template>
...@@ -42,10 +38,6 @@ export default { ...@@ -42,10 +38,6 @@ export default {
id: { id: {
type: String, type: String,
default: null default: null
},
accept: {
type: String,
default: null
} }
}, },
computed: { computed: {
...@@ -67,23 +59,10 @@ export default { ...@@ -67,23 +59,10 @@ export default {
methods: { methods: {
handleClick: function () { handleClick: function () {
this.$emit('e-auth-click', {}) this.$emit('e-auth-click', {})
},
handleImport(e) {
this.$emit('import-file', e)
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.import-input {
opacity: 0;
position: absolute;
left: 0;
top: 0;
width: 70px;
height: 100%;
cursor: pointer;
font-size:0
}
</style> </style>
...@@ -181,7 +181,7 @@ export const resources = { ...@@ -181,7 +181,7 @@ export const resources = {
}] }]
}, },
'104': { '104': {
path: '/trafficManagement', path: '/deviceManagement',
icon: 'train', icon: 'train',
name: '物料管理', name: '物料管理',
meta: { meta: {
......
...@@ -32,14 +32,12 @@ ...@@ -32,14 +32,12 @@
label="导入" label="导入"
class="import-button" class="import-button"
type="" type=""
accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@import-file="importFile"
> >
<!-- <input <input
type="file" type="file"
class="import-input" class="import-input"
accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@change="importFile($event)" /> --> @change="importFile($event)" />
</auth-button> </auth-button>
<auth-button label="导出" type=""></auth-button> <auth-button label="导出" type=""></auth-button>
</el-col> </el-col>
...@@ -301,7 +299,7 @@ export default { ...@@ -301,7 +299,7 @@ export default {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
} }
/* .import-input { .import-input {
opacity: 0; opacity: 0;
position: absolute; position: absolute;
left: 0; left: 0;
...@@ -310,5 +308,5 @@ export default { ...@@ -310,5 +308,5 @@ export default {
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
font-size:0 font-size:0
} */ }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!