Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
3382188eca
@ -2,7 +2,7 @@ window.webConfig = {
|
||||
"webApiBaseUrl": "https://edu.mmhyvision.com:8445",
|
||||
"VITEAPPBASEWEB": "https://edu.mmhyvision.com/vision",
|
||||
"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",
|
||||
"title": "文档与数据管理系统",
|
||||
"bgImg": "beijing.jpg",
|
||||
|
||||
@ -259,6 +259,9 @@ export function splitFile(params:any){
|
||||
return request({
|
||||
url: '/experimentalData/ts-files/splitFile',
|
||||
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 { display } from "html2canvas/dist/types/css/property-descriptors/display";
|
||||
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 { clearALlFinishedUploadFile } = useFileUpload();
|
||||
const { currentStorageKey } = useHeaderStorageList();
|
||||
@ -1867,32 +1869,64 @@ const txtradio: any = ref(null)
|
||||
const pngradio: any = ref(null)
|
||||
const configradio: any = ref(null)
|
||||
const dataConversionDialog = ref(false)
|
||||
const isConversionSuccess = ref(false)
|
||||
const fvnsFileName = ref('')
|
||||
const vinsFileName = ref('')
|
||||
const configFile = ref('')
|
||||
const selectedFile = ref<File | null>(null);
|
||||
const selectdata: any = ref({})
|
||||
const conversionLoading = ref(false)
|
||||
function dataConversionClose() {
|
||||
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 && res.code == '0') {
|
||||
fvnsFileName.value = res.data.FVNS.fileName
|
||||
vinsFileName.value = res.data.VINS.fileName
|
||||
getdata()
|
||||
isConversionSuccess.value = true
|
||||
conversionLoading.value = false
|
||||
} else {
|
||||
conversionLoading.value = false
|
||||
ElMessage.error('转换失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
function dataConversion(row: any) {
|
||||
const params = {
|
||||
id: row.id,
|
||||
taskId: row.taskId
|
||||
}
|
||||
loading.value = true
|
||||
splitFile(params).then((res: any) => {
|
||||
if (res.code == '0') {
|
||||
fvnsFileName.value = res.data.fvns.fileName
|
||||
vinsFileName.value = res.data.vins.fileName
|
||||
loading.value = false
|
||||
getdata()
|
||||
selectdata.value = params
|
||||
configFile.value = ''
|
||||
selectedFile.value = null
|
||||
isConversionSuccess.value = false
|
||||
dataConversionDialog.value = true
|
||||
} else {
|
||||
ElMessage.error(res.message)
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
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>
|
||||
|
||||
@ -2390,17 +2424,36 @@ function isConversion(fileName: string) {
|
||||
top="30px" draggable width="60%" destroy-on-close>
|
||||
<txtexl :file-url="fileUrl" :rowId="rowId" :taskId="projectId" />
|
||||
</el-dialog>
|
||||
<el-dialog :close-on-click-modal="false" title="数据转换" v-model="dataConversionDialog" :before-close="dataConversionClose"
|
||||
top="30px" draggable width="30%" destroy-on-close>
|
||||
<div style="text-align: center;">
|
||||
<el-dialog :close-on-click-modal="false" title="数据转换" v-model="dataConversionDialog"
|
||||
:before-close="dataConversionClose" top="30px" draggable width="30%" destroy-on-close>
|
||||
<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="font-size:16px;line-height: 1.5em;color:#409eff">
|
||||
<div>{{ fvnsFileName }}</div>
|
||||
<div>{{ vinsFileName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%;display: flex;justify-content: end;margin-top: 10px;">
|
||||
<el-button type="primary" @click="dataConversionClose">确定</el-button>
|
||||
<div v-else>
|
||||
<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>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user