|
@@ -53,23 +53,25 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<!-- 文件上传按钮部分 -->
|
|
<!-- 文件上传按钮部分 -->
|
|
|
<el-col :span="1" style="display: flex; align-items: center; margin-left: -35px">
|
|
<el-col :span="1" style="display: flex; align-items: center; margin-left: -35px">
|
|
|
- <fileUploads :projectId="136" solverType="exampleSolver" accept="" upId="airfoil_polars" name="点击选择文件"
|
|
|
|
|
- :imgSrc="meshFileImgSrc" @upload-success="handleFileUploadSuccess1" @update-fileName="updateFileName1"
|
|
|
|
|
- @update-percentage="updatePercentage1" @upload-status="getUploadStatus1" />
|
|
|
|
|
|
|
+ <mulfileuploads :imgSrc="meshFileImgSrc" accept="" @upload-success="handleSuccess"
|
|
|
|
|
+ @update-fileName="handleFileName" @update-percentage="handleProgress" @upload-status="handleStatus" />
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<!-- 进度条 -->
|
|
<!-- 进度条 -->
|
|
|
- <el-row v-if="showProgress1" style="width: 100%; margin-top: 10px;">
|
|
|
|
|
- <el-col :span="20">
|
|
|
|
|
- <el-progress :percentage="percentage1"></el-progress>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="4">
|
|
|
|
|
- <div style="line-height: 15px">{{uploadStatus1}}</div>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
|
|
+ <div v-if="showProgress1" v-for="(progress, name) in progressMap" :key="name" style="width: 100%;">
|
|
|
|
|
+ <el-row style="width: 100%; margin-top: 10px;">
|
|
|
|
|
+ <el-col :span="18">
|
|
|
|
|
+ <el-progress :percentage="progress"></el-progress>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <div style="line-height: 15px" class="ellipsis">{{ name }}</div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
- <el-table :data="gxcsTable" border style="width: 100%;max-height: 450px;" :header-cell-class-name="headerCellClassName1">
|
|
|
|
|
|
|
+ <el-table :data="gxcsTable" border style="width: 100%;max-height: 450px;"
|
|
|
|
|
+ :header-cell-class-name="headerCellClassName1">
|
|
|
<el-table-column label="启用">
|
|
<el-table-column label="启用">
|
|
|
<el-table-column type="index" width="70" label="编号">
|
|
<el-table-column type="index" width="70" label="编号">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -209,6 +211,7 @@ import propnoise3 from "@/assets/img/propnoise3.png";
|
|
|
import propnoise4 from "@/assets/img/propnoise4.png";
|
|
import propnoise4 from "@/assets/img/propnoise4.png";
|
|
|
|
|
|
|
|
import fileUploads from "../components/fileuploads.vue";
|
|
import fileUploads from "../components/fileuploads.vue";
|
|
|
|
|
+import mulfileuploads from "../components/mulfileuploads.vue";
|
|
|
|
|
|
|
|
const meshFileImgSrc = new URL("@/assets/img/open.png", import.meta.url).href;
|
|
const meshFileImgSrc = new URL("@/assets/img/open.png", import.meta.url).href;
|
|
|
|
|
|
|
@@ -256,12 +259,10 @@ const selectTab1 = (index) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let percentage = ref(0);
|
|
let percentage = ref(0);
|
|
|
-let percentage1 = ref(0);
|
|
|
|
|
let uploadStatus = ref('');
|
|
let uploadStatus = ref('');
|
|
|
-let uploadStatus1 = ref('');
|
|
|
|
|
|
|
+
|
|
|
// 控制进度条显隐
|
|
// 控制进度条显隐
|
|
|
const showProgress = computed(() => percentage.value > 0 && percentage.value <= 100);
|
|
const showProgress = computed(() => percentage.value > 0 && percentage.value <= 100);
|
|
|
-const showProgress1 = computed(() => percentage1.value > 0 && percentage1.value <= 100);
|
|
|
|
|
|
|
|
|
|
// 处理上传成功后的逻辑
|
|
// 处理上传成功后的逻辑
|
|
|
const handleFileUploadSuccess = (newValue) => {
|
|
const handleFileUploadSuccess = (newValue) => {
|
|
@@ -288,29 +289,46 @@ const getUploadStatus = (newValue) => {
|
|
|
uploadStatus.value = newValue
|
|
uploadStatus.value = newValue
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 处理上传成功后的逻辑
|
|
|
|
|
-const handleFileUploadSuccess1 = (newValue) => {
|
|
|
|
|
- //隐藏进度条
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- percentage1.value = 0;
|
|
|
|
|
- }, 1000);
|
|
|
|
|
- propnoise.value.airfoil_polars_fids = newValue.bfid;
|
|
|
|
|
- console.log("文件上传成功,bfid:", newValue.bfid, "fname:", newValue.fname)
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// 多文件上传
|
|
|
|
|
+const progressMap = reactive({});
|
|
|
|
|
|
|
|
-// 更新文件名
|
|
|
|
|
-const updateFileName1 = (newValue) => {
|
|
|
|
|
- propnoise.value.airfoil_polars = newValue
|
|
|
|
|
-}
|
|
|
|
|
|
|
+const showProgress1 = ref(false);
|
|
|
|
|
|
|
|
-// 更新进度条
|
|
|
|
|
-const updatePercentage1 = (newValue) => {
|
|
|
|
|
- percentage1.value = newValue
|
|
|
|
|
|
|
+function handleFileName(name) {
|
|
|
|
|
+ progressMap[name] = 0
|
|
|
|
|
+}
|
|
|
|
|
+function handleProgress({ fileName, percent }) {
|
|
|
|
|
+ console.log('文件:', fileName, '进度:', percent)
|
|
|
|
|
+ progressMap[fileName] = percent
|
|
|
|
|
+}
|
|
|
|
|
+function handleStatus(status) {
|
|
|
|
|
+ console.log('状态:', status)
|
|
|
|
|
+ showProgress1.value = status === '上传中';
|
|
|
|
|
+ // 全部上传完成
|
|
|
|
|
+ if (status === '全部上传完成') {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ showProgress1.value = false
|
|
|
|
|
+ for (const key in progressMap) {
|
|
|
|
|
+ delete progressMap[key]
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+function handleSuccess(data) {
|
|
|
|
|
+ console.log('上传成功:', data)
|
|
|
|
|
+
|
|
|
|
|
+ // 如果原来有值,就用分号追加;否则直接赋值
|
|
|
|
|
+ if (propnoise.value.airfoil_polars_fids) {
|
|
|
|
|
+ propnoise.value.airfoil_polars_fids += ';' + data.bfid;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ propnoise.value.airfoil_polars_fids = data.bfid;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-// 更新上传状态
|
|
|
|
|
-const getUploadStatus1 = (newValue) => {
|
|
|
|
|
- uploadStatus1.value = newValue
|
|
|
|
|
|
|
+ if (propnoise.value.airfoil_polars) {
|
|
|
|
|
+ propnoise.value.airfoil_polars += ';' + data.fname;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ propnoise.value.airfoil_polars = data.fname;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let writesolution = ref(1);
|
|
let writesolution = ref(1);
|
|
@@ -497,6 +515,10 @@ defineExpose({
|
|
|
order: -1;
|
|
order: -1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+.ellipsis {
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
</style>
|
|
</style>
|