|
|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-card v-if="cardVisible">
|
|
|
+ <div class="overlay" v-if="cardVisible"></div>
|
|
|
+ <el-card v-if="cardVisible" class="pop-card">
|
|
|
<template #header>
|
|
|
<div class="flex justify-between items-center pop-head">
|
|
|
<div style="font-size: 16px; font-weight: 600">批量导入</div>
|
|
|
@@ -39,9 +40,7 @@
|
|
|
<Document />
|
|
|
</el-icon>
|
|
|
<div class="el-upload__text">
|
|
|
- <div style="font-size: 12px; color: red; margin-bottom: 5px"
|
|
|
- >请下载模板并按要求填写后上传</div
|
|
|
- >
|
|
|
+ <div style="font-size: 12px; color: red; margin-bottom: 5px">请下载模板并按要求填写后上传</div>
|
|
|
<div style="font-size: 16px">点击或将文件拖拽到这里上传</div>
|
|
|
<div style="font-size: 12px; color: rgba(0, 0, 0, 0.45); margin-top: 5px"
|
|
|
>文件支持.xlsx .xls格式,仅支持上传一个文件</div
|
|
|
@@ -60,9 +59,7 @@
|
|
|
>
|
|
|
</el-tooltip>
|
|
|
<el-button @click="handleDownloadTemplate">下载模板</el-button>
|
|
|
- <el-button type="primary" @click="handleImport" :disabled="isImportEnable"
|
|
|
- >导入</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="handleImport" :disabled="isImportEnable">导入</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
@@ -85,8 +82,7 @@
|
|
|
<div class="header-text">添加提示</div>
|
|
|
</template>
|
|
|
<div class="sum-count">
|
|
|
- 成功上传 <span class="succ-sum">{{ sucCount }}</span> 条, 失败
|
|
|
- <span class="err-sum">{{ errCount }}</span> 条
|
|
|
+ 成功上传 <span class="succ-sum">{{ sucCount }}</span> 条, 失败 <span class="err-sum">{{ errCount }}</span> 条
|
|
|
</div>
|
|
|
<div class="err-info">
|
|
|
<ul v-for="(item, index) in errDetail" :key="index">
|
|
|
@@ -133,11 +129,7 @@
|
|
|
headers: getHeaders(),
|
|
|
responseType: 'blob',
|
|
|
};
|
|
|
- const response = await axios.post(
|
|
|
- urlPrefix + '/admin/cameraConfig/exportSceneCodeInfo',
|
|
|
- null,
|
|
|
- config,
|
|
|
- );
|
|
|
+ const response = await axios.post(urlPrefix + '/admin/cameraConfig/exportSceneCodeInfo', null, config);
|
|
|
const blob = new Blob([response.data], {
|
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
|
});
|
|
|
@@ -212,15 +204,9 @@
|
|
|
if (errDetail.value.length > 0) {
|
|
|
errDetail.value.forEach((item, index) => {
|
|
|
if (item.indexOf('【添加失败】') >= 0) {
|
|
|
- errDetail.value[index] = item.replace(
|
|
|
- '【添加失败】',
|
|
|
- '<span style="color: #ff4d4f">【添加失败】</span>',
|
|
|
- );
|
|
|
+ errDetail.value[index] = item.replace('【添加失败】', '<span style="color: #ff4d4f">【添加失败】</span>');
|
|
|
} else if (item.indexOf('【添加成功】') >= 0) {
|
|
|
- errDetail.value[index] = item.replace(
|
|
|
- '【添加成功】',
|
|
|
- '<span style="color: #52c41a">【添加成功】</span>',
|
|
|
- );
|
|
|
+ errDetail.value[index] = item.replace('【添加成功】', '<span style="color: #52c41a">【添加成功】</span>');
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -267,6 +253,22 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+ .overlay {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ background-color: rgba(0, 0, 0, 0.5);
|
|
|
+ z-index: 999;
|
|
|
+ }
|
|
|
+ .pop-card {
|
|
|
+ position: fixed;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ z-index: 1000;
|
|
|
+ }
|
|
|
.upload-content {
|
|
|
margin-left: 90px;
|
|
|
margin-top: 36px;
|