|
@@ -47,9 +47,27 @@
|
|
|
size="small"
|
|
|
>
|
|
|
<template #append>
|
|
|
- <el-button :icon="FolderOpened" :disabled="!isfileup" @click="handleFileUp"/>
|
|
|
+ <FileUploader
|
|
|
+ :accept="''"
|
|
|
+ :img-src="fileOpen"
|
|
|
+ :disabled="!isfileup"
|
|
|
+ @upload-success="(fileInfo) => handleUploadSuccess(fileInfo, item)"
|
|
|
+ @update-fileName="(name) => handleUpdateFileName(name, item)"
|
|
|
+ @update-percentage="handleUpdatePercentage"
|
|
|
+ @upload-status="handleUploadStatus"
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-input>
|
|
|
+
|
|
|
+ <!-- 小进度条放在输入框下方 -->
|
|
|
+ <el-progress
|
|
|
+ v-if="uploadPercent > 0 && uploadPercent < 100"
|
|
|
+ :percentage="uploadPercent"
|
|
|
+ :text-inside="false"
|
|
|
+ :stroke-width="4"
|
|
|
+ style="width: 100%; margin-top: 4px;"
|
|
|
+ />
|
|
|
+
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- 复选框(无 label、不占位) -->
|
|
@@ -84,9 +102,11 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { analysisJson, delChangeInfo } from '../js/analysisData.js'
|
|
|
-
|
|
|
+import FileUploader from '@/views/components/fileuploads.vue'
|
|
|
import { useValOptionsStore } from '@/store/valoptions'
|
|
|
+
|
|
|
import { FolderOpened } from '@element-plus/icons-vue'
|
|
|
+import fileOpen from '@/assets/img/open.png'
|
|
|
|
|
|
const valOptionsStore = useValOptionsStore()
|
|
|
|
|
@@ -105,6 +125,7 @@ const props = defineProps({
|
|
|
})
|
|
|
|
|
|
const Labelwidth = '80px';
|
|
|
+const uploadPercent = ref(0) // 上传进度百分比
|
|
|
|
|
|
const valoption = computed(() => valOptionsStore.valOptionsMap)
|
|
|
|
|
@@ -119,6 +140,28 @@ watch(
|
|
|
{ deep: true } // 深度监听
|
|
|
);
|
|
|
|
|
|
+// 上传成功回调
|
|
|
+function handleUploadSuccess(fileInfo, item) {
|
|
|
+ item.vo.val = fileInfo.fname
|
|
|
+ uploadPercent.value = 0
|
|
|
+}
|
|
|
+
|
|
|
+// 文件名更新回调
|
|
|
+function handleUpdateFileName(name, item) {
|
|
|
+ item.vo.val = name
|
|
|
+ console.log('选中文件名', name, item)
|
|
|
+}
|
|
|
+
|
|
|
+// 上传进度更新回调
|
|
|
+function handleUpdatePercentage(percent) {
|
|
|
+ uploadPercent.value = percent
|
|
|
+}
|
|
|
+
|
|
|
+// 上传状态回调
|
|
|
+function handleUploadStatus(status) {
|
|
|
+ console.log('上传状态', status)
|
|
|
+}
|
|
|
+
|
|
|
const getdatainit = () => {
|
|
|
amDataObj.value = analysisJson(props.amDatajson);
|
|
|
console.log('amDataObj', amDataObj.value );
|