fix : 单文件和多文件上传样式调整
This commit is contained in:
@@ -12,15 +12,15 @@
|
|||||||
</template>
|
</template>
|
||||||
<template
|
<template
|
||||||
v-else-if="!preview||JSON.stringify(singleFile) == '{}'||singleFile==null||formData.singleFile==null">
|
v-else-if="!preview||JSON.stringify(singleFile) == '{}'||singleFile==null||formData.singleFile==null">
|
||||||
<file-upload @getFile="getAttachment" :multiple="false" :maxSize="1" :showFileList="showFileList" @delete="deleteAttachment"
|
<file-upload @getFile="getAttachment" :multiple="false"
|
||||||
:disabled="isSingleFile" />
|
:disabled="isSingleFile" ref="fileUploadRef"/>
|
||||||
<!-- -->
|
<!-- :showFileList="showFileList" @delete="deleteAttachment"-->
|
||||||
<!-- <fvTable style="width: 100%;max-height: 80px;" v-if="showSingleTable" :tableConfig="singleTableConfig"-->
|
<fvTable style="width: 100%;max-height: 80px;" v-if="showSingleTable" :tableConfig="singleTableConfig"
|
||||||
<!-- :data="singleFileList" :isSettingCol="false" :pagination="false">-->
|
:data="singleFileList" :isSettingCol="false" :pagination="false">
|
||||||
<!-- <template #empty>-->
|
<template #empty>
|
||||||
<!-- <el-empty :image-size="90" description="暂无数据" style="padding: 0"/>-->
|
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
|
||||||
<!-- </template>-->
|
</template>
|
||||||
<!-- </fvTable>-->
|
</fvTable>
|
||||||
</template>
|
</template>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -209,6 +209,7 @@ const singleTableConfig = reactive({
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
const fileUploadRef=ref()
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
attachment: [{required: true, message: '请上传附件', trigger: ['blur', 'change']}],
|
attachment: [{required: true, message: '请上传附件', trigger: ['blur', 'change']}],
|
||||||
})
|
})
|
||||||
@@ -216,6 +217,7 @@ const applyForm = ref()
|
|||||||
const singleFile = ref(props.formData.singleFile)
|
const singleFile = ref(props.formData.singleFile)
|
||||||
const isSingleFile = ref(false)
|
const isSingleFile = ref(false)
|
||||||
const allFileList = ref([])
|
const allFileList = ref([])
|
||||||
|
const deleteFileVal = ref({})
|
||||||
const singleFileList = ref([])
|
const singleFileList = ref([])
|
||||||
if (props.formData.fileList !== null && props.formData.fileList?.length > 0) {
|
if (props.formData.fileList !== null && props.formData.fileList?.length > 0) {
|
||||||
allFileList.value = props.formData.fileList
|
allFileList.value = props.formData.fileList
|
||||||
@@ -277,11 +279,14 @@ const handleDelete = (row,type) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
const handleSingleDelete = (row) => {
|
const handleSingleDelete = (row) => {
|
||||||
|
console.log('row',row)
|
||||||
|
// fileUploadRef.value.handleRemove(deleteFileVal.value.id)
|
||||||
handleDelete(row, 'single')
|
handleDelete(row, 'single')
|
||||||
}
|
}
|
||||||
const getAttachment = (val) => {
|
const getAttachment = (val) => {
|
||||||
console.log('getAttachment', val)
|
console.log('getAttachment', val)
|
||||||
isSingleFile.value = true
|
isSingleFile.value = true
|
||||||
|
// deleteFileVal.value=val
|
||||||
emit('getAttachment', val)
|
emit('getAttachment', val)
|
||||||
}
|
}
|
||||||
const getOtherFile = (val) => {
|
const getOtherFile = (val) => {
|
||||||
|
|||||||
@@ -44,10 +44,12 @@ const props = defineProps({
|
|||||||
showFileList: {
|
showFileList: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
}, disabled: {
|
},
|
||||||
|
disabled: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
}, multiple: {
|
},
|
||||||
|
multiple: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
}
|
}
|
||||||
@@ -98,7 +100,9 @@ const uploadError = () => {
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
defineExpose({
|
||||||
|
handleRemove
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -68,31 +68,31 @@ export default defineConfig({
|
|||||||
strictPort: false,
|
strictPort: false,
|
||||||
open: true,
|
open: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
// '/api/workflow': {
|
'/api/workflow': {
|
||||||
// // target: 'http://frp.feashow.cn:31800/',
|
target: 'http://frp.feashow.cn:31800/',
|
||||||
// target: 'http://clay.frp.feashow.cn/',
|
// target: 'http://clay.frp.feashow.cn/',
|
||||||
// // target: 'http://192.168.31.175:8000',
|
// target: 'http://192.168.31.175:8000',
|
||||||
// changeOrigin: true,
|
changeOrigin: true,
|
||||||
// rewrite: (path) => path.replace(/^\/api/, '')
|
rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
// },
|
},
|
||||||
// '/api/admin': {
|
// '/api/admin': {
|
||||||
// // target: 'http://frp.feashow.cn:31800/',
|
// // target: 'http://frp.feashow.cn:31800/',
|
||||||
// target: 'http://clay.frp.feashow.cn/',
|
// target: 'http://clay.frp.feashow.cn/',
|
||||||
// // target: 'http://192.168.31.175:8000',
|
// // target: 'http://192.168.31.175:8000',
|
||||||
// changeOrigin: true,
|
// changeOrigin: true,
|
||||||
// rewrite: (path) => path.replace(/^\/api/, '')
|
// rewrite: (path) => path.replace(/^\/summary/, '')
|
||||||
// },
|
// },
|
||||||
'/api': {
|
'/api': {
|
||||||
// target: 'http://mosr.feashow.cn/',
|
target: 'http://mosr.feashow.cn',
|
||||||
target: 'http://10.7.127.57:8000',
|
// target: 'http://clay.frp.feashow.cn',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, '')
|
// rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
},
|
},
|
||||||
'/api/notice-ws': {
|
// '/api/notice-ws': {
|
||||||
target: 'ws://mosr.feashow.cn/api/notice-ws',
|
// target: 'ws://mosr.feashow.cn/summary/notice-ws',
|
||||||
ws: true,
|
// ws: true,
|
||||||
changeOrigin: true,
|
// changeOrigin: true,
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user