|
|
@ -246,11 +246,75 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body> |
|
|
|
|
|
<el-upload |
|
|
|
|
|
ref="uploadRef" |
|
|
|
|
|
:limit="1" |
|
|
|
|
|
accept=".xlsx, .xls" |
|
|
|
|
|
:headers="upload.headers" |
|
|
|
|
|
:action="upload.url + '?overWrite=' + upload.overWrite" |
|
|
|
|
|
:disabled="upload.isUploading" |
|
|
|
|
|
:on-progress="handleFileUploadProgress" |
|
|
|
|
|
:on-success="handleFileSuccess" |
|
|
|
|
|
:auto-upload="false" |
|
|
|
|
|
drag |
|
|
|
|
|
> |
|
|
|
|
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon> |
|
|
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
|
|
|
|
|
<template #tip> |
|
|
|
|
|
<div class="el-upload__tip text-center"> |
|
|
|
|
|
<span>仅允许导入xls、xlsx格式文件。</span> |
|
|
|
|
|
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-upload> |
|
|
|
|
|
<template #footer> |
|
|
|
|
|
<div class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" :disabled="upload.isUploading" @click="submitFileForm">确 定</el-button> |
|
|
|
|
|
<el-button @click="upload.open = false">取 消</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
<el-dialog title="导入结果" v-model="upload.showResult" width="1000px" append-to-body> |
|
|
|
|
|
<template v-if="upload.showResult"> |
|
|
|
|
|
<el-tabs type="border-card" v-if=" (upload.resultMsg.table && upload.resultMsg.table.length>0) || (upload.resultMsg.column && upload.resultMsg.column.length>0)"> |
|
|
|
|
|
<el-tab-pane label="表级问题" v-if="upload.resultMsg.table && upload.resultMsg.table.length>0"> |
|
|
|
|
|
<el-table :data="upload.resultMsg.table" stripe style="width: 100%"> |
|
|
|
|
|
<el-table-column prop="row" label="行" /> |
|
|
|
|
|
<el-table-column prop="ssysCd" label="系统" /> |
|
|
|
|
|
<el-table-column prop="mdlName" label="模式" /> |
|
|
|
|
|
<el-table-column prop="tabEngName" label="表名称" /> |
|
|
|
|
|
<el-table-column prop="errorInfo" label="问题" /> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-tab-pane> |
|
|
|
|
|
<el-tab-pane label="字段级问题" v-if="upload.resultMsg.column && upload.resultMsg.column.length>0"> |
|
|
|
|
|
<el-table :data="upload.resultMsg.column" stripe style="width: 100%"> |
|
|
|
|
|
<el-table-column prop="row" label="行" /> |
|
|
|
|
|
<el-table-column prop="ssysCd" label="系统" /> |
|
|
|
|
|
<el-table-column prop="mdlName" label="模式" /> |
|
|
|
|
|
<el-table-column prop="tabEngName" label="表名称" /> |
|
|
|
|
|
<el-table-column prop="fldEngName" label="字段名称" /> |
|
|
|
|
|
<el-table-column prop="errorInfo" label="问题" /> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-tab-pane> |
|
|
|
|
|
</el-tabs> |
|
|
|
|
|
<span v-if=" (upload.resultMsg.table && upload.resultMsg.table.length===0) && (upload.resultMsg.column && upload.resultMsg.column.length===0) && upload.resultMsg.successCount === 0"> |
|
|
|
|
|
上传的文档内容为空,请进行有效上传 |
|
|
|
|
|
</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template #footer> |
|
|
|
|
|
<div class="dialog-footer"> |
|
|
|
|
|
<el-button type="primary" @click="upload.showResult = false">确 定</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script setup> |
|
|
<script setup> |
|
|
import { ref, nextTick, computed, watch, reactive, onMounted } from 'vue' |
|
|
import { ref, nextTick, computed, watch, reactive, onMounted } from 'vue' |
|
|
import { getSscfList, saveSscf, deleteSscf, get_dasset_tree, saveDassetTreeNode } from "@/api/dataint/sscf" |
|
|
import { getSscfList, saveSscf, deleteSscf, get_dasset_tree, saveDassetTreeNode } from "@/api/dataint/sscf" |
|
|
|
|
|
import * as XLSX from "xlsx"; |
|
|
|
|
|
import {getToken} from "../../../utils/auth.js"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance(); |
|
|
const { proxy } = getCurrentInstance(); |
|
|
@ -291,6 +355,49 @@ const total = ref(0) |
|
|
const showDialog = ref(false) |
|
|
const showDialog = ref(false) |
|
|
const showTreeDialog = ref(false) |
|
|
const showTreeDialog = ref(false) |
|
|
const currentTreeNode = ref({}) |
|
|
const currentTreeNode = ref({}) |
|
|
|
|
|
/*** 导入参数 */ |
|
|
|
|
|
const upload = reactive({ |
|
|
|
|
|
// 是否显示弹出层(导入) |
|
|
|
|
|
open: false, |
|
|
|
|
|
// 弹出层标题(导入) |
|
|
|
|
|
title: "", |
|
|
|
|
|
// 是否禁用上传 |
|
|
|
|
|
isUploading: false, |
|
|
|
|
|
// 设置上传的请求头部 |
|
|
|
|
|
headers: { Authorization: "Bearer " + getToken() }, |
|
|
|
|
|
overWrite: false, |
|
|
|
|
|
// 上传的地址 |
|
|
|
|
|
url: import.meta.env.VITE_APP_BASE_API + "/dataint/sscf/upload", |
|
|
|
|
|
showResult: false, |
|
|
|
|
|
resultMsg: {} |
|
|
|
|
|
}); |
|
|
|
|
|
/**文件上传中处理 */ |
|
|
|
|
|
const handleFileUploadProgress = (event, file, fileList) => { |
|
|
|
|
|
upload.isUploading = true; |
|
|
|
|
|
} |
|
|
|
|
|
/** 提交上传文件 */ |
|
|
|
|
|
function submitFileForm() { |
|
|
|
|
|
proxy.$refs["uploadRef"].submit(); |
|
|
|
|
|
} |
|
|
|
|
|
/** 下载模板操作 */ |
|
|
|
|
|
function importTemplate() { |
|
|
|
|
|
proxy.download("/dataint/sscf/importTemplate", { |
|
|
|
|
|
}, `meta_template_${new Date().getTime()}.xlsx`); |
|
|
|
|
|
} |
|
|
|
|
|
/** 文件上传成功处理 */ |
|
|
|
|
|
const handleFileSuccess = (response, file, fileList) => { |
|
|
|
|
|
upload.open = false; |
|
|
|
|
|
upload.isUploading = false; |
|
|
|
|
|
proxy.$refs["uploadRef"].handleRemove(file); |
|
|
|
|
|
let resData = response.data |
|
|
|
|
|
if (resData.successCount > 0 && resData.rows.length === 0){ |
|
|
|
|
|
proxy.$modal.msgSuccess("导入成功") |
|
|
|
|
|
}else { |
|
|
|
|
|
upload.resultMsg = resData |
|
|
|
|
|
upload.showResult = true |
|
|
|
|
|
} |
|
|
|
|
|
getList(); |
|
|
|
|
|
} |
|
|
function handleAddTree(){ |
|
|
function handleAddTree(){ |
|
|
showTreeDialog.value = true |
|
|
showTreeDialog.value = true |
|
|
currentTreeNode.value = { |
|
|
currentTreeNode.value = { |
|
|
@ -423,10 +530,29 @@ function handleDelete(array){ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
function handleImport(){ |
|
|
function handleImport(){ |
|
|
|
|
|
upload.title = "数据导入"; |
|
|
|
|
|
upload.open = true; |
|
|
} |
|
|
} |
|
|
function handleExport(){ |
|
|
function handleExport(){ |
|
|
|
|
|
let data = []; |
|
|
|
|
|
if (dataList.value.length > 0){ |
|
|
|
|
|
for (let i = 0; i < dataList.value.length; i++) { |
|
|
|
|
|
data.push({ |
|
|
|
|
|
"关键词":dataList.value[i].keyword, |
|
|
|
|
|
"算法":dataList.value[i].algorithm, |
|
|
|
|
|
"按顺序匹配标志":dataList.value[i].order, |
|
|
|
|
|
"整句":dataList.value[i].wholeSentence, |
|
|
|
|
|
"类型":dataList.value[i].type, |
|
|
|
|
|
"补充说明":dataList.value[i].suppExpl, |
|
|
|
|
|
"状态":dataList.value[i].status, |
|
|
|
|
|
"负责人员":dataList.value[i].updateBy |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
const workbook = XLSX.utils.book_new(); |
|
|
|
|
|
const worksheet = XLSX.utils.json_to_sheet(data); |
|
|
|
|
|
XLSX.utils.book_append_sheet(workbook, worksheet, "Sheet1"); |
|
|
|
|
|
XLSX.writeFile(workbook, "数据导出.xlsx"); |
|
|
} |
|
|
} |
|
|
function handleSelection(val){ |
|
|
function handleSelection(val){ |
|
|
multSelection.value= val |
|
|
multSelection.value= val |
|
|
@ -452,9 +578,11 @@ function get_tree_data(){ |
|
|
/** 通过条件过滤节点 */ |
|
|
/** 通过条件过滤节点 */ |
|
|
const filterNode = (value, data) => { |
|
|
const filterNode = (value, data) => { |
|
|
if (!value) return true; |
|
|
if (!value) return true; |
|
|
return data.label.indexOf(value) !== -1; |
|
|
return data.dassetName.indexOf(value) !== -1; |
|
|
}; |
|
|
}; |
|
|
|
|
|
watch(dasset, val => { |
|
|
|
|
|
proxy.$refs["deptTreeRef"].filter(val); |
|
|
|
|
|
}); |
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
get_tree_data() |
|
|
get_tree_data() |
|
|
handleQuery() |
|
|
handleQuery() |
|
|
|