实验数据管理转换数据上传配置文件
This commit is contained in:
parent
2ea468c04c
commit
95740388fd
@ -2,7 +2,7 @@ window.webConfig = {
|
|||||||
"webApiBaseUrl": "https://edu.mmhyvision.com:8445",
|
"webApiBaseUrl": "https://edu.mmhyvision.com:8445",
|
||||||
"VITEAPPBASEWEB": "https://edu.mmhyvision.com/vision",
|
"VITEAPPBASEWEB": "https://edu.mmhyvision.com/vision",
|
||||||
"webApiBaseApp": "https://edu.mmhyvision.com/parent",
|
"webApiBaseApp": "https://edu.mmhyvision.com/parent",
|
||||||
"mapUrl":"http://192.168.1.166",
|
"mapUrl":"http://192.168.1.208",
|
||||||
"WebSocketUrl":"ws://192.168.1.166:8087",
|
"WebSocketUrl":"ws://192.168.1.166:8087",
|
||||||
"title": "文档与数据管理系统",
|
"title": "文档与数据管理系统",
|
||||||
"bgImg": "beijing.jpg",
|
"bgImg": "beijing.jpg",
|
||||||
|
|||||||
@ -259,6 +259,9 @@ export function splitFile(params:any){
|
|||||||
return request({
|
return request({
|
||||||
url: '/experimentalData/ts-files/splitFile',
|
url: '/experimentalData/ts-files/splitFile',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params:params,
|
data: params,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
89
web/src/views/testdata/datamanagement/index.vue
vendored
89
web/src/views/testdata/datamanagement/index.vue
vendored
@ -48,6 +48,8 @@ import TextViewerAsyncLoading from "@/components/file/preview/TextViewerAsyncLoa
|
|||||||
import MarkdownViewerDialogAsyncLoading from "@/components/file/preview/MarkdownViewerDialogAsyncLoading.vue";
|
import MarkdownViewerDialogAsyncLoading from "@/components/file/preview/MarkdownViewerDialogAsyncLoading.vue";
|
||||||
import { display } from "html2canvas/dist/types/css/property-descriptors/display";
|
import { display } from "html2canvas/dist/types/css/property-descriptors/display";
|
||||||
import { getDict } from '@/api/dict'
|
import { getDict } from '@/api/dict'
|
||||||
|
import type { UploadInstance } from 'element-plus'
|
||||||
|
import type { UploadProps } from 'element-plus'
|
||||||
const { dialogVideoVisible, dialogTextVisible, dialogPdfVisible, dialogOfficeVisible, dialog3dVisible } = useFilePreview();
|
const { dialogVideoVisible, dialogTextVisible, dialogPdfVisible, dialogOfficeVisible, dialog3dVisible } = useFilePreview();
|
||||||
const { clearALlFinishedUploadFile } = useFileUpload();
|
const { clearALlFinishedUploadFile } = useFileUpload();
|
||||||
const { currentStorageKey } = useHeaderStorageList();
|
const { currentStorageKey } = useHeaderStorageList();
|
||||||
@ -1867,32 +1869,64 @@ const txtradio: any = ref(null)
|
|||||||
const pngradio: any = ref(null)
|
const pngradio: any = ref(null)
|
||||||
const configradio: any = ref(null)
|
const configradio: any = ref(null)
|
||||||
const dataConversionDialog = ref(false)
|
const dataConversionDialog = ref(false)
|
||||||
|
const isConversionSuccess = ref(false)
|
||||||
const fvnsFileName = ref('')
|
const fvnsFileName = ref('')
|
||||||
const vinsFileName = ref('')
|
const vinsFileName = ref('')
|
||||||
|
const configFile = ref('')
|
||||||
|
const selectedFile = ref<File | null>(null);
|
||||||
|
const selectdata: any = ref({})
|
||||||
|
const conversionLoading = ref(false)
|
||||||
function dataConversionClose() {
|
function dataConversionClose() {
|
||||||
dataConversionDialog.value = false
|
dataConversionDialog.value = false
|
||||||
}
|
}
|
||||||
|
function delfiles() {
|
||||||
|
selectedFile.value = null
|
||||||
|
configFile.value = ''
|
||||||
|
}
|
||||||
|
function saveDataConversion() {
|
||||||
|
conversionLoading.value = true
|
||||||
|
const formData = new FormData();
|
||||||
|
if (selectedFile.value != null) {
|
||||||
|
formData.append('jsonFile', selectedFile.value);
|
||||||
|
}
|
||||||
|
formData.append('id', selectdata.value.id);
|
||||||
|
formData.append('taskId', selectdata.value.taskId);
|
||||||
|
splitFile(formData).then((res: any) => {
|
||||||
|
if (res.code == '0') {
|
||||||
|
fvnsFileName.value = res.data.FVNS.fileName
|
||||||
|
vinsFileName.value = res.data.VINS.fileName
|
||||||
|
getdata()
|
||||||
|
isConversionSuccess.value = true
|
||||||
|
conversionLoading.value = false
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.message)
|
||||||
|
conversionLoading.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
function dataConversion(row: any) {
|
function dataConversion(row: any) {
|
||||||
const params = {
|
const params = {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
taskId: row.taskId
|
taskId: row.taskId
|
||||||
}
|
}
|
||||||
loading.value = true
|
selectdata.value = params
|
||||||
splitFile(params).then((res: any) => {
|
configFile.value = ''
|
||||||
if (res.code == '0') {
|
selectedFile.value = null
|
||||||
fvnsFileName.value = res.data.fvns.fileName
|
isConversionSuccess.value = false
|
||||||
vinsFileName.value = res.data.vins.fileName
|
|
||||||
loading.value = false
|
|
||||||
getdata()
|
|
||||||
dataConversionDialog.value = true
|
dataConversionDialog.value = true
|
||||||
} else {
|
|
||||||
ElMessage.error(res.message)
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
function isConversion(fileName: string) {
|
function isConversion(fileName: string) {
|
||||||
return fileName.includes('ins_frameSimu') && fileName.endsWith('.txt')
|
return fileName.endsWith('.txt')
|
||||||
|
}
|
||||||
|
const uploadRef = ref<UploadInstance>()
|
||||||
|
function handleFileChange(uploadFile: any) {
|
||||||
|
if (uploadFile.raw.type !== 'application/json') {
|
||||||
|
ElMessage.error('请上传.json 文件')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
configFile.value = uploadFile.raw.name
|
||||||
|
const rawFile = uploadFile.raw
|
||||||
|
selectedFile.value = rawFile
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -2390,17 +2424,36 @@ function isConversion(fileName: string) {
|
|||||||
top="30px" draggable width="60%" destroy-on-close>
|
top="30px" draggable width="60%" destroy-on-close>
|
||||||
<txtexl :file-url="fileUrl" :rowId="rowId" :taskId="projectId" />
|
<txtexl :file-url="fileUrl" :rowId="rowId" :taskId="projectId" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog :close-on-click-modal="false" title="数据转换" v-model="dataConversionDialog" :before-close="dataConversionClose"
|
<el-dialog :close-on-click-modal="false" title="数据转换" v-model="dataConversionDialog"
|
||||||
top="30px" draggable width="30%" destroy-on-close>
|
:before-close="dataConversionClose" top="30px" draggable width="30%" destroy-on-close>
|
||||||
<div style="text-align: center;">
|
<div v-loading="conversionLoading">
|
||||||
|
<div v-if="isConversionSuccess" style="text-align: center;">
|
||||||
<div style="color:#67c23a;font-size:16px;margin-bottom: 15px;"><span>数据转换成功!</span></div>
|
<div style="color:#67c23a;font-size:16px;margin-bottom: 15px;"><span>数据转换成功!</span></div>
|
||||||
<div style="font-size:16px;line-height: 1.5em;color:#409eff">
|
<div style="font-size:16px;line-height: 1.5em;color:#409eff">
|
||||||
<div>{{ fvnsFileName }}</div>
|
<div>{{ fvnsFileName }}</div>
|
||||||
<div>{{ vinsFileName }}</div>
|
<div>{{ vinsFileName }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100%;display: flex;justify-content: end;margin-top: 10px;">
|
<div v-else>
|
||||||
<el-button type="primary" @click="dataConversionClose">确定</el-button>
|
<div style="display: flex;align-items: center;width: 100%;">
|
||||||
|
<div style="min-width: max-content;">上传配置文件(.json)</div>
|
||||||
|
<div style="margin-right: 10px;width: 290px;border: 1px solid #dcdfe6;display: flex;justify-content: space-between;align-items: center;
|
||||||
|
border-radius: 4px;word-wrap: break-word;word-break: break-all;padding: 3px;min-height: 32px;">
|
||||||
|
{{ configFile }}
|
||||||
|
<CircleClose v-if="configFile !== ''" @click="delfiles"
|
||||||
|
style="width: 1em; height: 1em;margin-right: 3px; margin-right: 5px;min-width: 1em;cursor: pointer;" />
|
||||||
|
</div>
|
||||||
|
<el-upload ref="uploadRef" class="upload-demo" :show-file-list="false"
|
||||||
|
@change="handleFileChange" action=""
|
||||||
|
:auto-upload="false">
|
||||||
|
<el-button type="primary">上传</el-button>
|
||||||
|
</el-upload>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width: 100%;display: flex;justify-content: end;margin-top: 25px;">
|
||||||
|
<el-button v-if="isConversionSuccess" type="primary" @click="dataConversionClose">关闭</el-button>
|
||||||
|
<el-button v-else type="primary" @click="saveDataConversion">确定</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user