Commit 19e01ab0 by 张杰

修复bug

1 parent d64e0653
...@@ -41,6 +41,9 @@ export default { ...@@ -41,6 +41,9 @@ export default {
let id = this.uid; let id = this.uid;
let _name = this.name; let _name = this.name;
let list = this.$root.parentCommon.getAuthData(); let list = this.$root.parentCommon.getAuthData();
if (!list || list.length <= 0) {
return false;
}
let idx = list.findIndex((k) => k.id == id || k.label == _name); let idx = list.findIndex((k) => k.id == id || k.label == _name);
if (idx < 0) { if (idx < 0) {
return false; return false;
......
...@@ -34,6 +34,9 @@ export default { ...@@ -34,6 +34,9 @@ export default {
let id = this.uid; let id = this.uid;
let _name = this.name; let _name = this.name;
let list = this.$root.parentCommon.getAuthData(); let list = this.$root.parentCommon.getAuthData();
if (!list || list.length <= 0) {
return false;
}
let idx = list.findIndex((k) => k.id == id || k.label == _name); let idx = list.findIndex((k) => k.id == id || k.label == _name);
if (idx < 0) { if (idx < 0) {
return false; return false;
......
...@@ -198,9 +198,9 @@ ...@@ -198,9 +198,9 @@
<el-input readonly :size="btn_size" v-model="importForm.fileName" ref="importInput"></el-input> <el-input readonly :size="btn_size" v-model="importForm.fileName" ref="importInput"></el-input>
</el-col> </el-col>
<el-col :span="6" class="m-l-md impot_btn"> <el-col :span="6" class="m-l-md impot_btn">
<el-button class="import-btn" :size="btn_size">导入文件 <!-- <el-button class="" :size="btn_size">导入文件</el-button> -->
</el-button> <a href="javascript:void(0)" class="btn_default" @click="chooseFiles">导入文件</a>
<input ref="importFile" :size="btn_size" type="file" id="importFile" class="import-input" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" @change="importFile($event)" /> <input ref="importInputFile" :size="btn_size" type="file" id="importFile" class="import-input" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" @change="importFile($event)" />
</el-col> </el-col>
<el-button type="text" class="import-template" icon="el-icon-link" @click="downloadTemplate">模版下载</el-button> <el-button type="text" class="import-template" icon="el-icon-link" @click="downloadTemplate">模版下载</el-button>
</el-form-item> </el-form-item>
...@@ -870,6 +870,7 @@ export default { ...@@ -870,6 +870,7 @@ export default {
dialogType: "", dialogType: "",
vinEdit: true, // 编辑车辆是否可以编辑车架号 vinEdit: true, // 编辑车辆是否可以编辑车架号
btn_size: "mini",
}; };
}, },
components: { components: {
...@@ -1113,7 +1114,7 @@ export default { ...@@ -1113,7 +1114,7 @@ export default {
this.importForm = {}; this.importForm = {};
this.exportData = {}; this.exportData = {};
this.$refs.importFile.value = ""; this.$refs.importFile.value = "";
this.$refs.serchButton.click(); this.$refs.serchButton.$el.click();
} }
break; break;
case "export": case "export":
...@@ -1664,6 +1665,12 @@ export default { ...@@ -1664,6 +1665,12 @@ export default {
} }
}); });
}, },
// 选择文件
chooseFiles(){
this.$refs.importInputFile.click()
}
}, },
}; };
</script> </script>
...@@ -1773,10 +1780,27 @@ export default { ...@@ -1773,10 +1780,27 @@ export default {
} }
.import-input { .import-input {
position: absolute; position: absolute;
top: 0; // top: 0;
right: 0; // right: 0;
bottom: 0; // bottom: 0;
left: 0; // left: 0;
z-index: 2; z-index: 1;
}
.btn_default {
position: relative;
z-index:2;
background: #fff;
border: 1px solid #dcdfe6;
font-size: 12px;
color: #606266;
padding: 6px 15px;
border-radius: 4px;
box-sizing: border-box;
}
.btn_default:focus,
.btn_default:hover {
color: #409eff;
border-color: #c6e2ff;
background: #ecf5ff;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!