|
|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<el-form :model="formData" ref="ref_searchform" :label-width="'120px'"> |
|
|
|
<el-form v-if="progress==1" :model="formData" ref="ref_searchform" :label-width="'120px'"> |
|
|
|
<el-form-item label="标题名称" prop="taskTitle"> |
|
|
|
<el-input v-model.trim="formData.taskTitle" type="textarea" size="small" clearable style=" height: 40px;" |
|
|
|
placeholder="请输入"> |
|
|
|
@ -10,7 +10,7 @@ |
|
|
|
<el-form-item label="请选择数据源" prop="taskTitle"> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div class="flex" > |
|
|
|
<div class="flex" v-if="progress==1"> |
|
|
|
<div @click="onClickTab(item)" class="flex" style=" cursor: pointer; position: relative;display: flex; flex-direction: column; align-items: center; justify-content: center; width: 155px;height: 90px;background: #F1F4FA;border-radius: 4px; margin-left: 20px;" v-for="(item, index) in dataSourceList"> |
|
|
|
<img style="width: 30px; height: 30px;" :src="item.image" alt=""> |
|
|
|
<span style="margin-top: 10px;">{{ item.name }}</span> |
|
|
|
@ -25,29 +25,40 @@ |
|
|
|
<script> |
|
|
|
import { requestPost } from "@/js/dai/request"; |
|
|
|
export default { |
|
|
|
props: { |
|
|
|
progress: { |
|
|
|
type: Number, |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
formData1:{ |
|
|
|
}, |
|
|
|
dataSourceList:[ |
|
|
|
{ |
|
|
|
id:1, |
|
|
|
id:0, |
|
|
|
name:"楼栋房屋信息一张表", |
|
|
|
image:"https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/internal/20250114/003b8782213a487b8ce7d4267262d0ec.png", |
|
|
|
status:1 |
|
|
|
status:1, |
|
|
|
importCategory:"BASEINFO", |
|
|
|
originalFilePath: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/20250115/c4102136584140aeaf323767361a1e92.xls" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id:2, |
|
|
|
id:1, |
|
|
|
name:"居民信息一张表", |
|
|
|
image:"https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/internal/20250114/0c1e1ea17f8842e49bf5f1afeac72e42.png", |
|
|
|
status:0 |
|
|
|
status:0, |
|
|
|
importCategory:"HOUSE_INFO", |
|
|
|
originalFilePath: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/20250115/1acd160dd0fe41409cddd461b4eb0328.xls" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id:3, |
|
|
|
id:2, |
|
|
|
name:"单位信息一张表", |
|
|
|
image:"https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/internal/20250114/211af7c657c9409fbccd11185edf0474.png", |
|
|
|
status:0 |
|
|
|
}, |
|
|
|
{ |
|
|
|
id:4, |
|
|
|
id:3, |
|
|
|
name:"车辆信息一张表", |
|
|
|
image:"https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/internal/20250114/bc3e4b1e89e84ed7bc31eb90bba6cbd6.png", |
|
|
|
status:0 |
|
|
|
@ -80,22 +91,48 @@ export default { |
|
|
|
}, |
|
|
|
props: {}, |
|
|
|
async created() { |
|
|
|
await this.getDictList(); |
|
|
|
await this.loadPersonGroup(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
onClickNext(){ |
|
|
|
console.log(this.formData1,"sdfkljjslkdf"); |
|
|
|
this.checkExtractExcelHead() |
|
|
|
}, |
|
|
|
async checkExtractExcelHead() { |
|
|
|
const url = "/actual/base/intelligentImportData/extractExcelHead"; |
|
|
|
let params = { |
|
|
|
originFileName: "", |
|
|
|
originalFilePath: this.formData1.originalFilePath, |
|
|
|
importCategory: this.formData1.importCategory, |
|
|
|
}; |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
if (code === 0) { |
|
|
|
this.dialogVisibleExtractExcelHead = true; |
|
|
|
const { metaListData, fileCode, msg } = data; |
|
|
|
this.dataList = metaListData; |
|
|
|
this.fileCode = fileCode; |
|
|
|
let groupMap = new Map( |
|
|
|
this.groupList.map((item) => [item.label, item]) |
|
|
|
); |
|
|
|
for (let i in this.dataList) { |
|
|
|
this.handleSelGroup(i, groupMap.get(this.dataList[i].fileModeCode)); |
|
|
|
} |
|
|
|
this.dataListLoading = false; |
|
|
|
} else if (code >= 8000) { |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
onClickTab(value){ |
|
|
|
this.dataSourceList.filter(item => item.status === 1).forEach(item => { |
|
|
|
item.status = 0; // 将筛选出来的项的 status 改为 0 |
|
|
|
}); |
|
|
|
this.dataSourceList.filter(item1 => item1.id === value.id).forEach(item2 => { |
|
|
|
item2.status = 1; // 将筛选出来的项的 status 改为 0 |
|
|
|
}); |
|
|
|
console.log(this.dataSourceList,"这一次"); |
|
|
|
}, |
|
|
|
this.formData1=this.dataSourceList[value.id] |
|
|
|
|
|
|
|
// this.dataSourceList=this.dataSourceList.filter(item1 => item.id==item.id) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
}, |
|
|
|
handelClearCategory() { |
|
|
|
this.categoryName = null; |
|
|
|
@ -115,7 +152,7 @@ export default { |
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/isServiceProject/service/serviceScopeTree' |
|
|
|
let params ={ |
|
|
|
REVISION: 1010, |
|
|
|
fileModeCode:this.form.importCategory, |
|
|
|
fileModeCode:this.formData1.importCategory, |
|
|
|
}; |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
if (code === 0) { |
|
|
|
@ -130,34 +167,6 @@ export default { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
handelClickCategory(label) { |
|
|
|
this.categoryName = label; |
|
|
|
}, |
|
|
|
async checkExtractExcelHead() { |
|
|
|
const url = "/actual/base/intelligentImportData/extractExcelHead"; |
|
|
|
let params = { |
|
|
|
originFileName: this.createdFileName, |
|
|
|
originalFilePath: this.createdFileUrl, |
|
|
|
importCategory: this.form.importCategory, |
|
|
|
}; |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
if (code === 0) { |
|
|
|
this.dialogVisibleExtractExcelHead = true; |
|
|
|
const { metaListData, fileCode, msg } = data; |
|
|
|
this.dataList = metaListData; |
|
|
|
this.fileCode = fileCode; |
|
|
|
let groupMap = new Map( |
|
|
|
this.groupList.map((item) => [item.label, item]) |
|
|
|
); |
|
|
|
for (let i in this.dataList) { |
|
|
|
this.handleSelGroup(i, groupMap.get(this.dataList[i].fileModeCode)); |
|
|
|
} |
|
|
|
this.dataListLoading = false; |
|
|
|
} else if (code >= 8000) { |
|
|
|
this.$message.err(msg); |
|
|
|
this.dataListLoading = false; |
|
|
|
} |
|
|
|
}, |
|
|
|
async getDictList() { |
|
|
|
const url = "/sys/dict/data/dictlist"; |
|
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
|
@ -190,30 +199,6 @@ export default { |
|
|
|
} |
|
|
|
return fileType && isLt1M; |
|
|
|
}, |
|
|
|
async uploadHttpRequest(file) { |
|
|
|
const formData = new FormData(); |
|
|
|
formData.append("file", file.file); |
|
|
|
await this.$http |
|
|
|
.post("/actual/base/intelligentImportData/uploadFile", formData) |
|
|
|
.then((res) => { |
|
|
|
if (res.data.code == 0) { |
|
|
|
const { fileName, url } = res.data.data; |
|
|
|
this.createdFileName = fileName; |
|
|
|
this.createdFileUrl = url; |
|
|
|
this.fileList.push({name:fileName,url:url}) |
|
|
|
this.checkExtractExcelHead(); |
|
|
|
} else { |
|
|
|
this.$message.error(res.data.msg); |
|
|
|
this.dataListLoading = false; |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log("失败", err); |
|
|
|
file.onError(); //上传失败的文件会从文件列表中删除 |
|
|
|
this.dataListLoading = false; |
|
|
|
}); |
|
|
|
this.$refs.upload.clearFiles(); |
|
|
|
}, |
|
|
|
removeFile(){ |
|
|
|
this.fileList = []; |
|
|
|
}, |
|
|
|
|